int main(void)
{
  uint32_t currentSecond, lastSecond;
  currentSecond = lastSecond = 0;

  /* Configure the HW */
  boardInit();

#if defined CFG_CMSIS_RTOS
 tid_blinkthread = osThreadCreate(osThread(blink_thread), NULL);
 tid_mainthread = osThreadGetId();
 for (;;)
 {
	 osDelay(1000);
	 boardLED((currentSecond++) & 1);
 }
#endif
	
  while (1)
  {
    currentSecond = delayGetSecondsActive();
    if (currentSecond != lastSecond)
    {
      lastSecond = currentSecond;
      /* Blinky */
      boardLED(lastSecond % 2);
    }

    /* Poll for CLI input if CFG_INTERFACE is enabled */
    #ifdef CFG_INTERFACE
      cliPoll();
    #endif
  }
}
示例#2
0
int main(void)
{
  uint32_t currentSecond, lastSecond;
  currentSecond = lastSecond = 0;

  /* Configure the HW */
  boardInit();

  while (1)
  {
    /* Blinky (1Hz) */
    currentSecond = delayGetSecondsActive();
    if (currentSecond != lastSecond)
    {
      lastSecond = currentSecond;
      //boardLED(lastSecond % 2);
    }

    #ifdef CFG_ERPC
      erpc_task(NULL);
    #endif

    /* Check for binary protocol input if CFG_PROTOCOL is enabled */
    #ifdef CFG_PROTOCOL
      prot_task(NULL);
    #endif

    /* Poll for CLI input if CFG_INTERFACE is enabled */
    #ifdef CFG_INTERFACE
      cliPoll();
    #endif
  }
}
int main(void)
{
  uint32_t currentSecond, lastSecond;
  currentSecond = lastSecond = 0;

  /* Configure the HW */
  boardInit();

  while (1)
  {
    /* Blinky (1Hz) */
    currentSecond = delayGetSecondsActive();
    if (currentSecond != lastSecond)
    {
      lastSecond = currentSecond;
      boardLED(lastSecond % 2);
    }

    /* Check for binary protocol input if CFG_PROTOCOL is enabled */
    #ifdef CFG_PROTOCOL
      prot_task(NULL);
    #endif

    /* Poll for CLI input if CFG_INTERFACE is enabled */
    #ifdef CFG_INTERFACE
      cliPoll();
    #endif

//    if ( usb_custom_is_ready_to_send() )
//    {
//      static uint32_t magic_number = 0;
//      uint32_t buffer[2][16];  // 2x64 byte in size
//      buffer[0][0] = magic_number++;
//      buffer[1][0] = magic_number++;
//      usb_custom_send(buffer, 64*2);
//    }
//
//    if (custom_recv_magic_number != 0)
//    {
//      printf("%d\n", custom_recv_magic_number);
//      custom_recv_magic_number = 0;
//    }

    /* Optionally enter high level sleep mode here via WFI */
  }
}