-
Notifications
You must be signed in to change notification settings - Fork 574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for different codal message bus listener flags #10054
Conversation
@@ -563,13 +571,43 @@ namespace pxsim { | |||
|
|||
export type EventIDType = number | string; | |||
|
|||
class EventHandler { | |||
private busy = 0; | |||
constructor(public handler: RefAction, public flags: number) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit pedantic, but wondering if the flags
parameter will be able to pass on multiple flags or just one at a time since it has type number?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm matching the codal naming here, but actually numbers can hold up to 32 flags (one for each bit)
@@ -3,6 +3,14 @@ | |||
namespace pxsim { | |||
const MIN_MESSAGE_WAIT_MS = 200; | |||
let tracePauseMs = 0; | |||
|
|||
enum MessageListenerFlags { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wanted to put this here for reference: https://github.com/lancaster-university/codal-core/blob/509086cc8590465041b15493ab52b56e7071c110/inc/core/CodalListener.h#L33-L41
Also, just wanted to know why we're not including all of the defined flags here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those other ones are internal only AFAIK
Co-authored-by: Sarah Rietkerk <49178322+srietkerk@users.noreply.github.com>
This adds simulator support for the various CODAL message bus listener modes. These modes are:
this is part of the fix for microsoft/pxt-microbit#5709, i'll have two more prs (one in pxt-common-packages and one in pxt-microbit)