Delay sensor_init

* Call sensor_init after initializing USB mass storage to log errors.
This commit is contained in:
iabdalkader 2015-08-07 23:16:30 +02:00
parent b99df66659
commit aaeaff476d

View File

@ -246,13 +246,8 @@ soft_reset:
spi_init0(); spi_init0();
uart_init0(); uart_init0();
pyb_usb_init0(); pyb_usb_init0();
usbdbg_init(); usbdbg_init();
if (sensor_init() != 0) {
__fatal_error("Failed to init sensor");
}
/* Export functions to the global python namespace */ /* Export functions to the global python namespace */
mp_store_global(qstr_from_str("randint"), (mp_obj_t)&py_randint_obj); mp_store_global(qstr_from_str("randint"), (mp_obj_t)&py_randint_obj);
mp_store_global(qstr_from_str("cpu_freq"), (mp_obj_t)&py_cpu_freq_obj); mp_store_global(qstr_from_str("cpu_freq"), (mp_obj_t)&py_cpu_freq_obj);
@ -298,6 +293,10 @@ soft_reset:
pyb_usb_dev_init(USBD_VID, USBD_PID_CDC_MSC, USBD_MODE_CDC_MSC, NULL); pyb_usb_dev_init(USBD_VID, USBD_PID_CDC_MSC, USBD_MODE_CDC_MSC, NULL);
} }
if (sensor_init() != 0) {
__fatal_error("Failed to init sensor");
}
// Run the main script from the current directory. // Run the main script from the current directory.
FRESULT res = f_stat("main.py", NULL); FRESULT res = f_stat("main.py", NULL);
if (res == FR_OK) { if (res == FR_OK) {