void edit_consumption_sel(uint8_t pos) { display_chars(0, LCD_SEG_L1_3_0, consumption_str[consumption-1], SEG_SET); display_symbol(0, LCD_UNIT_L1_PER_S, consumption == 4 ? SEG_ON : SEG_OFF); display_chars(0, LCD_SEG_L1_3_0, NULL, BLINK_ON); display_chars(0, LCD_SEG_L2_3_0, "POLL", SEG_SET); }
u8 update_schedule() { update_schedule_time(); clear_line(LINE2); if(sSchedule.state == SCHEDULE_ENABLED) { if(sSchedule.currentlyShown == PERIOD) { display_chars(LCD_SEG_L2_4_0, sSchedule.period, SEG_ON); } else if(sSchedule.currentlyShown == TIME) { display_chars(LCD_SEG_L2_3_0, itoa(sSchedule.end, 4, 0), SEG_ON); display_symbol(LCD_SEG_L2_COL0, SEG_ON); } } else if (sSchedule.state == SCHEDULE_DISABLED) { display_chars(LCD_SEG_L2_4_0, sSchedule.period, SEG_ON); } /*else if (sSchedule.state == SCHEDULE_NONE) { if (is_schedule()) { menu_skip_next(LINE2); } }*/ return 1; }
void edit_threshold_sel(uint8_t pos) { _printf(0, LCD_SEG_L1_1_0, "%1u", sAlt.accu_threshold); display_chars(0, LCD_SEG_L1_1_0, NULL, BLINK_ON); display_chars(0, LCD_SEG_L2_4_0, "THRES", SEG_SET); }
// ************************************************************************************************* // @fn display_heartrate // @brief Heart rate display routine. // @param u8 line LINE1 // u8 update DISPLAY_LINE_UPDATE_FULL, DISPLAY_LINE_UPDATE_PARTIAL, DISPLAY_LINE_CLEAR // @return none // ************************************************************************************************* void display_heartrate(u8 line, u8 update) { u8 * str; if (update != DISPLAY_LINE_CLEAR) { if (is_bluerobin()) { str = itoa(sBlueRobin.heartrate, 3, 2); display_chars(LCD_SEG_L1_2_0, str, SEG_ON); } else { display_chars(LCD_SEG_L1_2_0, (u8 *)"---", SEG_ON); } } // Redraw whole screen if (!is_bluerobin()) { if (update == DISPLAY_LINE_UPDATE_FULL) { display_symbol(LCD_ICON_HEART, SEG_ON); } else if (update == DISPLAY_LINE_CLEAR) { // Clear heart when not connected display_symbol(LCD_ICON_HEART, SEG_OFF); } } }
// ************************************************************************************************* // @fn sx_rfbsl // @brief This functions starts the RFBSL // @param line LINE1, LINE2 // @return none // ************************************************************************************************* void sx_rfbsl(u8 line) { // Exit if battery voltage is too low for radio operation if (sys.flag.low_battery) return; // Exit if BlueRobin stack is active if (is_bluerobin()) return; // Exit if SimpliciTI stack is active if (is_rf()) return; rfBSL_button_confirmation++; if (rfBSL_button_confirmation == 2) { // Before entering RFBSL clear the LINE1 Symbols display_symbol(LCD_SYMB_AM, SEG_OFF); clear_line(LINE1); // Write RAM to indicate we will be downloading the RAM Updater first display_chars(LCD_SEG_L2_5_0, (u8 *) " RFBSL", SEG_ON); display_chars(LCD_SEG_L1_3_0, (u8 *) " RAM", SEG_ON); // Call RFBSL CALL_RFSBL(); } }
// ************************************************************************************************* // @fn display_time // @brief Clock display routine. Supports 24H and 12H time format, // through the helper display_hours_with_12_24. // @param u8 line LINE1 // u8 update DISPLAY_LINE_UPDATE_FULL, DISPLAY_LINE_UPDATE_PARTIAL // @return none // ************************************************************************************************* void display_time(u8 line, u8 update) { // Partial and full update if (update == DISPLAY_LINE_UPDATE_PARTIAL || update == DISPLAY_LINE_UPDATE_FULL) { if ( ( line == LINE1 && sTime.line1ViewStyle == DISPLAY_DEFAULT_VIEW ) || ( line == LINE2 && sTime.line2ViewStyle == DISPLAY_DEFAULT_VIEW ) ) { // Display hours #ifndef LZH display_hours_12_or_24(switch_seg(line, LCD_SEG_L1_3_2, LCD_SEG_L2_3_2), sTime.hour, 2, 1, SEG_ON); #else display_hours_12_or_24(switch_seg(line, LCD_SEG_L1_3_2, LCD_SEG_L2_3_2), sTime.hour, 2, 0, SEG_ON); #endif // Display minute display_chars(switch_seg(line, LCD_SEG_L1_1_0, LCD_SEG_L2_1_0), _itoa(sTime.minute, 2, 0), SEG_ON); display_symbol(switch_seg(line, LCD_SEG_L1_COL, LCD_SEG_L2_COL0), SEG_ON_BLINK_ON); } else { // Display seconds display_chars(switch_seg(line, LCD_SEG_L1_1_0, LCD_SEG_L2_1_0), _itoa(sTime.second, 2, 0), SEG_ON); display_symbol(switch_seg(line, LCD_SEG_L1_DP1, LCD_SEG_L2_DP), SEG_ON); } } else if (update == DISPLAY_LINE_CLEAR) { display_symbol(switch_seg(line, LCD_SEG_L1_COL, LCD_SEG_L2_COL0), SEG_OFF_BLINK_OFF); // Change display style to default (HH:MM) sTime.line1ViewStyle = DISPLAY_DEFAULT_VIEW; // Clean up AM/PM icon display_symbol(LCD_SYMB_AM, SEG_OFF); } }
void putchar_to_display(int c) { if (c == '\n') { display_buf[4] = 1; return; } if (display_buf[4]) { memset(display_buf, '\0', 11); } else { display_buf[0] = display_buf[1]; display_buf[1] = display_buf[2]; display_buf[2] = display_buf[3]; display_buf[3] = display_buf[5]; display_buf[5] = display_buf[6]; display_buf[6] = display_buf[7]; display_buf[7] = display_buf[8]; display_buf[8] = display_buf[9]; } display_buf[9] = toupper(c); clear_display_all(); display_chars(LCD_SEG_L1_3_0, display_buf, SEG_ON); display_chars(LCD_SEG_L2_5_0, display_buf + 4, SEG_ON); }
static void menumode_handler(void) { if (ports_button_pressed(PORTS_BTN_STAR, 0)) { /* exit mode mode */ menumode.enabled = 0; /* clear both lines but keep symbols! */ display_clear(0, 1); display_clear(0, 2); /* turn off up/down symbols */ display_symbol(0, LCD_SYMB_ARROW_UP, SEG_OFF); display_symbol(0, LCD_SYMB_ARROW_DOWN, SEG_OFF); /* stop blinking name of current selected module */ display_chars(0, LCD_SEG_L2_4_0, NULL, BLINK_OFF); /* activate item */ if (menumode.item->activate_fn) menumode.item->activate_fn(); } else if (ports_button_pressed(PORTS_BTN_UP, 0)) { menumode.item = menumode.item->next; display_chars(0, LCD_SEG_L2_4_0, menumode.item->name, SEG_SET); } else if (ports_button_pressed(PORTS_BTN_DOWN, 0)) { menumode.item = menumode.item->prev; display_chars(0, LCD_SEG_L2_4_0, menumode.item->name, SEG_SET); } }
//* ************************************************************************************************ /// @fn edit_metric_sel(void) /// @brief Start routine of the metric menu item. /// @return none //* ************************************************************************************************ static void edit_metric_sel(void) { // Display "MTRC" as title display_chars(1, LCD_SEG_L2_3_0, "MTRC", SEG_SET); // Display the current metric system used display_chars(1, LCD_SEG_L1_3_0, (temp_display_metric == 0 ? "CELS " : "FARH"), SEG_SET); }
//* ************************************************************************************************ /// @fn edit_offset_sel(void) /// @brief Start routine of the offset menu item. /// @return none //* ************************************************************************************************ static void edit_offset_sel(void) { // Display "OFST" as title display_chars(1, LCD_SEG_L2_3_0, "OFST", SEG_SET); // Display the current offset display_chars(1, LCD_SEG_L1_3_0, _sprintf("%2s", temperature.offset / 10), SEG_SET); }
static void edit_dd_dsel(void) { #ifdef CONFIG_MOD_CLOCK_MONTH_FIRST display_chars(0, LCD_SEG_L2_1_0, NULL, BLINK_OFF); #else display_chars(0, LCD_SEG_L2_4_3, NULL, BLINK_OFF); #endif }
// ************************************************************************************************* // @fn display_alarm // @brief Display alarm time. 24H / 12H time format. // @param u8 line LINE1, LINE2 // u8 update DISPLAY_LINE_UPDATE_FULL, DISPLAY_LINE_CLEAR // @return none // ************************************************************************************************* void display_alarm(u8 line, u8 update) { #ifndef CONFIG_METRIC_ONLY u8 hour12; #endif if (update == DISPLAY_LINE_UPDATE_FULL) { #ifdef CONFIG_METRIC_ONLY display_chars(switch_seg(line, LCD_SEG_L1_3_2, LCD_SEG_L2_3_2), itoa(sAlarm.hour, 2, 0), SEG_ON); #else if (sys.flag.use_metric_units) { // Display 24H alarm time "HH:MM" display_chars(switch_seg(line, LCD_SEG_L1_3_2, LCD_SEG_L2_3_2), itoa(sAlarm.hour, 2, 0), SEG_ON); } else { // Display 12H alarm time "HH:MM" + AM/PM hour12 = convert_hour_to_12H_format(sAlarm.hour); display_chars(switch_seg(line, LCD_SEG_L1_3_2, LCD_SEG_L2_3_2), itoa(hour12, 2, 0), SEG_ON); // Display AM/PM symbol display_am_pm_symbol(sAlarm.hour); } #endif display_chars(switch_seg(line, LCD_SEG_L1_1_0, LCD_SEG_L2_1_0), itoa(sAlarm.minute, 2, 0), SEG_ON); display_symbol(switch_seg(line, LCD_SEG_L1_COL, LCD_SEG_L2_COL0), SEG_ON); // Show blinking alarm icon display_symbol(LCD_ICON_ALARM, SEG_ON_BLINK_ON); // // If alarm is enabled, show icon // if (sAlarm.state == ALARM_ENABLED) // { // display_symbol(LCD_ICON_ALARM, SEG_ON_BLINK_OFF); // } // // When alarm is disabled, blink icon to indicate that this is not current time! // else if (sAlarm.state == ALARM_DISABLED) // { // } } else if (update == DISPLAY_LINE_CLEAR) { // Clean up function-specific segments before leaving function display_symbol(LCD_SYMB_AM, SEG_OFF); // Clear / set alarm icon if (sAlarm.state == ALARM_DISABLED) { display_symbol(LCD_ICON_ALARM, SEG_OFF_BLINK_OFF); } else { display_symbol(LCD_ICON_ALARM, SEG_ON_BLINK_OFF); } } }
// ************************************************************************************************* // @fn display_sidereal // @brief Sidereal Clock display routine. Supports 24H and 12H time format, // through the helper display_hours_with_12_24. // @param u8 line LINE1 // u8 update DISPLAY_LINE_UPDATE_FULL, DISPLAY_LINE_UPDATE_PARTIAL // @return none // ************************************************************************************************* void display_sidereal(u8 line, u8 update) { // Partial update if (update == DISPLAY_LINE_UPDATE_PARTIAL) { if(sSidereal_time.drawFlag != 0) { if (sSidereal_time.line1ViewStyle == DISPLAY_DEFAULT_VIEW) { switch(sSidereal_time.drawFlag) { case 3: display_hours_12_or_24(switch_seg(line, LCD_SEG_L1_3_2, LCD_SEG_L2_3_2), sSidereal_time.hour, 2, 1, SEG_ON); case 2: display_chars(switch_seg(line, LCD_SEG_L1_1_0, LCD_SEG_L2_1_0), _itoa(sSidereal_time.minute, 2, 0), SEG_ON); } } else { // Seconds are always updated display_chars(switch_seg(line, LCD_SEG_L1_1_0, LCD_SEG_L2_1_0), _itoa(sSidereal_time.second, 2, 0), SEG_ON); } } } else if (update == DISPLAY_LINE_UPDATE_FULL) { if (line == LINE1) { // display "i" (like in sIdereal) to distinguish sidereal time clock from normal clock display_symbol(LCD_UNIT_L1_I, SEG_ON); } // Full update if ( ( line == LINE1 && sSidereal_time.line1ViewStyle == DISPLAY_DEFAULT_VIEW ) || ( line == LINE2 && sSidereal_time.line2ViewStyle == DISPLAY_DEFAULT_VIEW ) ) { // Display hours display_hours_12_or_24(switch_seg(line, LCD_SEG_L1_3_2, LCD_SEG_L2_3_2), sSidereal_time.hour, 2, 1, SEG_ON); // Display minute display_chars(switch_seg(line, LCD_SEG_L1_1_0, LCD_SEG_L2_1_0), _itoa(sSidereal_time.minute, 2, 0), SEG_ON); display_symbol(switch_seg(line, LCD_SEG_L1_COL, LCD_SEG_L2_COL0), SEG_ON_BLINK_ON); } else { // Display seconds display_chars(switch_seg(line, LCD_SEG_L1_1_0, LCD_SEG_L2_1_0), _itoa(sSidereal_time.second, 2, 0), SEG_ON); display_symbol(switch_seg(line, LCD_SEG_L1_DP1, LCD_SEG_L2_DP), SEG_ON); } } else if (update == DISPLAY_LINE_CLEAR) { display_symbol(switch_seg(line, LCD_SEG_L1_COL, LCD_SEG_L2_COL0), SEG_OFF_BLINK_OFF); // // Change display style to default (HH:MM) // sSidereal_time.line1ViewStyle = DISPLAY_DEFAULT_VIEW; // Clean up AM/PM icon display_symbol(LCD_SYMB_AM, SEG_OFF); // cleanup "i" icon display_symbol(LCD_UNIT_L1_I, SEG_OFF); } }
static void edit_mo_sel(void) { lcd_screen_activate(0); #ifdef CONFIG_MOD_CLOCK_MONTH_FIRST display_chars(0, LCD_SEG_L2_4_3, NULL, BLINK_ON); #else display_chars(0, LCD_SEG_L2_1_0, NULL, BLINK_ON); #endif }
void edit_filter_sel(uint8_t pos) { if(useFilter){ display_chars(0, LCD_SEG_L1_2_1, "ON", SEG_SET); }else{ display_chars(0, LCD_SEG_L1_2_0, "OFF", SEG_SET); } display_chars(0, LCD_SEG_L1_2_0, NULL, BLINK_ON); display_chars(0, LCD_SEG_L2_2_0, "FLT", SEG_SET); }
// ************************************************************************************************* // @fn display_selection_altaccum // @brief Display altitude accumulator ON or OFF // @param u8 segments where to display, usually LCD_SEG_L2_4_0 // u32 index 0 = OFF, 1 = ON // u8 digits Not used // u8 blanks Not used // @return none // ************************************************************************************************* void display_selection_altaccum (u8 segments, u32 index, u8 digits, u8 blanks) { if (index) { clear_line(LINE2); display_chars(segments, (u8*)" ON ", SEG_ON_BLINK_ON); // display "ON" on bottom line } else { clear_line(LINE2); display_chars(segments, (u8*)" OFF ", SEG_ON_BLINK_ON); // display "OFF" on bottom line } }
void edit_filter_set(uint8_t pos, int8_t step) { if(useFilter){ useFilter = 0; display_chars(0, LCD_SEG_L1_2_0, "OFF", SEG_SET); }else{ useFilter = 1; display_clear(0,1); display_chars(0, LCD_SEG_L1_2_1, "ON", SEG_SET); } }
// ************************************************************************************************* // @fn display_time // @brief Clock display routine. Supports 24H and 12H time format, // through the helper display_hours_with_12_24. // @param uint8_t line LINE1 // uint8_t update DISPLAY_LINE_UPDATE_FULL, DISPLAY_LINE_UPDATE_PARTIAL // @return none // ************************************************************************************************* void display_time(uint8_t line, uint8_t update) { // Partial update if (update == DISPLAY_LINE_UPDATE_PARTIAL) { if(sTime.drawFlag != 0) { if (sTime.line1ViewStyle == DISPLAY_DEFAULT_VIEW) { switch(sTime.drawFlag) { case 3: display_hours_12_or_24(switch_seg(line, LCD_SEG_L1_3_2, LCD_SEG_L2_3_2), sTime.hour, 2, 1, SEG_ON); case 2: display_chars(switch_seg(line, LCD_SEG_L1_1_0, LCD_SEG_L2_1_0), itoa(sTime.minute, 2, 0), SEG_ON); } } else { // Seconds are always updated display_chars(switch_seg(line, LCD_SEG_L1_1_0, LCD_SEG_L2_1_0), itoa(sTime.second, 2, 0), SEG_ON); } } } else if (update == DISPLAY_LINE_UPDATE_FULL) { // Full update if ( ( line == LINE1 && sTime.line1ViewStyle == DISPLAY_DEFAULT_VIEW ) || ( line == LINE2 && sTime.line2ViewStyle == DISPLAY_DEFAULT_VIEW ) ) { // Display hours display_hours_12_or_24(switch_seg(line, LCD_SEG_L1_3_2, LCD_SEG_L2_3_2), sTime.hour, 2, 1, SEG_ON); // Display minute display_chars(switch_seg(line, LCD_SEG_L1_1_0, LCD_SEG_L2_1_0), itoa(sTime.minute, 2, 0), SEG_ON); display_symbol(switch_seg(line, LCD_SEG_L1_COL, LCD_SEG_L2_COL0), SEG_ON_BLINK_ON); } else { // Display seconds display_chars(switch_seg(line, LCD_SEG_L1_1_0, LCD_SEG_L2_1_0), itoa(sTime.second, 2, 0), SEG_ON); display_symbol(switch_seg(line, LCD_SEG_L1_DP1, LCD_SEG_L2_DP), SEG_ON); } } else if (update == DISPLAY_LINE_CLEAR) { display_symbol(switch_seg(line, LCD_SEG_L1_COL, LCD_SEG_L2_COL0), SEG_OFF_BLINK_OFF); // Change display style to default (HH:MM) sTime.line1ViewStyle = DISPLAY_DEFAULT_VIEW; // Clean up AM/PM icon display_symbol(LCD_SYMB_AM, SEG_OFF); } }
//* ************************************************************************************************ /// @fn temperature_activate(void) /// @brief Temperature screen activation. Display defaul stuff, register the mesuring loop. /// @return none //* ************************************************************************************************ static void temperature_activate(void) { // Create two screens, the first is always the active one lcd_screens_create(2); // Display the title of this module at the bottom display_chars(0, LCD_SEG_L2_3_0, "TEMP", SEG_SET); // Display something while a measure is not performed display_chars(0, LCD_SEG_L1_2_0, " - ", SEG_ON); // Register an event sys_messagebus_register(&measure_temp, SYS_MSG_TIMER_4S); }
void edit_unit_sel(uint8_t pos) { if(useMetric){ display_chars(0, LCD_SEG_L1_2_1, "M", SEG_SET); display_symbol(0, LCD_UNIT_L1_M, SEG_ON); display_symbol(0, LCD_UNIT_L1_FT, SEG_OFF); }else{ display_chars(0, LCD_SEG_L1_2_1, "FT", SEG_SET); display_symbol(0, LCD_UNIT_L1_M, SEG_OFF); display_symbol(0, LCD_UNIT_L1_FT, SEG_ON); } display_chars(0, LCD_SEG_L1_2_1, NULL, BLINK_ON); display_chars(0, LCD_SEG_L2_3_0, "UNIT", SEG_SET); }
// ************************************************************************************************* // @fn display_date // @brief Display date in DD.MM format (metric units) or MM.DD (English units). // @param u8 line LINE1, LINE2 // u8 update DISPLAY_LINE_UPDATE_FULL, // DISPLAY_LINE_UPDATE_PARTIAL // @return none // ************************************************************************************************* void display_date(u8 line, u8 update) { u8 *str; if (update == DISPLAY_LINE_UPDATE_FULL) { if (sDate.display == DISPLAY_DEFAULT_VIEW) { // Convert day to string str = int_to_array(sDate.day, 2, 0); if (sys.flag.use_metric_units) { display_chars(switch_seg(line, LCD_SEG_L1_3_2, LCD_SEG_L2_3_2), str, SEG_ON); } else { display_chars(switch_seg(line, LCD_SEG_L1_1_0, LCD_SEG_L2_1_0), str, SEG_ON); } // Convert month to string str = int_to_array(sDate.month, 2, 0); if (sys.flag.use_metric_units) { display_chars(switch_seg(line, LCD_SEG_L1_1_0, LCD_SEG_L2_1_0), str, SEG_ON); } else { display_chars(switch_seg(line, LCD_SEG_L1_3_2, LCD_SEG_L2_3_2), str, SEG_ON); } // Display "." to separate day and month display_symbol(switch_seg(line, LCD_SEG_L1_DP1, LCD_SEG_L2_DP), SEG_ON); } else { // Convert year to string str = int_to_array(sDate.year, 4, 0); display_chars(switch_seg(line, LCD_SEG_L1_3_0, LCD_SEG_L2_3_0), str, SEG_ON); // Clear "." display_symbol(switch_seg(line, LCD_SEG_L1_DP1, LCD_SEG_L2_DP), SEG_OFF); } } else if (update == DISPLAY_LINE_CLEAR) { // Show day and month on display when coming around next time sDate.display = DISPLAY_DEFAULT_VIEW; } }
// ************************************************************************************************* // @fn display_rfbsl // @brief RFBSL display routine. // @param u8 line LINE2 // u8 update DISPLAY_LINE_UPDATE_FULL // @return none // ************************************************************************************************* void display_rfbsl(u8 line, u8 update) { if (update == DISPLAY_LINE_UPDATE_FULL) { if (rfBSL_button_confirmation == 0) { display_chars(LCD_SEG_L2_5_0, (u8 *) " RESET", SEG_ON); } else if (rfBSL_button_confirmation < 2) { // Request one more button press to confirm rfBSL call display_chars(LCD_SEG_L2_5_0, (u8 *) " CONF", SEG_ON); } } }
void edit_unit_set(uint8_t pos, int8_t step) { if(useMetric){ useMetric = 0; display_chars(0, LCD_SEG_L1_2_1, "FT", SEG_SET); display_symbol(0, LCD_UNIT_L1_M, SEG_OFF); display_symbol(0, LCD_UNIT_L1_FT, SEG_ON); }else{ useMetric = 1; display_clear(0,1); display_chars(0, LCD_SEG_L1_2_1, "M", SEG_SET); display_symbol(0, LCD_UNIT_L1_M, SEG_ON); display_symbol(0, LCD_UNIT_L1_FT, SEG_OFF); } }
static void up_btn() { // Depending on the state what do we do? switch (submenu_state) { case VIEW_SET_MODE: as_config.mode++; as_config.mode %= 3; change_mode(as_config.mode); update_menu(); break; case VIEW_SET_PARAMS: _printf(0,LCD_SEG_L1_3_0 , "%04x", as_read_register(ADDR_CTRL)); break; case VIEW_STATUS: _printf(0,LCD_SEG_L1_3_0, "%1u", as_status.all_flags); break; case VIEW_AXIS: display_chars(0,LCD_SEG_L1_3_0 , "TODO", SEG_SET); break; default: break; } /* update menu screen */ lcd_screen_activate(0); }
// ************************************************************************************************* // @fn display_rfbsl // @brief RFBSL display routine. // @param u8 line LINE2 // u8 update DISPLAY_LINE_UPDATE_FULL // @return none // ************************************************************************************************* void display_rfbsl(u8 line, u8 update) { if (update == DISPLAY_LINE_UPDATE_FULL) { display_chars(LCD_SEG_L2_5_0, (u8 *)" RFBSL", SEG_ON); } }
// ************************************************************************************************* // @fn set_stopwatch // @brief Set's stopwatch mode. // @param none // @return none // ************************************************************************************************* void set_stopwatchmode(void) { s32 StopwatchModeTmp; // Copy to temp StopwatchModeTmp = StopwatchMode; // Loop values until all are set or user breaks set while(1) { // Idle timeout: exit without saving if (sys.flag.idle_timeout) break; // NUM Button (short): save, then exit if (button.flag.num) { // Store local variables in global StopwatchMode = StopwatchModeTmp; //Set display update flag display.flag.full_update = 1; break; } // Set stopwatch mode clear_display_all(); display_chars(LCD_SEG_L1_3_0, (u8 *)"MODE", SEG_ON); set_value(&StopwatchModeTmp, 0, 0, 0, 1, SETVALUE_DISPLAY_VALUE + SETVALUE_ROLLOVER_VALUE + SETVALUE_NEXT_VALUE, LCD_SEG_L2_3_0, display_special3); } // Clear button flag button.all_flags = 0; }
// ************************************************************************************************* // @fn start_altitude_measurement // @brief Start altitude measurement // @param none // @return none // ************************************************************************************************* void start_altitude_measurement(void) { // Show warning if pressure sensor was not initialised properly if (!ps_ok) { display_chars(LCD_SEG_L1_2_0, (u8*)"ERR", SEG_ON); return; } // Start altitude measurement if timeout has elapsed if (sAlt.timeout == 0) { // Enable DRDY IRQ on rising edge PS_INT_IFG &= ~PS_INT_PIN; PS_INT_IE |= PS_INT_PIN; // Start pressure sensor ps_start(); // Set timeout counter only if sensor status was OK sAlt.timeout = ALTITUDE_MEASUREMENT_TIMEOUT; // Get updated altitude while((PS_INT_IN & PS_INT_PIN) == 0); do_altitude_measurement(FILTER_OFF); } }
// ************************************************************************************************* // @fn display_phase_clock // @brief SimpliciTI display routine. // @param u8 line LINE2 // u8 update DISPLAY_LINE_UPDATE_FULL // @return none // ************************************************************************************************* void display_phase_clock(u8 line, u8 update) { if (update == DISPLAY_LINE_UPDATE_FULL) { display_chars(LCD_SEG_L2_5_0, (u8 *)" SLEEP", SEG_ON); } }
// ************************************************************************************************* // @fn display_sync // @brief SimpliciTI display routine. // @param u8 line LINE2 // u8 update DISPLAY_LINE_UPDATE_FULL // @return none // ************************************************************************************************* void display_sync(u8 line, u8 update) { if (update == DISPLAY_LINE_UPDATE_FULL) { display_chars(LCD_SEG_L2_5_0, (u8 *)" SYNC", SEG_ON); } }
void edit_consumption_set(uint8_t pos, int8_t step) { helpers_loop(&consumption, 1, 4, step); display_chars(0, LCD_SEG_L1_3_0, consumption_str[consumption-1], SEG_SET); display_symbol(0, LCD_UNIT_L1_PER_S, consumption == 4 ? SEG_ON : SEG_OFF); }