Beispiel #1
0
int board_app_initialize(void)
{
#if defined(CONFIG_CAN) || defined(CONFIG_ADC)
  int ret;
#endif

#ifdef CONFIG_CAN
  /* Configure on-board CAN if CAN support has been selected. */

  ret = stm32_can_initialize();
  if (ret != OK)
    {
      syslog(LOG_ERR, "ERROR: Failed to initialize CAN: %d\n", ret);
    }
#endif

#ifdef CONFIG_ADC
  /* Configure on-board ADCs if ADC support has been selected. */

  ret = stm32_adc_initialize();
  if (ret != OK)
    {
      syslog(LOG_ERR, "ERROR: Failed to initialize ADC: %d\n", ret);
    }
#endif

#ifdef HAVE_USBHOST
  /* Initialize USB host operation.  stm32_usbhost_initialize() starts a thread
   * will monitor for USB connection and disconnection events.
   */

  ret = stm32_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(0, NULL);
  if (ret != OK)
    {
      syslog(LOG_ERR, "ERROR: Failed to start USB monitor: %d\n", ret);
    }
#endif

  return OK;
}
Beispiel #2
0
int can_devinit(void)
{
  return stm32_can_initialize();
}
Beispiel #3
0
int board_can_initialize(void)
{
  return stm32_can_initialize();
}