static portTASK_FUNCTION(AppTask, pvParameters) { (void)pvParameters; /* not used */ RTC1_TTIME time; RTC1_TDATE date; if (RTC1_GetRTCTimeDate(&time, &date)==ERR_OK) { TmDt1_SetDate((uint16_t)date.year+2000, date.month, date.day); TmDt1_SetTime(time.hour, time.min, time.sec, 0); } else { for(;;) {} /* error */ } (void)NEO_ClearAllPixel(); (void)NEO_TransferPixels(); #if HAS_CLOCK (void)NEOL_PixelTrail(0x00, 0x00, 0xFF, NEO_PIXEL_FIRST, NEO_PIXEL_LAST, 8, 25, 20); (void)NEOL_PixelTrail(0x00, 0xff, 0x00, NEO_PIXEL_FIRST, NEO_PIXEL_LAST, 16, 25, 15); (void)NEOL_PixelTrail(0x00, 0x50, 0xff, NEO_PIXEL_FIRST, NEO_PIXEL_LAST, 16, 25, 10); CLOCK_Init(); #endif for(;;) { #if HAS_ELEVATOR Elevator(); FRTOS1_vTaskDelay(1000/portTICK_RATE_MS); #else CLOCK_Update(); FRTOS1_vTaskDelay(50/portTICK_RATE_MS); #endif } /* for */ }
static portTASK_FUNCTION(AppTask, pvParameters) { (void)pvParameters; /* not used */ RTC1_TTIME time; RTC1_TDATE date; if (RTC1_GetRTCTimeDate(&time, &date)==ERR_OK) { TmDt1_SetDate((uint16_t)date.year+2000, date.month, date.day); TmDt1_SetTime(time.hour, time.min, time.sec, 0); } else { for(;;) {} /* error */ } (void)NEO_ClearAllPixel(); (void)NEO_TransferPixels(); CLOCK_Init(); for(;;) { CLOCK_Update(); FRTOS1_vTaskDelay(50/portTICK_RATE_MS); } /* for */ }