示例#1
0
文件: led_lib.c 项目: xlnrony/nuttx_1
int led_init(void)
{
  int ret = OK;

  led1_fd = open(CONFIG_LED1_DEVNAME, 0);
  if (led1_fd < 0)
    {
      ret = -errno;
      inddbg("open %s failed: %d\n", CONFIG_LED1_DEVNAME, ret);
      goto errout;
    }

  led2_fd = open(CONFIG_LED2_DEVNAME, 0);
  if (led2_fd < 0)
    {
      ret = -errno;
      inddbg("open %s failed: %d\n", CONFIG_LED2_DEVNAME, ret);
      goto errout;
    }

  led3_fd = open(CONFIG_LED3_DEVNAME, 0);
  if (led3_fd < 0)
    {
      ret = -errno;
      inddbg("open %s failed: %d\n", CONFIG_LED3_DEVNAME, ret);
      goto errout;
    }

  return ret;
errout:
  led_deinit();
  return ret;
}
void upgrade_agent_usb_deinit(void)
{
	/* TODO: Shut down USB */
	USB_CDC_device_deinit();
	led_deinit();
}