Fix strict compiler on bootstub build

This commit is contained in:
Riccardo 2019-07-07 15:05:47 -07:00
parent ba68569216
commit 247e128b45
2 changed files with 25 additions and 9 deletions

View File

@ -13,8 +13,13 @@
#endif
// default since there's no serial
void puts(const char *a) {}
void puth(unsigned int i) {}
void puts(const char *a) {
UNUSED(a);
}
void puth(unsigned int i) {
UNUSED(i);
}
#include "libc.h"
#include "provision.h"
@ -34,11 +39,11 @@ void puth(unsigned int i) {}
#include "spi_flasher.h"
void __initialize_hardware_early() {
void __initialize_hardware_early(void) {
early();
}
void fail() {
void fail(void) {
soft_flasher_start();
}
@ -48,7 +53,7 @@ extern void *_app_start[];
// FIXME: sometimes your panda will fail flashing and will quickly blink a single Green LED
// BOUNTY: $200 coupon on shop.comma.ai or $100 check.
int main() {
int main(void) {
__disable_irq();
clock_init();
detect();
@ -88,7 +93,7 @@ fail:
return 0;
good:
// jump to flash
((void(*)()) _app_start[1])();
((void(*)(void)) _app_start[1])();
return 0;
}

View File

@ -92,8 +92,17 @@ int usb_cb_control_msg(USB_Setup_TypeDef *setup, uint8_t *resp, bool hardwired)
return resp_len;
}
int usb_cb_ep1_in(uint8_t *usbdata, int len, bool hardwired) { return 0; }
void usb_cb_ep3_out(uint8_t *usbdata, int len, bool hardwired) { }
int usb_cb_ep1_in(uint8_t *usbdata, int len, bool hardwired) {
UNUSED(usbdata);
UNUSED(len);
UNUSED(hardwired);
return 0;
}
void usb_cb_ep3_out(uint8_t *usbdata, int len, bool hardwired) {
UNUSED(usbdata);
UNUSED(len);
UNUSED(hardwired);
}
int is_enumerated = 0;
void usb_cb_enumeration_complete() {
@ -102,6 +111,7 @@ void usb_cb_enumeration_complete() {
}
void usb_cb_ep2_out(uint8_t *usbdata, int len, bool hardwired) {
UNUSED(hardwired);
set_led(LED_RED, 0);
for (int i = 0; i < len/4; i++) {
// program byte 1
@ -118,6 +128,7 @@ void usb_cb_ep2_out(uint8_t *usbdata, int len, bool hardwired) {
int spi_cb_rx(uint8_t *data, int len, uint8_t *data_out) {
UNUSED(len);
int resp_len = 0;
switch (data[0]) {
case 0:
@ -247,7 +258,7 @@ void CAN1_SCE_IRQHandler() {
#endif
void soft_flasher_start() {
void soft_flasher_start(void) {
puts("\n\n\n************************ FLASHER START ************************\n");
enter_bootloader_mode = 0;