microbit: refactored event codes used by a shared listener "MICROBIT_ID_NOTIFY"

There was no common place to track event codes used in Events intended
for the shared channel using the ID MICROBIT_ID_NOTIFY. This commit
adds a common place for these Event codes.
This commit is contained in:
James Devine 2016-03-26 19:39:05 +00:00
parent 776131e4cb
commit 728604423f
5 changed files with 14 additions and 7 deletions

7
inc/core/NotifyEvents.h Normal file
View File

@ -0,0 +1,7 @@
#ifndef NOTIFY_EVENTS_H
#define NOTIFY_EVENTS_H
#define MICROBIT_DISPLAY_EVT_FREE 1
#define MICROBIT_SERIAL_EVT_TX_EMPTY 2
#endif

View File

@ -14,8 +14,7 @@
* Event codes raised by MicroBitDisplay
*/
#define MICROBIT_DISPLAY_EVT_ANIMATION_COMPLETE 1
#define MICROBIT_DISPLAY_EVT_FREE 2
#define MICROBIT_DISPLAY_EVT_LIGHT_SENSE 4
#define MICROBIT_DISPLAY_EVT_LIGHT_SENSE 2
//
// Internal constants

View File

@ -7,10 +7,9 @@
#define MICROBIT_SERIAL_DEFAULT_BAUD_RATE 115200
#define MICROBIT_SERIAL_DEFAULT_BUFFER_SIZE 20
#define MICROBIT_SERIAL_EVT_TX_EMPTY 1
#define MICROBIT_SERIAL_EVT_DELIM_MATCH 2
#define MICROBIT_SERIAL_EVT_HEAD_MATCH 3
#define MICROBIT_SERIAL_EVT_RX_FULL 4
#define MICROBIT_SERIAL_EVT_DELIM_MATCH 1
#define MICROBIT_SERIAL_EVT_HEAD_MATCH 2
#define MICROBIT_SERIAL_EVT_RX_FULL 3
#define MICROBIT_SERIAL_RX_IN_USE 1
#define MICROBIT_SERIAL_TX_IN_USE 2

View File

@ -8,6 +8,7 @@
#include "MicroBitSystemTimer.h"
#include "MicroBitFiber.h"
#include "ErrorNo.h"
#include "NotifyEvents.h"
const int greyScaleTimings[MICROBIT_DISPLAY_GREYSCALE_BIT_DEPTH] = {1, 23, 70, 163, 351, 726, 1476, 2976};

View File

@ -3,6 +3,7 @@
#include "ErrorNo.h"
#include "MicroBitComponent.h"
#include "MicroBitFiber.h"
#include "NotifyEvents.h"
uint8_t MicroBitSerial::status = 0;