// ************************************************************************************************* // @fn SetMyDefaults // @brief Set my default preferences // @param none // @return none // ************************************************************************************************* void SetMyDefaults(void) { DailyCorr = MY_DAILY_CORRECTION_SEC; WeeklyCorr = MY_WEEKLY_CORRECTION_SEC; DST_AutoFlag = 1; // DST_AUTO AmbientPressureOffset = MY_AMBIENT_PRESSURE_OFFSET; sAlt.altitude = MY_ALTITUDE; // Update pressure table update_pressure_table(sAlt.altitude, sAlt.pressure, sAlt.temperature); //Set cdtimer to a 6:30 minute default memcpy(scdtimer.defaultTime, "000630", sizeof(scdtimer.time)); reset_cdtimer(); // Set temperature offset sTemp.offset += MY_TEMPERATURE_OFFSET; // Automatic reset after Unified Clock System failed sUcsResetHandling.status = UCSRESET_AUTO; }
// ************************************************************************************************* // @fn init_global_variables // @brief Initialize global variables. // @param none // @return none // ************************************************************************************************* void init_global_variables(void) { // -------------------------------------------- // Apply default settings // set menu pointers to default menu items ptrMenu_L1 = &menu_L1_Time; // ptrMenu_L1 = &menu_L1_Alarm; // ptrMenu_L1 = &menu_L1_Heartrate; // ptrMenu_L1 = &menu_L1_Speed; // ptrMenu_L1 = &menu_L1_Temperature; // ptrMenu_L1 = &menu_L1_Altitude; // ptrMenu_L1 = &menu_L1_Acceleration; ptrMenu_L2 = &menu_L2_Date; // ptrMenu_L2 = &menu_L2_Stopwatch; // ptrMenu_L2 = &menu_L2_Rf; // ptrMenu_L2 = &menu_L2_Ppt; // ptrMenu_L2 = &menu_L2_Sync; // ptrMenu_L2 = &menu_L2_Distance; // ptrMenu_L2 = &menu_L2_Calories; // ptrMenu_L2 = &menu_L2_Battery; // ptrMenu_L2 = &menu_L2_RFBSL; // Assign LINE1 and LINE2 display functions fptr_lcd_function_line1 = ptrMenu_L1->display_function; fptr_lcd_function_line2 = ptrMenu_L2->display_function; // Init system flags button.all_flags = 0; sys.all_flags = 0; request.all_flags = 0; display.all_flags = 0; message.all_flags = 0; // Force full display update when starting up display.flag.full_update = 1; #ifndef ISM_US // Use metric units when displaying values sys.flag.use_metric_units = 1; #endif // Read calibration values from info memory read_calibration_values(); // Set system time to default value reset_clock(); // Set date to default value reset_date(); // Set alarm time to default value reset_alarm(); // Set buzzer to default value reset_buzzer(); // Reset stopwatch reset_stopwatch(); //Set cdtimer to a 5:00 minute default memcpy(scdtimer.defaultTime, "000500", sizeof(scdtimer.time)); reset_cdtimer(); // Reset altitude measurement reset_altitude_measurement(); // Reset acceleration measurement reset_acceleration(); // Reset BlueRobin stack //reset_bluerobin(); // Reset SimpliciTI stack //reset_rf(); // Reset temperature measurement reset_temp_measurement(); // Reset battery measurement reset_batt_measurement(); battery_measurement(); }