|
@ -14,6 +14,9 @@ |
|
|
#include "esp_log.h" |
|
|
#include "esp_log.h" |
|
|
#include "port.h" |
|
|
#include "port.h" |
|
|
|
|
|
|
|
|
|
|
|
#define DEBUG_LIGHT_TOGGLE_TIME 300 |
|
|
|
|
|
#define OTHER_LIGHT_TOGGLE_TIME 500 |
|
|
|
|
|
|
|
|
#define GPIO_DEBUG_LIGHT 12 |
|
|
#define GPIO_DEBUG_LIGHT 12 |
|
|
#define GPIO_POWER_LIGHT 12 |
|
|
#define GPIO_POWER_LIGHT 12 |
|
|
#define GPIO_HEATING_PLATE_STATE_LIGHT 12 |
|
|
#define GPIO_HEATING_PLATE_STATE_LIGHT 12 |
|
@ -39,9 +42,9 @@ void T_debug_light_init(void) |
|
|
gpio_config(&gpio_debug_light_init_structer); |
|
|
gpio_config(&gpio_debug_light_init_structer); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void T_debug_light_toggle_level(void) |
|
|
|
|
|
|
|
|
void T_light_toggle_level(uint8_t io_num) |
|
|
{ |
|
|
{ |
|
|
gpio_set_level(GPIO_DEBUG_LIGHT, !gpio_get_level(GPIO_DEBUG_LIGHT)); |
|
|
|
|
|
|
|
|
gpio_set_level(io_num, !gpio_get_level(GPIO_DEBUG_LIGHT)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Power light |
|
|
// Power light |
|
@ -107,9 +110,32 @@ void T_wifi_state_light_init(wifi_state_light_structer_t *wifi_state_light_struc |
|
|
void T_debug_light_schedule(void) |
|
|
void T_debug_light_schedule(void) |
|
|
{ |
|
|
{ |
|
|
static uint32_t debug_light_time; |
|
|
static uint32_t debug_light_time; |
|
|
if (port_haspassedms(debug_light_time) > 300) |
|
|
|
|
|
|
|
|
if (port_haspassedms(debug_light_time) > DEBUG_LIGHT_TOGGLE_TIME) |
|
|
|
|
|
{ |
|
|
|
|
|
T_light_toggle_level(GPIO_DEBUG_LIGHT); |
|
|
|
|
|
debug_light_time = port_get_ticket(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void T_light_flash_schedule(void) |
|
|
|
|
|
{ |
|
|
|
|
|
static uint32_t debug_light_time; |
|
|
|
|
|
if (port_haspassedms(debug_light_time) > OTHER_LIGHT_TOGGLE_TIME) |
|
|
{ |
|
|
{ |
|
|
T_debug_light_toggle_level(); |
|
|
|
|
|
|
|
|
if (heating_plate_state_light_structer_s->state == Heating) |
|
|
|
|
|
{ |
|
|
|
|
|
T_light_toggle_level(GPIO_HEATING_PLATE_STATE_LIGHT); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (reaction_state_light_structer_s->state == Reacting) |
|
|
|
|
|
{ |
|
|
|
|
|
T_light_toggle_level(GPIO_REACTION_STATE_LIGHT); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (wifi_state_light_structer_s->state == Connecting) |
|
|
|
|
|
{ |
|
|
|
|
|
T_light_toggle_level(GPIO_WIFI_STATE_LIGHT); |
|
|
|
|
|
} |
|
|
debug_light_time = port_get_ticket(); |
|
|
debug_light_time = port_get_ticket(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |