Skip to content

Commit 2d4fde8

Browse files
committed
refactor: Fix review suggestions
1 parent bc336e5 commit 2d4fde8

5 files changed

Lines changed: 4 additions & 8 deletions

File tree

firmware/preloader/src/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#define DEBOUNCE_DELAY 200
77
#define CLOCK_FREQ_HSI 16000000 // 16 MHz HSI
88

9+
/* size and crc are being replaced by scripts/fix_size_crc.py */
910
__attribute__((section(".tombstone_iapl")))
1011
__attribute__((used))
1112
const tombstone_t tombstone = {

firmware/userapp/Core/Inc/button.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ extern bool button_pressed;
1111

1212
bool Button_IsPressed();
1313
uint32_t Button_IsPressedDuration();
14-
void Button_Tick();
1514

1615
#ifdef __cplusplus
1716
}

firmware/userapp/Core/Src/button.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,4 @@ uint32_t Button_IsPressedDuration() {
1717
}
1818
}
1919
return duration_ms;
20-
}
21-
22-
void Button_Tick() {
23-
button_pressed = Button_IsPressed();
2420
}

firmware/userapp/Core/Src/display.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ void Display_Init(void)
109109
tombstone_t *iapl_ts = (tombstone_t *)(TOMBSTONE_OFFSET_IAPL);
110110
snprintf(lcd_buf, sizeof(lcd_buf), "IAPL %i.%i", iapl_ts->ver_major, iapl_ts->ver_minor);
111111
} else {
112-
strncat(lcd_buf, "IAPL INVALID", sizeof(lcd_buf)-1);
112+
snprintf(lcd_buf, sizeof(lcd_buf), "IAPL INVALID");
113113
}
114114
u8g2_DrawStr(&myDisplay, 4, 22, lcd_buf);
115115

@@ -118,7 +118,7 @@ void Display_Init(void)
118118
tombstone_t *uapp_ts = (tombstone_t *)(TOMBSTONE_OFFSET_UAPP);
119119
snprintf(lcd_buf, sizeof(lcd_buf), "UAPP %i.%i", uapp_ts->ver_major, uapp_ts->ver_minor);
120120
} else {
121-
strncat(lcd_buf, "UAPP INVALID", sizeof(lcd_buf)-1);
121+
snprintf(lcd_buf, sizeof(lcd_buf), "UAPP INVALID");
122122
}
123123
u8g2_DrawStr(&myDisplay, 4, 32, lcd_buf);
124124
u8g2_SendBuffer(&myDisplay);

firmware/userapp/Core/Src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ static void MX_CRC_Init(void);
6464

6565
/* Private user code ---------------------------------------------------------*/
6666
/* USER CODE BEGIN 0 */
67+
/* size and crc are being replaced by scripts/fix_size_crc.py */
6768
__attribute__((section(".tombstone_uapp")))
6869
__attribute__((used))
6970
const tombstone_t tombstone = {
@@ -116,7 +117,6 @@ int main(void)
116117
/* USER CODE BEGIN WHILE */
117118
while (1)
118119
{
119-
Button_Tick();
120120
Display_Tick();
121121
/* USER CODE END WHILE */
122122

0 commit comments

Comments
 (0)