|
|
@ -4,6 +4,9 @@ extern "C" { |
|
|
|
|
|
|
|
static iflytop::ZGPIO g_debuglight; |
|
|
|
static Pin_t g_debuglight_pin = PinNull; |
|
|
|
static bool g_error_state = false; |
|
|
|
|
|
|
|
void chip_set_error() { g_error_state = true; } |
|
|
|
|
|
|
|
void chip_init(chip_cfg_t *cfg) { |
|
|
|
g_debuglight_pin = cfg->debuglight; |
|
|
@ -23,10 +26,18 @@ void chip_init(chip_cfg_t *cfg) { |
|
|
|
|
|
|
|
iflytop::ChipTimIrqShceduler::instance().regPeriodJob( |
|
|
|
[](iflytop::ChipTimIrqShceduler::Job *job) { |
|
|
|
if (g_error_state) return; |
|
|
|
if (g_debuglight_pin == PinNull) return; |
|
|
|
g_debuglight.toggleState(); |
|
|
|
}, |
|
|
|
300); |
|
|
|
iflytop::ChipTimIrqShceduler::instance().regPeriodJob( |
|
|
|
[](iflytop::ChipTimIrqShceduler::Job *job) { |
|
|
|
if (!g_error_state) return; |
|
|
|
if (g_debuglight_pin == PinNull) return; |
|
|
|
g_debuglight.toggleState(); |
|
|
|
}, |
|
|
|
50); |
|
|
|
|
|
|
|
ZEARLY_LOGI("SYS", "chip init ok"); |
|
|
|
ZEARLY_LOGI("SYS", "= manufacturer : %s", MANUFACTURER); |
|
|
|