|
@ -1,4 +1,88 @@ |
|
|
|
|
|
|
|
|
|
|
|
#include "light_control_service.h" |
|
|
|
|
|
|
|
|
|
|
|
#include "../../zes8p5066lib/systicket.h" |
|
|
|
|
|
#include "../port.h" |
|
|
|
|
|
static Page_t s_nowpage; |
|
|
|
|
|
|
|
|
|
|
|
typedef struct { |
|
|
|
|
|
Page_t nowpage; |
|
|
|
|
|
union { |
|
|
|
|
|
struct { |
|
|
|
|
|
// rgb状态指示灯 |
|
|
|
|
|
bool status_light_r; |
|
|
|
|
|
bool status_light_g; |
|
|
|
|
|
bool status_light_b; |
|
|
|
|
|
|
|
|
|
|
|
//倒计时指示灯 |
|
|
|
|
|
int countdown_num; //当前灯的数量 |
|
|
|
|
|
int one_light_time; // |
|
|
|
|
|
uint32_t countdown_ms; //当前灯代表的时间 |
|
|
|
|
|
uint32_t flash_triggerTicket; //倒计时指示灯闪烁效果触发时间 |
|
|
|
|
|
bool flash_triggered; //是否触发闪烁指示灯 |
|
|
|
|
|
uint32_t flash_autoCloseTimeMs; //倒计时闪烁指示灯自动关闭时间 |
|
|
|
|
|
|
|
|
|
|
|
int count_light_flash_ticket; |
|
|
|
|
|
|
|
|
|
|
|
} p1; |
|
|
|
|
|
struct { |
|
|
|
|
|
int errorNum; |
|
|
|
|
|
} p2; |
|
|
|
|
|
} p; |
|
|
|
|
|
} ModuleState_t; |
|
|
|
|
|
|
|
|
|
|
|
ModuleState_t m; |
|
|
|
|
|
|
|
|
|
|
|
void lcs_change_page(Page_t page) { |
|
|
|
|
|
m.nowpage = page; |
|
|
|
|
|
if (m.nowpage == kworkPage) { |
|
|
|
|
|
port_led_r_set(m.p.p1.status_light_r); |
|
|
|
|
|
port_led_g_set(m.p.p1.status_light_g); |
|
|
|
|
|
port_led_b_set(m.p.p1.status_light_b); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void lcs_count_donwload_light__set_one_light_time_min(int min) {} |
|
|
|
|
|
void lcs_count_donwload_light__set_count_num(int num) {} |
|
|
|
|
|
void lcs_count_donwload_light__trigger_flash(int lastfortime, bool retrigger) { |
|
|
|
|
|
/** |
|
|
|
|
|
* @brief 触发倒计时指示灯闪烁效果 |
|
|
|
|
|
*/ |
|
|
|
|
|
m.p.p1.flash_triggerTicket = systicket_get_now_ms(); |
|
|
|
|
|
m.p.p1.flash_triggered = true; |
|
|
|
|
|
m.p.p1.flash_autoCloseTimeMs = lastfortime; |
|
|
|
|
|
} |
|
|
|
|
|
void lcs_status_light__set_color(bool r, bool g, bool b) { |
|
|
|
|
|
m.p.p1.status_light_r = r; |
|
|
|
|
|
m.p.p1.status_light_g = g; |
|
|
|
|
|
m.p.p1.status_light_b = b; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void lcs_error_light__set_error(int errorNum) {} |
|
|
|
|
|
void lcs_error_light__clear_error(int errorNum) {} |
|
|
|
|
|
|
|
|
|
|
|
/*********************************************************************************************************************** |
|
|
|
|
|
* =====================================================schedule====================================================== * |
|
|
|
|
|
***********************************************************************************************************************/ |
|
|
|
|
|
void lcs_schedule_process() { |
|
|
|
|
|
/** |
|
|
|
|
|
* @brief |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
if (m.nowpage == kworkPage) { |
|
|
|
|
|
if (m.p.p1.flash_triggered) { |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void lcs_shcedule() { |
|
|
|
|
|
static uint32_t ticket = 0; |
|
|
|
|
|
if (systicket_haspassedms(ticket) > 30) { |
|
|
|
|
|
ticket = systicket_get_now_ms(); |
|
|
|
|
|
lcs_schedule_process(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
#if 0 |
|
|
#if 0 |
|
|
#include "light.h" |
|
|
#include "light.h" |
|
|
static bool s_interval_working_mode; |
|
|
static bool s_interval_working_mode; |
|
|