LED_shit/main/led_task.c
2025-11-22 00:13:32 +00:00

43 lines
924 B
C

#include "led_task.h"
#include "led_effects.h"
#include "eeprom_animacao.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_log.h"
static const char *TAG = "LED_TASK";
void led_task(void *pv)
{
ESP_LOGI(TAG, "💡 LED task iniciada");
while (1) {
switch (animacao) {
case 0:
// modo idle (pontinho azul)
led_idle_animation();
break;
case 1:
// modo relógio
led_clock_animation();
break;
case 2:
// jackpot non-blocking
led_jackpot_animation();
break;
default:
// fallback seguro
led_idle_animation();
break;
}
// controla a velocidade de TODAS as animações
vTaskDelay(pdMS_TO_TICKS(40)); // ~25 FPS
}
}