localbtn deinit & cleanup
This commit is contained in:
@ -14,18 +14,20 @@
|
||||
#include "freertos/task.h"
|
||||
#include "esp_log.h"
|
||||
|
||||
#define MAX_MODES 14 // TODO
|
||||
|
||||
static const char *TAG = "CONTROL";
|
||||
|
||||
static uint8_t current_animation_mode = 0;
|
||||
|
||||
// Forward declarations
|
||||
static void on_mode_change(uint8_t new_mode);
|
||||
static void on_mode_change();
|
||||
|
||||
// Animation mode change callback
|
||||
static void on_mode_change(uint8_t new_mode)
|
||||
static void on_mode_change()
|
||||
{
|
||||
current_animation_mode = new_mode;
|
||||
animation_set_mode((animation_mode_t)new_mode);
|
||||
current_animation_mode = (current_animation_mode + 1) % MAX_MODES;
|
||||
animation_set_mode((animation_mode_t)current_animation_mode);
|
||||
}
|
||||
|
||||
void control_set_animation_mode(uint8_t mode)
|
||||
@ -42,11 +44,6 @@ uint8_t control_get_animation_mode(void)
|
||||
return current_animation_mode;
|
||||
}
|
||||
|
||||
void control_emulate_pwm_pulse(void)
|
||||
{
|
||||
rcsignal_trigger_mode_change();
|
||||
}
|
||||
|
||||
// Main initialization
|
||||
esp_err_t control_init(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user