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

Committer:
guiott
Date:
Fri Feb 03 16:29:52 2012 +0000
Revision:
3:a2f9eb3b8a16
Parent:
2:8917036cbf69

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
guiott 0:d177c0087d1f 1 // tasks -------------------------------
guiott 0:d177c0087d1f 2
guiott 0:d177c0087d1f 3 // Task 1 - GPS Serial Task
guiott 0:d177c0087d1f 4 #define GPS_SERIAL_TASK 1
guiott 0:d177c0087d1f 5 #define GPS_SER_PRIORITY 50
guiott 0:d177c0087d1f 6 #define GPS_SER_STACK_SZ 2048
guiott 0:d177c0087d1f 7 void GpsSerialTask(void);
guiott 0:d177c0087d1f 8
guiott 0:d177c0087d1f 9 // Task 2 - Keypad read
guiott 0:d177c0087d1f 10 #define KEYPAD_TASK 2
guiott 0:d177c0087d1f 11 #define KEYPAD_PRIORITY 50
guiott 0:d177c0087d1f 12 #define KEYPAD_STACK_SZ 256
guiott 0:d177c0087d1f 13 void KeypadTask(void);
guiott 0:d177c0087d1f 14
guiott 0:d177c0087d1f 15 // Task 3 - Show LCD
guiott 0:d177c0087d1f 16 #define SHOW_LCD_TASK 3
guiott 0:d177c0087d1f 17 #define SHOW_LCD_PRIORITY 50
guiott 0:d177c0087d1f 18 #define SHOW_LCD_STACK_SZ 256
guiott 0:d177c0087d1f 19 void ShowLcdTask(void);
guiott 0:d177c0087d1f 20
guiott 0:d177c0087d1f 21 // Task 4 - Led Blink
guiott 0:d177c0087d1f 22 #define LED_BLINK_TASK 4
guiott 0:d177c0087d1f 23 #define LED_BLINK_PRIORITY 50
guiott 0:d177c0087d1f 24 #define LED_BLINK_STACK_SZ 256
guiott 0:d177c0087d1f 25 void LedBlinkTask(void);
guiott 0:d177c0087d1f 26
guiott 0:d177c0087d1f 27 // Task 5 - Set Time
guiott 0:d177c0087d1f 28 #define SET_TIME_TASK 5
guiott 0:d177c0087d1f 29 #define SET_TIME_PRIORITY 50
guiott 0:d177c0087d1f 30 #define SET_TIME_STACK_SZ 256
guiott 0:d177c0087d1f 31 void SetTimeTask(void);
guiott 0:d177c0087d1f 32
guiott 0:d177c0087d1f 33 // Task 6 - Show PC
guiott 0:d177c0087d1f 34 #define SHOW_PC_TASK 6
guiott 0:d177c0087d1f 35 #define SHOW_PC_PRIORITY 50
guiott 0:d177c0087d1f 36 #define SHOW_PC_STACK_SZ 512
guiott 0:d177c0087d1f 37 void ShowPcTask(void);
guiott 0:d177c0087d1f 38
guiott 0:d177c0087d1f 39 // Task 7 - LCD backlight dim
guiott 0:d177c0087d1f 40 #define LCD_LIGHT_DIM_TASK 7
guiott 0:d177c0087d1f 41 #define LCD_LIGHT_DIM_PRIORITY 50
guiott 0:d177c0087d1f 42 #define LCD_LIGHT_DIM_STACK_SZ 256
guiott 0:d177c0087d1f 43 void LcdLightDimTask(void);
guiott 0:d177c0087d1f 44
guiott 0:d177c0087d1f 45 // Task 8 - Temp task used for tests
guiott 0:d177c0087d1f 46 #define TEMP_TASK 8
guiott 0:d177c0087d1f 47 #define TEMP_PRIORITY 50
guiott 0:d177c0087d1f 48 #define TEMP_STACK_SZ 32
guiott 0:d177c0087d1f 49 void TempTask(void);
guiott 0:d177c0087d1f 50
guiott 2:8917036cbf69 51 // Task 9 - Kick the WDT dog
guiott 2:8917036cbf69 52 #define WDT_TASK 9
guiott 2:8917036cbf69 53 #define WDT_PRIORITY 90
guiott 2:8917036cbf69 54 #define WDT_STACK_SZ 128
guiott 2:8917036cbf69 55 void WdtTask(void);
guiott 2:8917036cbf69 56
guiott 2:8917036cbf69 57
guiott 2:8917036cbf69 58 #define NUM_TASKS 9
guiott 0:d177c0087d1f 59
guiott 0:d177c0087d1f 60 // timers ------------------------------
guiott 0:d177c0087d1f 61 #define KEYPAD_TMR 0
guiott 0:d177c0087d1f 62 #define SHOW_LCD_TMR 1
guiott 0:d177c0087d1f 63 #define LED_BLINK_TMR 2
guiott 0:d177c0087d1f 64 #define SET_TIME_TMR 3
guiott 0:d177c0087d1f 65 #define SHOW_PC_TMR 4
guiott 0:d177c0087d1f 66 #define LCD_LIGHT_DIM_OFF_TMR 5
guiott 0:d177c0087d1f 67 #define TEMP_TMR 6
guiott 2:8917036cbf69 68 #define WDT_TMR 7
guiott 0:d177c0087d1f 69
guiott 2:8917036cbf69 70 #define NUM_TIMERS 8
guiott 0:d177c0087d1f 71
guiott 0:d177c0087d1f 72 // resources ---------------------------
guiott 0:d177c0087d1f 73 #define PC_SERIAL 0
guiott 0:d177c0087d1f 74 #define PC_SERIAL_PRIO 70
guiott 0:d177c0087d1f 75
guiott 0:d177c0087d1f 76 #define GPS_SERIAL 1
guiott 0:d177c0087d1f 77 #define GPS_SERIAL_PRIO 70
guiott 0:d177c0087d1f 78
guiott 0:d177c0087d1f 79 #define LCD 2
guiott 0:d177c0087d1f 80 #define LCD_PRIO 70
guiott 0:d177c0087d1f 81
guiott 0:d177c0087d1f 82 #define LCD_LIGHT_DIM 3
guiott 0:d177c0087d1f 83 #define LCD_LIGHT_DIM_PRIO 70
guiott 0:d177c0087d1f 84
guiott 0:d177c0087d1f 85 #define NUM_RESOURCES 4
guiott 0:d177c0087d1f 86
guiott 0:d177c0087d1f 87 // Events ------------------------------
guiott 0:d177c0087d1f 88 #define GPS_SERIAL_IN_EVT 0x00000001
guiott 0:d177c0087d1f 89 #define KEYPAD_EVT 0x00000002
guiott 0:d177c0087d1f 90 #define SHOW_LCD_EVT 0x00000004
guiott 0:d177c0087d1f 91 #define LED_BLINK_EVT 0x00000008
guiott 0:d177c0087d1f 92 #define SET_TIME_EVT 0x00000010
guiott 0:d177c0087d1f 93 #define SHOW_PC_EVT 0x00000020
guiott 0:d177c0087d1f 94 #define LCD_LIGHT_DIM_ON_EVT 0x00000040
guiott 0:d177c0087d1f 95 #define LCD_LIGHT_DIM_OFF_EVT 0x00000080
guiott 0:d177c0087d1f 96 #define TEMP_EVT 0x00000100
guiott 2:8917036cbf69 97 #define WDT_EVT 0x00000200
guiott 0:d177c0087d1f 98