Skip to content

Commit

Permalink
Actually pass the flags for message bus listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
riknoll committed Jul 26, 2024
1 parent bd4bda1 commit 97cf927
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libs/core/codal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ static void initCodal() {

void registerWithDal(int id, int event, Action a, int flags) {
uBit.messageBus.ignore(id, event, dispatchForeground);
uBit.messageBus.listen(id, event, dispatchForeground, a);
uBit.messageBus.listen(id, event, dispatchForeground, a, (uint16_t) flags);
incr(a);
registerGCPtr(a);
}
Expand Down
4 changes: 2 additions & 2 deletions sim/state/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ namespace pxsim.basic {
namespace pxsim.control {
export var inBackground = thread.runInBackground;

export function onEvent(id: number, evid: number, handler: RefAction) {
export function onEvent(id: number, evid: number, handler: RefAction, flags: number) {
if (id == DAL.MICROBIT_ID_BUTTON_AB) {
const b = board().buttonPairState;
if (!b.usesButtonAB) {
b.usesButtonAB = true;
runtime.queueDisplayUpdate();
}
}
pxtcore.registerWithDal(id, evid, handler)
pxtcore.registerWithDal(id, evid, handler, flags)
}

export function eventTimestamp() {
Expand Down

0 comments on commit 97cf927

Please sign in to comment.