46 lines
1.0 KiB
C
46 lines
1.0 KiB
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;
|
|
case 3:
|
|
led_anim_03(); // <-- AGORA É A PRINCIPAL
|
|
break;
|
|
|
|
default:
|
|
// fallback seguro
|
|
led_idle_animation();
|
|
break;
|
|
}
|
|
|
|
// controla a velocidade de TODAS as animações
|
|
vTaskDelay(pdMS_TO_TICKS(40)); // ~25 FPS
|
|
}
|
|
}
|