Skip to content

Commit e2fc366

Browse files
committed
Update fw version format and show hw version in settings menu
1 parent 006bc87 commit e2fc366

File tree

1 file changed

+9
-5
lines changed
  • AxxSolder_firmware/Core/Src

1 file changed

+9
-5
lines changed

AxxSolder_firmware/Core/Src/main.c

+9-5
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434

3535
/* Private typedef -----------------------------------------------------------*/
3636
/* USER CODE BEGIN PTD */
37-
#define version "3.1.0"
37+
uint8_t fw_version_major = 3;
38+
uint8_t fw_version_minor = 1;
39+
uint8_t fw_version_patch = 0;
3840

3941
#define BTN_LONG_PRESS 15 //*50ms (htim16 interval) --> 15 = 750ms
4042

@@ -427,12 +429,14 @@ void settings_menu(){
427429
/* If SW_1 is pressed during startup - Show SETTINGS and allow to release button. */
428430
if (HAL_GPIO_ReadPin (GPIOB, SW_1_Pin) == 1){
429431
if((flash_values.screen_rotation == 0) || (flash_values.screen_rotation == 2)){
430-
LCD_PutStr(6, 300, "Version:", FONT_arial_20X23, RGB_to_BRG(C_RED), RGB_to_BRG(C_BLACK));
431-
LCD_PutStr(150, 300, version, FONT_arial_20X23, RGB_to_BRG(C_RED), RGB_to_BRG(C_BLACK));
432+
char str[8];
433+
sprintf(str, "fw: %d.%d.%d hw: %d", fw_version_major,fw_version_minor, fw_version_patch, get_hw_version());
434+
LCD_PutStr(6, 300, str, FONT_arial_20X23, RGB_to_BRG(C_ORANGE), RGB_to_BRG(C_BLACK));
432435
}
433436
else{
434-
LCD_PutStr(0, 215, "Version:", FONT_arial_20X23, RGB_to_BRG(C_RED), RGB_to_BRG(C_BLACK));
435-
LCD_PutStr(150, 215, version, FONT_arial_20X23, RGB_to_BRG(C_RED), RGB_to_BRG(C_BLACK));
437+
char str[8];
438+
sprintf(str, "fw: %d.%d.%d hw: %d", fw_version_major,fw_version_minor, fw_version_patch, get_hw_version());
439+
LCD_PutStr(6, 215, str, FONT_arial_20X23, RGB_to_BRG(C_ORANGE), RGB_to_BRG(C_BLACK));
436440
}
437441

438442
TIM2->CNT = 1000;

0 commit comments

Comments
 (0)