void setup() { current_display_message_code = display_messages::code::kNone; current_display_message_min_time_millis = 0; time_in_current_display_message.restart(); clearGraphBuffer(); // B&W mode. This display does not support gray scales. u8g.setColorIndex(1); }
void showMessage(uint8 display_message_code, uint16 min_display_time_millis) { // Save the new display message info. const uint8 previous_display_message_code = current_display_message_code; current_display_message_code = display_message_code; current_display_message_min_time_millis = min_display_time_millis; time_in_current_display_message.restart(); // Skip if no need to update the display. if (display_message_code == display_messages::code::kNone || display_message_code == previous_display_message_code) { return; } // Update the display renderCurrentDisplayMessage(); }
static inline void changeToState(uint8 new_state) { state = new_state; sio::printf(F("injection state: %d\n"), state); // We assume this is a new state and always reset the time in state. time_in_state.restart(); }
// Change to given state. Assumes not already in this state. static inline void changeToState(uint8 new_state) { state = new_state; sio::printf(F("config state: %d\n"), state); time_in_state.restart(); }