A porting of a GPS decoding and presenting program within the mbos RTOS. It is not a definitive application but a study program to test NMEA full decoding library and a first approach to an RTOS. Many thanks to Andrew Levido for his support and his patience on teaching me the RTOS principles from the other side of the Earth. It uses NMEA library by Tim (xtimor@gmail.com) ported by Ken Todotani (http://mbed.org/users/todotani/) on public mbed library (http://mbed.org/users/todotani/programs/GPS_nmeaLib/5yo4h) also available, as original universal C library, on http://nmea.sourceforge.net

Dependencies:   mbos Watchdog TextLCD mbed ConfigFile

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Tasks.h Source File

Tasks.h

00001 // tasks -------------------------------
00002   
00003 // Task 1 - GPS Serial Task
00004 #define GPS_SERIAL_TASK              1
00005 #define GPS_SER_PRIORITY            50
00006 #define GPS_SER_STACK_SZ          2048
00007 void GpsSerialTask(void);  
00008 
00009 // Task 2 - Keypad read
00010 #define KEYPAD_TASK                  2
00011 #define KEYPAD_PRIORITY             50
00012 #define KEYPAD_STACK_SZ            256
00013 void KeypadTask(void);  
00014 
00015 // Task 3 - Show LCD
00016 #define SHOW_LCD_TASK                3
00017 #define SHOW_LCD_PRIORITY           50
00018 #define SHOW_LCD_STACK_SZ          256
00019 void ShowLcdTask(void);  
00020 
00021 // Task 4 - Led Blink
00022 #define LED_BLINK_TASK               4
00023 #define LED_BLINK_PRIORITY          50
00024 #define LED_BLINK_STACK_SZ         256
00025 void LedBlinkTask(void); 
00026 
00027 // Task 5 - Set Time
00028 #define SET_TIME_TASK                5
00029 #define SET_TIME_PRIORITY           50
00030 #define SET_TIME_STACK_SZ          256
00031 void SetTimeTask(void); 
00032 
00033 // Task 6 - Show PC
00034 #define SHOW_PC_TASK                 6
00035 #define SHOW_PC_PRIORITY            50
00036 #define SHOW_PC_STACK_SZ           512
00037 void ShowPcTask(void);  
00038 
00039 // Task 7 - LCD backlight dim
00040 #define LCD_LIGHT_DIM_TASK           7
00041 #define LCD_LIGHT_DIM_PRIORITY      50
00042 #define LCD_LIGHT_DIM_STACK_SZ     256
00043 void LcdLightDimTask(void);  
00044 
00045 // Task 8 - Temp task used for tests
00046 #define TEMP_TASK                    8
00047 #define TEMP_PRIORITY               50
00048 #define TEMP_STACK_SZ               32
00049 void TempTask(void);  
00050 
00051 // Task 9 - Kick the WDT dog
00052 #define WDT_TASK                     9
00053 #define WDT_PRIORITY                90
00054 #define WDT_STACK_SZ               128
00055 void WdtTask(void);  
00056 
00057 
00058 #define NUM_TASKS                    9
00059 
00060 // timers ------------------------------
00061 #define KEYPAD_TMR                   0
00062 #define SHOW_LCD_TMR                 1
00063 #define LED_BLINK_TMR                2
00064 #define SET_TIME_TMR                 3
00065 #define SHOW_PC_TMR                  4
00066 #define LCD_LIGHT_DIM_OFF_TMR        5
00067 #define TEMP_TMR                     6
00068 #define WDT_TMR                      7
00069 
00070 #define NUM_TIMERS                   8
00071 
00072 // resources ---------------------------
00073 #define PC_SERIAL                    0
00074 #define PC_SERIAL_PRIO              70
00075 
00076 #define GPS_SERIAL                   1
00077 #define GPS_SERIAL_PRIO             70
00078 
00079 #define LCD                          2
00080 #define LCD_PRIO                    70
00081 
00082 #define LCD_LIGHT_DIM                3
00083 #define LCD_LIGHT_DIM_PRIO          70
00084 
00085 #define NUM_RESOURCES                4
00086 
00087 // Events ------------------------------
00088 #define GPS_SERIAL_IN_EVT     0x00000001
00089 #define KEYPAD_EVT            0x00000002
00090 #define SHOW_LCD_EVT          0x00000004
00091 #define LED_BLINK_EVT         0x00000008
00092 #define SET_TIME_EVT          0x00000010
00093 #define SHOW_PC_EVT           0x00000020
00094 #define LCD_LIGHT_DIM_ON_EVT  0x00000040
00095 #define LCD_LIGHT_DIM_OFF_EVT 0x00000080
00096 #define TEMP_EVT              0x00000100
00097 #define WDT_EVT               0x00000200
00098