Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbos Watchdog TextLCD mbed ConfigFile
Startup.cpp
00001 #include "Startup.h" 00002 00003 void Initialize (void) 00004 { 00005 // initialize serial ports 00006 pc.baud(PCBAUD); // USB/serial 00007 gps.baud(GPSBAUD); 00008 00009 gps.attach( &GpsSerialIsr ); // Start serial interrupt 00010 00011 nmea_property()->trace_func = &trace_h; 00012 nmea_property()->error_func = &error_h; 00013 nmea_zero_INFO(&info); 00014 nmea_parser_init(&parser); 00015 00016 LcdBklight = 0; 00017 wait(0.5); 00018 lcd.cls(); 00019 LcdBklight=1; // Backlight on 00020 00021 // LCD splash screen 00022 lcd.locate(0,1); 00023 lcd.printf(Ver1); 00024 lcd.locate(0,2); 00025 lcd.printf(Ver2); 00026 wait(4.0); 00027 lcd.cls(); 00028 00029 // Console splash screen 00030 pc.printf(Ver1); 00031 pc.printf("\n"); 00032 pc.printf(Ver2); 00033 pc.printf("\n"); 00034 pc.printf("input a number to enable debug, 0 to disable\n"); 00035 00036 os.CreateTask(GPS_SERIAL_TASK, GPS_SER_PRIORITY, GPS_SER_STACK_SZ, GpsSerialTask); 00037 os.CreateTask(KEYPAD_TASK, KEYPAD_PRIORITY, KEYPAD_STACK_SZ, KeypadTask); 00038 os.CreateTask(SHOW_LCD_TASK, SHOW_LCD_PRIORITY, SHOW_LCD_STACK_SZ, ShowLcdTask); 00039 os.CreateTask(LED_BLINK_TASK, LED_BLINK_PRIORITY, LED_BLINK_STACK_SZ, LedBlinkTask); 00040 os.CreateTask(SET_TIME_TASK, SET_TIME_PRIORITY, SET_TIME_STACK_SZ, SetTimeTask); 00041 os.CreateTask(SHOW_PC_TASK, SHOW_PC_PRIORITY, SHOW_PC_STACK_SZ, ShowPcTask); 00042 os.CreateTask(LCD_LIGHT_DIM_TASK, LCD_LIGHT_DIM_PRIORITY, LCD_LIGHT_DIM_STACK_SZ, LcdLightDimTask); 00043 os.CreateTask(TEMP_TASK, TEMP_PRIORITY, TEMP_STACK_SZ, TempTask); 00044 os.CreateTask(WDT_TASK, WDT_PRIORITY, WDT_STACK_SZ, WdtTask); 00045 00046 os.CreateResource(GPS_SERIAL,GPS_SERIAL_PRIO); 00047 os.CreateResource(PC_SERIAL,PC_SERIAL_PRIO); 00048 os.CreateResource(LCD,LCD_PRIO); 00049 os.CreateResource(LCD_LIGHT_DIM,LCD_LIGHT_DIM_PRIO); 00050 00051 os.CreateTimer(KEYPAD_TMR, KEYPAD_TASK, KEYPAD_EVT); 00052 os.CreateTimer(SHOW_LCD_TMR, SHOW_LCD_TASK, SHOW_LCD_EVT); 00053 os.CreateTimer(LED_BLINK_TMR, LED_BLINK_TASK, LED_BLINK_EVT); 00054 os.CreateTimer(SET_TIME_TMR, SET_TIME_TASK, SET_TIME_EVT); 00055 os.CreateTimer(SHOW_PC_TMR, SHOW_PC_TASK, SHOW_PC_EVT); 00056 os.CreateTimer(LCD_LIGHT_DIM_OFF_TMR, LCD_LIGHT_DIM_TASK, LCD_LIGHT_DIM_OFF_EVT); 00057 os.CreateTimer(TEMP_TMR, TEMP_TASK, TEMP_EVT); 00058 os.CreateTimer(WDT_TMR, WDT_TASK, WDT_EVT); 00059 00060 os.SetTimer(LCD_LIGHT_DIM_OFF_TMR, LCD_LIGHT_DIM_TIMER, 0); 00061 00062 // os.SetTimer(TEMP_TMR, TEMP_TIMER, TEMP_TIMER); // enabled just for test or debug 00063 00064 ReadCfg(Config); 00065 WriteCfg(); 00066 ReadCfg(Config); 00067 }
Generated on Thu Jul 14 2022 14:06:47 by
1.7.2