You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2020/01/10 10:03:39 UTC
[incubator-nuttx] 05/21: app init cleanup
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch pr68
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit cb4a1094c844302cb412a560028519d8bdcbbf0d
Author: Adam Feuer <ad...@starcat.io>
AuthorDate: Wed Jan 8 17:40:00 2020 -0800
app init cleanup
---
.../arm/sama5/sama5d3-xplained/src/sam_appinit.c | 139 +--------------------
1 file changed, 6 insertions(+), 133 deletions(-)
diff --git a/boards/arm/sama5/sama5d3-xplained/src/sam_appinit.c b/boards/arm/sama5/sama5d3-xplained/src/sam_appinit.c
index fed9a64..5c7fe88 100644
--- a/boards/arm/sama5/sama5d3-xplained/src/sam_appinit.c
+++ b/boards/arm/sama5/sama5d3-xplained/src/sam_appinit.c
@@ -87,139 +87,12 @@ int board_app_initialize(uintptr_t arg)
{
int ret;
-#ifdef HAVE_NAND
- /* Initialize the NAND driver */
-
- ret = sam_nand_automount(NAND_MINOR);
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: sam_nand_automount failed: %d\n", ret);
- return ret;
- }
-#endif
-
-#ifdef HAVE_AT25
- /* Initialize the AT25 driver */
-
- ret = sam_at25_automount(AT25_MINOR);
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: sam_at25_automount failed: %d\n", ret);
- return ret;
- }
-#endif
-
-#ifdef HAVE_HSMCI
-#ifdef CONFIG_SAMA5_HSMCI0
- /* Initialize the HSMCI0 driver */
-
- ret = sam_hsmci_initialize(HSMCI0_SLOTNO, HSMCI0_MINOR);
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: sam_hsmci_initialize(%d,%d) failed: %d\n",
- HSMCI0_SLOTNO, HSMCI0_MINOR, ret);
- return ret;
- }
-#endif
-
-#ifdef CONFIG_SAMA5_HSMCI1
- /* Initialize the HSMCI1 driver */
-
- ret = sam_hsmci_initialize(HSMCI1_SLOTNO, HSMCI1_MINOR);
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: sam_hsmci_initialize(%d,%d) failed: %d\n",
- HSMCI1_SLOTNO, HSMCI1_MINOR, ret);
- return ret;
- }
-#endif
-#endif
-
-#ifdef HAVE_USBHOST
- /* Initialize USB host operation. sam_usbhost_initialize() starts a thread
- * will monitor for USB connection and disconnection events.
- */
-
- ret = sam_usbhost_initialize();
- if (ret != OK)
- {
- syslog(LOG_ERR, "ERROR: Failed to initialize USB host: %d\n", ret);
- return ret;
- }
-#endif
-
-#ifdef HAVE_USBMONITOR
-
- /* Start the USB Monitor */
-
- ret = usbmonitor_start();
- if (ret != OK)
- {
- syslog(LOG_ERR, "ERROR: Failed to start USB monitor: %d\n", ret);
- }
-#endif
-
-#ifdef CONFIG_ADC
-
- /* Initialize ADC and register the ADC driver. */
-
- ret = sam_adc_setup();
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: sam_adc_setup failed: %d\n", ret);
- }
-#endif
-
-#ifdef CONFIG_AJOYSTICK
-
- /* Initialize and register the joystick driver */
-
- ret = sam_ajoy_initialization();
- if (ret != OK)
- {
- syslog(LOG_ERR,
- "ERROR: Failed to register the joystick driver: %d\n",
- ret);
- return ret;
- }
-#endif
-
-#ifdef CONFIG_PWM
-
- /* Initialize PWM and register the PWM device. */
-
- ret = sam_pwm_setup();
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: sam_pwm_setup() failed: %d\n", ret);
- return ret;
- }
-#endif
-
-#ifdef CONFIG_CAN
- /* Initialize CAN and register the CAN driver. */
-
- ret = sam_can_setup();
- if (ret < 0)
- {
- syslog(LOG_ERR, "ERROR: sam_can_setup failed: %d\n", ret);
- }
-#endif
-
-#ifdef CONFIG_FS_PROCFS
-
- /* Mount the procfs file system */
+ UNUSED(ret);
+#ifndef CONFIG_BOARD_LATE_INITIALIZE
+ /* Perform board initialization */
- ret = mount(NULL, SAMA5_PROCFS_MOUNTPOINT, "procfs", 0, NULL);
- if (ret < 0)
- {
- syslog(LOG_ERR,
- "ERROR: Failed to mount procfs at %s: %d\n",
- SAMA5_PROCFS_MOUNTPOINT, ret);
- return ret;
- }
+ return sam_bringup();
+#else
+ return OK;
#endif
-
- UNUSED(ret);
- return OK;
}