void vLedSetState(LedState_t state, int32_t duty) { int32_t d=0; if (g_lastState != LedState_Off) { for (d=g_lastDuty; d>0; d--) { vLedSetDuty(g_lastState, d); vTimerDelayMs(5); } } if (state == LedState_Off) { vLedOff(); //vLedSetDuty(LedState_Off, 0); } else { for (d=0; d<duty; d++) { vLedSetDuty(state, d); vTimerDelayMs(5); } vLedSetDuty(state, duty); } g_lastState=state; g_lastDuty=duty; }
void vLedToggle(enum LED l) { if (iLedOn[l]) vLedOff(l); else vLedOn(l); }
void vLedsFlickerTask() { enum LED led; iLedsFlickerStarted = 1; for(;;) { xQueueReceive(xLedsQueue, &led, portMAX_DELAY); vLedOn(led); vTaskDelay(LED_FLICKER_TIME_MS); vLedOff(led); } }
void vLedsOff() { vLedOff(RED); vLedOff(GREEN); vLedOff(BLUE); }