microbit: Fixed duplicated id for Thermometer

There was a duplication in IDs for MICROBIT_ID_THERMOMETER and MICROBIT_ID_IO_P0
for the event bus. This has been rectified by appending the MICROBIT_ID_THERMOMETER
This commit is contained in:
James Devine 2016-01-11 13:39:56 +00:00
parent 13f6bce86b
commit 493e174fe8
1 changed files with 26 additions and 25 deletions

View File

@ -16,22 +16,21 @@
#define MICROBIT_ID_ACCELEROMETER 4 #define MICROBIT_ID_ACCELEROMETER 4
#define MICROBIT_ID_COMPASS 5 #define MICROBIT_ID_COMPASS 5
#define MICROBIT_ID_DISPLAY 6 #define MICROBIT_ID_DISPLAY 6
#define MICROBIT_ID_THERMOMETER 7
//EDGE connector events //EDGE connector events
#define MICROBIT_IO_PINS 20 #define MICROBIT_IO_PINS 20
#define MICROBIT_ID_IO_P0 7 //P0 is the left most pad (ANALOG/DIGITAL) #define MICROBIT_ID_IO_P0 7 //P0 is the left most pad (ANALOG/DIGITAL)
#define MICROBIT_ID_IO_P1 8 //P1 is the middle pad (ANALOG/DIGITAL) #define MICROBIT_ID_IO_P1 8 //P1 is the middle pad (ANALOG/DIGITAL)
#define MICROBIT_ID_IO_P2 9 //P2 is the right most pad (ANALOG/DIGITAL) #define MICROBIT_ID_IO_P2 9 //P2 is the right most pad (ANALOG/DIGITAL)
#define MICROBIT_ID_IO_P3 10 //COL1 (ANALOG/DIGITAL) #define MICROBIT_ID_IO_P3 10 //COL1 (ANALOG/DIGITAL)
#define MICROBIT_ID_IO_P4 11 //BTN_A #define MICROBIT_ID_IO_P4 11 //BTN_A
#define MICROBIT_ID_IO_P5 12 //COL2 (ANALOG/DIGITAL) #define MICROBIT_ID_IO_P5 12 //COL2 (ANALOG/DIGITAL)
#define MICROBIT_ID_IO_P6 13 //ROW2 #define MICROBIT_ID_IO_P6 13 //ROW2
#define MICROBIT_ID_IO_P7 14 //ROW1 #define MICROBIT_ID_IO_P7 14 //ROW1
#define MICROBIT_ID_IO_P8 15 //PIN 18 #define MICROBIT_ID_IO_P8 15 //PIN 18
#define MICROBIT_ID_IO_P9 16 //ROW3 #define MICROBIT_ID_IO_P9 16 //ROW3
#define MICROBIT_ID_IO_P10 17 //COL3 (ANALOG/DIGITAL) #define MICROBIT_ID_IO_P10 17 //COL3 (ANALOG/DIGITAL)
#define MICROBIT_ID_IO_P11 18 //BTN_B #define MICROBIT_ID_IO_P11 18 //BTN_B
#define MICROBIT_ID_IO_P12 19 //PIN 20 #define MICROBIT_ID_IO_P12 19 //PIN 20
#define MICROBIT_ID_IO_P13 20 //SCK #define MICROBIT_ID_IO_P13 20 //SCK
@ -42,20 +41,22 @@
#define MICROBIT_ID_IO_P20 25 //SDA #define MICROBIT_ID_IO_P20 25 //SDA
#define MICROBIT_ID_BUTTON_AB 26 // Button A+B multibutton #define MICROBIT_ID_BUTTON_AB 26 // Button A+B multibutton
#define MICROBIT_ID_GESTURE 27 // Gesture events #define MICROBIT_ID_GESTURE 27 // Gesture events
#define MICROBIT_ID_NOTIFY 1023 // Notfication channel, for general purpose synchronisation #define MICROBIT_ID_THERMOMETER 28
#define MICROBIT_ID_NOTIFY_ONE 1022 // Notfication channel, for general purpose synchronisation
#define MICROBIT_ID_NOTIFY 1023 // Notfication channel, for general purpose synchronisation
#define MICROBIT_ID_NOTIFY_ONE 1022 // Notfication channel, for general purpose synchronisation
class MicroBitComponent class MicroBitComponent
{ {
protected: protected:
uint16_t id; // Event Bus ID uint16_t id; // Event Bus ID
uint8_t status; // keeps track of various component state, and also indicates if data is ready. uint8_t status; // keeps track of various component state, and also indicates if data is ready.
public: public:
/** /**
* The default constructor of a MicroBitComponent * The default constructor of a MicroBitComponent
*/ */
@ -64,13 +65,13 @@ class MicroBitComponent
this->id = 0; this->id = 0;
this->status = 0; this->status = 0;
} }
/** /**
* Once added to the systemTickComponents array, this member function will be * Once added to the systemTickComponents array, this member function will be
* called in interrupt context on every system tick. * called in interrupt context on every system tick.
*/ */
virtual void systemTick(){ virtual void systemTick(){
} }
/** /**
@ -79,9 +80,9 @@ class MicroBitComponent
*/ */
virtual void idleTick() virtual void idleTick()
{ {
} }
/** /**
* When added to the idleThreadComponents array, this function will be called to determine * When added to the idleThreadComponents array, this function will be called to determine
* if and when data is ready. * if and when data is ready.
@ -89,12 +90,12 @@ class MicroBitComponent
*/ */
virtual int isIdleCallbackNeeded() virtual int isIdleCallbackNeeded()
{ {
return 0; return 0;
} }
virtual ~MicroBitComponent() virtual ~MicroBitComponent()
{ {
} }
}; };