mirror of https://github.com/commaai/panda.git
Fix strict compiler on bootstub build
This commit is contained in:
parent
ba68569216
commit
247e128b45
|
@ -13,8 +13,13 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// default since there's no serial
|
// default since there's no serial
|
||||||
void puts(const char *a) {}
|
void puts(const char *a) {
|
||||||
void puth(unsigned int i) {}
|
UNUSED(a);
|
||||||
|
}
|
||||||
|
|
||||||
|
void puth(unsigned int i) {
|
||||||
|
UNUSED(i);
|
||||||
|
}
|
||||||
|
|
||||||
#include "libc.h"
|
#include "libc.h"
|
||||||
#include "provision.h"
|
#include "provision.h"
|
||||||
|
@ -34,11 +39,11 @@ void puth(unsigned int i) {}
|
||||||
|
|
||||||
#include "spi_flasher.h"
|
#include "spi_flasher.h"
|
||||||
|
|
||||||
void __initialize_hardware_early() {
|
void __initialize_hardware_early(void) {
|
||||||
early();
|
early();
|
||||||
}
|
}
|
||||||
|
|
||||||
void fail() {
|
void fail(void) {
|
||||||
soft_flasher_start();
|
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
|
// 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.
|
// BOUNTY: $200 coupon on shop.comma.ai or $100 check.
|
||||||
|
|
||||||
int main() {
|
int main(void) {
|
||||||
__disable_irq();
|
__disable_irq();
|
||||||
clock_init();
|
clock_init();
|
||||||
detect();
|
detect();
|
||||||
|
@ -88,7 +93,7 @@ fail:
|
||||||
return 0;
|
return 0;
|
||||||
good:
|
good:
|
||||||
// jump to flash
|
// jump to flash
|
||||||
((void(*)()) _app_start[1])();
|
((void(*)(void)) _app_start[1])();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,8 +92,17 @@ int usb_cb_control_msg(USB_Setup_TypeDef *setup, uint8_t *resp, bool hardwired)
|
||||||
return resp_len;
|
return resp_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
int usb_cb_ep1_in(uint8_t *usbdata, int len, bool hardwired) { return 0; }
|
int usb_cb_ep1_in(uint8_t *usbdata, int len, bool hardwired) {
|
||||||
void usb_cb_ep3_out(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;
|
int is_enumerated = 0;
|
||||||
void usb_cb_enumeration_complete() {
|
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) {
|
void usb_cb_ep2_out(uint8_t *usbdata, int len, bool hardwired) {
|
||||||
|
UNUSED(hardwired);
|
||||||
set_led(LED_RED, 0);
|
set_led(LED_RED, 0);
|
||||||
for (int i = 0; i < len/4; i++) {
|
for (int i = 0; i < len/4; i++) {
|
||||||
// program byte 1
|
// 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) {
|
int spi_cb_rx(uint8_t *data, int len, uint8_t *data_out) {
|
||||||
|
UNUSED(len);
|
||||||
int resp_len = 0;
|
int resp_len = 0;
|
||||||
switch (data[0]) {
|
switch (data[0]) {
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -247,7 +258,7 @@ void CAN1_SCE_IRQHandler() {
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void soft_flasher_start() {
|
void soft_flasher_start(void) {
|
||||||
puts("\n\n\n************************ FLASHER START ************************\n");
|
puts("\n\n\n************************ FLASHER START ************************\n");
|
||||||
|
|
||||||
enter_bootloader_mode = 0;
|
enter_bootloader_mode = 0;
|
||||||
|
|
Loading…
Reference in New Issue