Skip to content

Commit 247e128

Browse files
committed
Fix strict compiler on bootstub build
1 parent ba68569 commit 247e128

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

board/bootstub.c

+11-6
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,13 @@
1313
#endif
1414

1515
// default since there's no serial
16-
void puts(const char *a) {}
17-
void puth(unsigned int i) {}
16+
void puts(const char *a) {
17+
UNUSED(a);
18+
}
19+
20+
void puth(unsigned int i) {
21+
UNUSED(i);
22+
}
1823

1924
#include "libc.h"
2025
#include "provision.h"
@@ -34,11 +39,11 @@ void puth(unsigned int i) {}
3439

3540
#include "spi_flasher.h"
3641

37-
void __initialize_hardware_early() {
42+
void __initialize_hardware_early(void) {
3843
early();
3944
}
4045

41-
void fail() {
46+
void fail(void) {
4247
soft_flasher_start();
4348
}
4449

@@ -48,7 +53,7 @@ extern void *_app_start[];
4853
// FIXME: sometimes your panda will fail flashing and will quickly blink a single Green LED
4954
// BOUNTY: $200 coupon on shop.comma.ai or $100 check.
5055

51-
int main() {
56+
int main(void) {
5257
__disable_irq();
5358
clock_init();
5459
detect();
@@ -88,7 +93,7 @@ int main() {
8893
return 0;
8994
good:
9095
// jump to flash
91-
((void(*)()) _app_start[1])();
96+
((void(*)(void)) _app_start[1])();
9297
return 0;
9398
}
9499

board/spi_flasher.h

+14-3
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,17 @@ int usb_cb_control_msg(USB_Setup_TypeDef *setup, uint8_t *resp, bool hardwired)
9292
return resp_len;
9393
}
9494

95-
int usb_cb_ep1_in(uint8_t *usbdata, int len, bool hardwired) { return 0; }
96-
void usb_cb_ep3_out(uint8_t *usbdata, int len, bool hardwired) { }
95+
int usb_cb_ep1_in(uint8_t *usbdata, int len, bool hardwired) {
96+
UNUSED(usbdata);
97+
UNUSED(len);
98+
UNUSED(hardwired);
99+
return 0;
100+
}
101+
void usb_cb_ep3_out(uint8_t *usbdata, int len, bool hardwired) {
102+
UNUSED(usbdata);
103+
UNUSED(len);
104+
UNUSED(hardwired);
105+
}
97106

98107
int is_enumerated = 0;
99108
void usb_cb_enumeration_complete() {
@@ -102,6 +111,7 @@ void usb_cb_enumeration_complete() {
102111
}
103112

104113
void usb_cb_ep2_out(uint8_t *usbdata, int len, bool hardwired) {
114+
UNUSED(hardwired);
105115
set_led(LED_RED, 0);
106116
for (int i = 0; i < len/4; i++) {
107117
// program byte 1
@@ -118,6 +128,7 @@ void usb_cb_ep2_out(uint8_t *usbdata, int len, bool hardwired) {
118128

119129

120130
int spi_cb_rx(uint8_t *data, int len, uint8_t *data_out) {
131+
UNUSED(len);
121132
int resp_len = 0;
122133
switch (data[0]) {
123134
case 0:
@@ -247,7 +258,7 @@ void CAN1_SCE_IRQHandler() {
247258

248259
#endif
249260

250-
void soft_flasher_start() {
261+
void soft_flasher_start(void) {
251262
puts("\n\n\n************************ FLASHER START ************************\n");
252263

253264
enter_bootloader_mode = 0;

0 commit comments

Comments
 (0)