diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index e896ed3fab..8fbcf68900 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -154,11 +154,11 @@ static void fanRelayControl(void) { Overflow64Counter halTime; -uint64_t getTimeNowUs(void) { +efitimeus_t getTimeNowUs(void) { return getTimeNowNt() / (CORE_CLOCK / 1000000); } -uint64_t getTimeNowNt(void) { +efitick_t getTimeNowNt(void) { return halTime.get(); } diff --git a/firmware/controllers/lcd_controller.h b/firmware/controllers/lcd_controller.h index 09f0080c36..7adf98b72e 100644 --- a/firmware/controllers/lcd_controller.h +++ b/firmware/controllers/lcd_controller.h @@ -10,6 +10,14 @@ #include "engine.h" +typedef enum { + LL_VERSION, + LL_CONFIG, + LL_RPM, + LL_TEMPERATURE + +} lcd_line_e; + void updateHD44780lcd(Engine *engine); #endif /* LCD_CONTROLLER_H_ */ diff --git a/firmware/hw_layer/joystick.h b/firmware/hw_layer/joystick.h index b002e983b8..353814c9f3 100644 --- a/firmware/hw_layer/joystick.h +++ b/firmware/hw_layer/joystick.h @@ -9,6 +9,15 @@ #include "main.h" +typedef enum { + CENTER = 0, + BUTTON_A = 1, + BUTTON_B = 2, + BUTTON_C = 3, + BUTTON_D = 4, +} joystick_button_e; + +void onJoystick(joystick_button_e button); void initJoystick(Logging *shared); #endif /* CONTROLLERS_JOYSTICK_H_ */ diff --git a/firmware/hw_layer/lcd/lcd_HD44780.c b/firmware/hw_layer/lcd/lcd_HD44780.c index 2cdd2ff92d..4de56fd6d4 100644 --- a/firmware/hw_layer/lcd/lcd_HD44780.c +++ b/firmware/hw_layer/lcd/lcd_HD44780.c @@ -141,6 +141,10 @@ void lcd_HD44780_set_position(uint8_t row, uint8_t column) { lcd_HD44780_write_command(LCD_HD44780_DDRAM_ADDR + lineStart[row] + column); } +int getCurrentHD44780row(void) { + return currentRow; +} + void lcd_HD44780_print_char(char data) { if (data == '\n') { lcd_HD44780_set_position(++currentRow, 0); diff --git a/firmware/hw_layer/lcd/lcd_HD44780.h b/firmware/hw_layer/lcd/lcd_HD44780.h index 7572ba619d..c84cf122f7 100644 --- a/firmware/hw_layer/lcd/lcd_HD44780.h +++ b/firmware/hw_layer/lcd/lcd_HD44780.h @@ -17,6 +17,7 @@ void lcd_HD44780_init(void); void lcd_HD44780_set_position(uint8_t row, uint8_t column); void lcd_HD44780_print_char(char data); void lcd_HD44780_print_string(const char *string); +int getCurrentHD44780row(void); void lcdShowFatalMessage(char *message);