Michael Parrish / Mbed 2 deprecated EMBEDDED4180

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers globals.h Source File

globals.h

00001 // ============================================
00002 // The header file for general project settings
00003 // Spring 2018 Gatech ECE2035
00004 //=============================================
00005 #ifndef GLOBAL_H
00006 #define GLOBAL_H
00007 
00008 // Include all the hardware libraries
00009 #include "mbed.h"
00010 //#include "wave_player.h"
00011 //#include "MMA8452.h"
00012 //#include "uLCD_4DGL.h"
00013 //#include "SDFileSystem.h"
00014 
00015 // Declare the hardware interface objects
00016 /*
00017 This file holds all the global variables that are accessable from all the 
00018 different files in this project. You see below most of it looks like hardware.
00019 That's because it is hardware! The uLCD object is how you interact with the LCD
00020 screen. The sd variable is how you interact with the sd card and so on for all
00021 the other variables.
00022 */
00023 //extern uLCD_4DGL uLCD;      // LCD Screen
00024 //extern SDFileSystem sd;     // SD Card
00025 /*extern MMA8452 acc;       // Accelerometer
00026 extern DigitalIn button1;   // Pushbuttons
00027 extern DigitalIn button2;
00028 extern DigitalIn button3;
00029 extern AnalogOut DACout;    // Speaker
00030 //extern PwmOut speaker;
00031 //extern wave_player waver;
00032 */
00033 // === [define the macro of error heandle function] ===
00034 // when the condition (c) is not true, assert the program and show error code
00035 #define ASSERT_P(c,e) do { \
00036     if(!(c)){ \
00037         pc.printf("\nERROR:%d\n",e); \
00038         while(1); \
00039     } \
00040 } while (0)
00041 
00042 void draw_game(int init);
00043 
00044 
00045 
00046 
00047 
00048 // === [error code] ===
00049 #define ERROR_NONE 0 // All good in the hood
00050 #define ERROR_MEH -1 // This is how errors are done
00051 
00052 #endif //GLOBAL_H