boards: board_app_initialize() don't return early on failure

- depending on the situation we're more likely to get actionable user
feedback by allowing boot to complete rather than silently failing
This commit is contained in:
Daniel Agar
2021-12-09 20:41:54 -05:00
parent 08ee3208b2
commit 8185e2a384
42 changed files with 7 additions and 110 deletions
-1
View File
@@ -226,7 +226,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
if (ret != OK) {
led_on(LED_RED);
return ret;
}
#endif /* CONFIG_MMCSD */
-1
View File
@@ -226,7 +226,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
if (ret != OK) {
led_on(LED_RED);
return ret;
}
#endif /* CONFIG_MMCSD */
-2
View File
@@ -186,12 +186,10 @@ __EXPORT int board_app_initialize(uintptr_t arg)
if (!sdio_dev) {
syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", 0);
return ERROR;
}
if (mmcsd_slotinitialize(0, sdio_dev) != OK) {
syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver\n");
return ERROR;
}
/* Assume that the SD card is inserted. What choice do we have? */
-2
View File
@@ -186,12 +186,10 @@ __EXPORT int board_app_initialize(uintptr_t arg)
if (!sdio_dev) {
syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", 0);
return ERROR;
}
if (mmcsd_slotinitialize(0, sdio_dev) != OK) {
syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver\n");
return ERROR;
}
/* Assume that the SD card is inserted. What choice do we have? */
-2
View File
@@ -185,12 +185,10 @@ __EXPORT int board_app_initialize(uintptr_t arg)
if (!sdio_dev) {
syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", 0);
return ERROR;
}
if (mmcsd_slotinitialize(0, sdio_dev) != OK) {
syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver\n");
return ERROR;
}
/* Assume that the SD card is inserted. What choice do we have? */
-1
View File
@@ -213,7 +213,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
if (ret != OK) {
led_on(LED_RED);
return ret;
}
#endif /* CONFIG_MMCSD */
+1 -8
View File
@@ -262,7 +262,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
if (!spi1) {
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 1\n");
led_on(LED_AMBER);
return -ENODEV;
}
/* Default SPI1 to 1MHz and de-assert the known chip selects. */
@@ -278,7 +277,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
if (!spi2) {
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 2\n");
led_on(LED_AMBER);
return -ENODEV;
}
/* Default SPI2 to 37.5 MHz (40 MHz rounded to nearest valid divider, F4 max)
@@ -293,14 +291,11 @@ __EXPORT int board_app_initialize(uintptr_t arg)
#ifdef CONFIG_MMCSD
/* First, get an instance of the SDIO interface */
sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO);
if (!sdio) {
syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n",
CONFIG_NSH_MMCSDSLOTNO);
syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", CONFIG_NSH_MMCSDSLOTNO);
led_on(LED_AMBER);
return -ENODEV;
}
/* Now bind the SDIO interface to the MMC/SD driver */
@@ -309,7 +304,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
if (ret != OK) {
syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret);
led_on(LED_AMBER);
return ret;
}
/* Then let's guess and say that there is a card in the slot. There is no card detect GPIO. */
@@ -318,7 +312,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
#endif
/* Configure the HW based on the manifest */
px4_platform_configure();
return OK;