tao lao

Dependencies:   mbed wave_player 4DGL-uLCD-SE MMA8452

Committer:
DCchico
Date:
Fri Oct 23 16:30:18 2020 -0400
Revision:
2:4947d6a82971
Parent:
1:10330bce85cb
shell

Who changed what in which revision?

UserRevisionLine numberNew contents of line
DCchico 1:10330bce85cb 1 // ============================================
DCchico 1:10330bce85cb 2 // The header file for general project settings
DCchico 2:4947d6a82971 3 //
DCchico 2:4947d6a82971 4 // Copyright 2020 Georgia Tech. All rights reserved.
DCchico 2:4947d6a82971 5 // The materials provided by the instructor in this course are for
DCchico 2:4947d6a82971 6 // the use of the students currently enrolled in the course.
DCchico 2:4947d6a82971 7 // Copyrighted course materials may not be further disseminated.
DCchico 2:4947d6a82971 8 // This file must not be made publicly available anywhere.
DCchico 2:4947d6a82971 9 //==================================================================
DCchico 1:10330bce85cb 10 #ifndef GLOBAL_H
DCchico 1:10330bce85cb 11 #define GLOBAL_H
DCchico 1:10330bce85cb 12
DCchico 1:10330bce85cb 13 // Include all the hardware libraries
DCchico 1:10330bce85cb 14 #include "mbed.h"
DCchico 1:10330bce85cb 15 #include "wave_player.h"
DCchico 1:10330bce85cb 16 #include "MMA8452.h"
DCchico 1:10330bce85cb 17 #include "uLCD_4DGL.h"
DCchico 1:10330bce85cb 18 #include "SDFileSystem.h"
DCchico 1:10330bce85cb 19
DCchico 1:10330bce85cb 20 // Declare the hardware interface objects
DCchico 1:10330bce85cb 21 extern uLCD_4DGL uLCD; // LCD Screen
DCchico 1:10330bce85cb 22 extern SDFileSystem sd; // SD Card
DCchico 1:10330bce85cb 23 extern Serial pc; // USB Console output
DCchico 1:10330bce85cb 24 extern MMA8452 acc; // Accelerometer
DCchico 1:10330bce85cb 25 extern DigitalIn button1; // Pushbuttons
DCchico 1:10330bce85cb 26 extern DigitalIn button2;
DCchico 1:10330bce85cb 27 extern DigitalIn button3;
DCchico 1:10330bce85cb 28 extern AnalogOut DACout; // Speaker
DCchico 1:10330bce85cb 29 extern PwmOut speaker;
DCchico 1:10330bce85cb 30 extern wave_player waver;
DCchico 1:10330bce85cb 31
DCchico 1:10330bce85cb 32
DCchico 1:10330bce85cb 33 // Global settings
DCchico 1:10330bce85cb 34 #define BACKGROUND_COLOR 0x000000 //black
DCchico 1:10330bce85cb 35 #define LANDSCAPE_HEIGHT 4 // number of pixel on the screen
DCchico 1:10330bce85cb 36 #define MAX_BUILDING_HEIGHT 10 // number of pixel on the screen
DCchico 1:10330bce85cb 37
DCchico 1:10330bce85cb 38
DCchico 1:10330bce85cb 39 // === [define the macro of error heandle function] ===
DCchico 1:10330bce85cb 40 // when the condition (c) is not true, assert the program and show error code
DCchico 1:10330bce85cb 41 #define ASSERT_P(c,e) do { \
DCchico 1:10330bce85cb 42 if(!(c)){ \
DCchico 1:10330bce85cb 43 pc.printf("\nERROR:%d\n",e); \
DCchico 1:10330bce85cb 44 while(1); \
DCchico 1:10330bce85cb 45 } \
DCchico 1:10330bce85cb 46 } while (0)
DCchico 1:10330bce85cb 47
DCchico 1:10330bce85cb 48 // === [error code] ===
DCchico 1:10330bce85cb 49 #define ERROR_NONE 0 // All good in the hood
DCchico 1:10330bce85cb 50 #define ERROR_MEH -1 // This is how errors are done
DCchico 1:10330bce85cb 51
DCchico 1:10330bce85cb 52 #endif //GLOBAL_H