mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 15:53:33 +08:00
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:
@@ -453,7 +453,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
if (!spi1) {
|
||||
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 1);
|
||||
led_on(LED_AMBER);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Default SPI1 to 1MHz and de-assert the known chip selects. */
|
||||
@@ -469,7 +468,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
if (!spi2) {
|
||||
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 2);
|
||||
led_on(LED_AMBER);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Default SPI2 to 37.5 MHz (40 MHz rounded to nearest valid divider, F4 max)
|
||||
@@ -485,7 +483,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
if (!spi4) {
|
||||
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 4);
|
||||
led_on(LED_AMBER);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Default SPI4 to 1MHz and de-assert the known chip selects. */
|
||||
@@ -501,7 +498,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
if (!sdio) {
|
||||
led_on(LED_AMBER);
|
||||
syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", CONFIG_NSH_MMCSDSLOTNO);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Now bind the SDIO interface to the MMC/SD driver */
|
||||
@@ -510,7 +506,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
if (ret != OK) {
|
||||
led_on(LED_AMBER);
|
||||
syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Then let's guess and say that there is a card in the slot. There is no card detect GPIO. */
|
||||
|
||||
@@ -453,7 +453,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
if (!spi1) {
|
||||
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 1);
|
||||
led_on(LED_AMBER);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Default SPI1 to 1MHz and de-assert the known chip selects. */
|
||||
@@ -469,7 +468,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
if (!spi2) {
|
||||
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 2);
|
||||
led_on(LED_AMBER);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Default SPI2 to 37.5 MHz (40 MHz rounded to nearest valid divider, F4 max)
|
||||
@@ -485,7 +483,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
if (!spi4) {
|
||||
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 4);
|
||||
led_on(LED_AMBER);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Default SPI4 to 1MHz and de-assert the known chip selects. */
|
||||
@@ -501,7 +498,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
if (!sdio) {
|
||||
led_on(LED_AMBER);
|
||||
syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", CONFIG_NSH_MMCSDSLOTNO);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Now bind the SDIO interface to the MMC/SD driver */
|
||||
@@ -510,7 +506,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
if (ret != OK) {
|
||||
led_on(LED_AMBER);
|
||||
syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Then let's guess and say that there is a card in the slot. There is no card detect GPIO. */
|
||||
@@ -519,7 +514,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
#endif
|
||||
|
||||
/* Configure the HW based on the manifest */
|
||||
|
||||
px4_platform_configure();
|
||||
|
||||
return OK;
|
||||
|
||||
@@ -292,7 +292,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_RED);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
|
||||
@@ -308,7 +307,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_RED);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -350,9 +348,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
|
||||
if (!sdio) {
|
||||
led_on(LED_RED);
|
||||
syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n",
|
||||
CONFIG_NSH_MMCSDSLOTNO);
|
||||
return -ENODEV;
|
||||
syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", CONFIG_NSH_MMCSDSLOTNO);
|
||||
}
|
||||
|
||||
// Now bind the SDIO interface to the MMC/SD driver.
|
||||
@@ -361,7 +357,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
if (ret != OK) {
|
||||
led_on(LED_RED);
|
||||
syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Then let's guess and say that there is a card in the slot. There is no card detect GPIO.
|
||||
|
||||
@@ -311,7 +311,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
if (!spi1) {
|
||||
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 1);
|
||||
led_on(LED_RED);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Default SPI1 to 1MHz and de-assert the known chip selects. */
|
||||
@@ -327,7 +326,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
if (!spi2) {
|
||||
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 2);
|
||||
led_on(LED_RED);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Default SPI2 to 12MHz and de-assert the known chip selects.
|
||||
@@ -345,7 +343,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
if (!spi5) {
|
||||
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 5);
|
||||
led_on(LED_RED);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Default SPI5 to 1MHz and de-assert the known chip selects. */
|
||||
@@ -360,7 +357,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
if (!spi6) {
|
||||
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", 6);
|
||||
led_on(LED_RED);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Default SPI6 to 1MHz and de-assert the known chip selects. */
|
||||
@@ -375,9 +371,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
|
||||
if (!sdio) {
|
||||
led_on(LED_RED);
|
||||
syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n",
|
||||
CONFIG_NSH_MMCSDSLOTNO);
|
||||
return -ENODEV;
|
||||
syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", CONFIG_NSH_MMCSDSLOTNO);
|
||||
}
|
||||
|
||||
/* Now bind the SDIO interface to the MMC/SD driver */
|
||||
@@ -386,7 +380,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
if (ret != OK) {
|
||||
led_on(LED_RED);
|
||||
syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Then let's guess and say that there is a card in the slot. There is no card detect GPIO. */
|
||||
|
||||
@@ -275,7 +275,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
|
||||
if (ret != OK) {
|
||||
led_on(LED_RED);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_MMCSD */
|
||||
|
||||
@@ -266,7 +266,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
|
||||
if (ret != OK) {
|
||||
led_on(LED_RED);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_MMCSD */
|
||||
|
||||
@@ -268,7 +268,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
||||
|
||||
if (ret != OK) {
|
||||
led_on(LED_RED);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_MMCSD */
|
||||
|
||||
Reference in New Issue
Block a user