this is lame
Dependencies: mbed wave_player 4DGL-uLCD-SE MMA8452
globals.h@2:c5848a443855, 2019-04-11 (annotated)
- Committer:
- kalejandro3
- Date:
- Thu Apr 11 23:01:11 2019 +0000
- Revision:
- 2:c5848a443855
- Parent:
- 0:35660d7952f7
first mercurial commit;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rconnorlawson | 0:35660d7952f7 | 1 | // ============================================ |
rconnorlawson | 0:35660d7952f7 | 2 | // The header file for general project settings |
kalejandro3 | 2:c5848a443855 | 3 | // Spring 2019 Gatech ECE2035 |
rconnorlawson | 0:35660d7952f7 | 4 | //============================================= |
rconnorlawson | 0:35660d7952f7 | 5 | #ifndef GLOBAL_H |
rconnorlawson | 0:35660d7952f7 | 6 | #define GLOBAL_H |
rconnorlawson | 0:35660d7952f7 | 7 | |
kalejandro3 | 2:c5848a443855 | 8 | #define NUMBUCK 50 |
kalejandro3 | 2:c5848a443855 | 9 | #define WIDTH 125 |
kalejandro3 | 2:c5848a443855 | 10 | #define HEIGHT 50 |
kalejandro3 | 2:c5848a443855 | 11 | |
rconnorlawson | 0:35660d7952f7 | 12 | // Include all the hardware libraries |
rconnorlawson | 0:35660d7952f7 | 13 | #include "mbed.h" |
rconnorlawson | 0:35660d7952f7 | 14 | #include "wave_player.h" |
rconnorlawson | 0:35660d7952f7 | 15 | #include "MMA8452.h" |
rconnorlawson | 0:35660d7952f7 | 16 | #include "uLCD_4DGL.h" |
rconnorlawson | 0:35660d7952f7 | 17 | #include "SDFileSystem.h" |
rconnorlawson | 0:35660d7952f7 | 18 | |
rconnorlawson | 0:35660d7952f7 | 19 | // Declare the hardware interface objects |
rconnorlawson | 0:35660d7952f7 | 20 | extern uLCD_4DGL uLCD; // LCD Screen |
rconnorlawson | 0:35660d7952f7 | 21 | extern SDFileSystem sd; // SD Card |
rconnorlawson | 0:35660d7952f7 | 22 | extern Serial pc; // USB Console output |
rconnorlawson | 0:35660d7952f7 | 23 | extern MMA8452 acc; // Accelerometer |
rconnorlawson | 0:35660d7952f7 | 24 | extern DigitalIn button1; // Pushbuttons |
rconnorlawson | 0:35660d7952f7 | 25 | extern DigitalIn button2; |
rconnorlawson | 0:35660d7952f7 | 26 | extern DigitalIn button3; |
rconnorlawson | 0:35660d7952f7 | 27 | extern AnalogOut DACout; // Speaker |
rconnorlawson | 0:35660d7952f7 | 28 | extern PwmOut speaker; |
rconnorlawson | 0:35660d7952f7 | 29 | extern wave_player waver; |
rconnorlawson | 0:35660d7952f7 | 30 | |
rconnorlawson | 0:35660d7952f7 | 31 | // === [define the macro of error heandle function] === |
rconnorlawson | 0:35660d7952f7 | 32 | // when the condition (c) is not true, assert the program and show error code |
rconnorlawson | 0:35660d7952f7 | 33 | #define ASSERT_P(c,e) do { \ |
rconnorlawson | 0:35660d7952f7 | 34 | if(!(c)){ \ |
rconnorlawson | 0:35660d7952f7 | 35 | pc.printf("\nERROR:%d\n",e); \ |
rconnorlawson | 0:35660d7952f7 | 36 | while(1); \ |
rconnorlawson | 0:35660d7952f7 | 37 | } \ |
rconnorlawson | 0:35660d7952f7 | 38 | } while (0) |
rconnorlawson | 0:35660d7952f7 | 39 | |
rconnorlawson | 0:35660d7952f7 | 40 | // === [error code] === |
rconnorlawson | 0:35660d7952f7 | 41 | #define ERROR_NONE 0 // All good in the hood |
rconnorlawson | 0:35660d7952f7 | 42 | #define ERROR_MEH -1 // This is how errors are done |
rconnorlawson | 0:35660d7952f7 | 43 | |
rconnorlawson | 0:35660d7952f7 | 44 | #endif //GLOBAL_H |