Skip to content
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

Moved restart into pairing mode code to Microbit.cpp #13

Conversation

microbit-sam
Copy link
Contributor

@microbit-sam microbit-sam commented Oct 5, 2018

  • The event listener now listens for any events
  • The event to reset into pairing mode is guarded by an #ifdef checking for pairing mode

lancaster-university/microbit-dal#395

@jaustin
Copy link

jaustin commented Nov 20, 2018

@microbit-sam can we include the change to the module.json file to point to the new DAL release (once that's happened) in this PR, so it gets merged as one?

@@ -121,7 +121,7 @@ void MicroBit::init()
// Create an event handler to trap any handlers being created for I2C services.
// We do this to enable initialisation of those services only when they're used,
// which saves processor time, memeory and battery life.
messageBus.listen(MICROBIT_ID_MESSAGE_BUS_LISTENER, MICROBIT_EVT_ANY, this, &MicroBit::onListenerRegisteredEvent);
messageBus.listen(MICROBIT_ID_ANY, MICROBIT_EVT_ANY, this, &MicroBit::onListenerRegisteredEvent);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Joe suggests creating a new MICROBIT_ID_SYSTEM event to prevent churn

  • Things like the accelerometer will constantly be firing events at this
  • A system event could be used for other things

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MICROBIT_ID_MESSAGE_BUS_LISTENER renamed to SYSTEM

@microbit-sam
Copy link
Contributor Author

Superseded by #15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants