Skip to content

Commit e115f21

Browse files
committed
fix compile errors
1 parent fc7aec2 commit e115f21

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

libs/core/_locales/core-jsdoc-strings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@
313313
"control.gcStats": "Get various statistics about the garbage collector (GC)",
314314
"control.heapDump": "Force GC and halt waiting for debugger to do a full heap dump.",
315315
"control.heapSnapshot": "Record a heap snapshot to debug memory leaks.",
316+
"control.ignoreEvent": "Unregisters an event handler.",
316317
"control.inBackground": "Schedules code that run in the background.",
317318
"control.micros": "Gets current time in microseconds. Overflows every ~18 minutes.",
318319
"control.millis": "Gets the number of milliseconds elapsed since power on.",

libs/core/codal.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ void registerWithDal(int id, int event, Action a, int flags) {
103103
}
104104

105105
void unregisterFromDal(int id, int event, Action a) {
106-
uBit.messageBus.ignore(id, event, dispatchForeground, a);
106+
uBit.messageBus.ignore(id, event, dispatchForeground);
107107
decr(a);
108108
unregisterGCPtr(a);
109109
}

libs/core/control.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "pxt.h"
22

33
extern uint32_t __StackTop;
4+
extern void unregisterFromDal(int id, int event, Action a);
45

56
/**
67
* How to create the event.

libs/core/shims.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,12 @@ declare namespace control {
420420
//% blockExternalInputs=1 flags.defl=0 shim=control::onEvent
421421
function onEvent(src: int32, value: int32, handler: () => void, flags?: int32): void;
422422

423+
/**
424+
* Unregisters an event handler.
425+
*/
426+
//% shim=control::ignoreEvent
427+
function ignoreEvent(src: int32, value: int32, handler: () => void): void;
428+
423429
/**
424430
* Gets the value of the last event executed on the bus
425431
*/

0 commit comments

Comments
 (0)