From 97cf927b2b15e06b2f327aac3c04ae5a66463b63 Mon Sep 17 00:00:00 2001 From: Richard Knoll Date: Fri, 26 Jul 2024 11:29:08 -0700 Subject: [PATCH] Actually pass the flags for message bus listeners --- libs/core/codal.cpp | 2 +- sim/state/misc.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/core/codal.cpp b/libs/core/codal.cpp index 70275c4b5ec..40fb3925363 100644 --- a/libs/core/codal.cpp +++ b/libs/core/codal.cpp @@ -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); } diff --git a/sim/state/misc.ts b/sim/state/misc.ts index 91fe481ee1e..83a9a662af4 100644 --- a/sim/state/misc.ts +++ b/sim/state/misc.ts @@ -35,7 +35,7 @@ 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) { @@ -43,7 +43,7 @@ namespace pxsim.control { runtime.queueDisplayUpdate(); } } - pxtcore.registerWithDal(id, evid, handler) + pxtcore.registerWithDal(id, evid, handler, flags) } export function eventTimestamp() {