|
@ -88,6 +88,13 @@ static void mf_process_timer_key(key_t *key) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
printf("key name:%s\n", key->name); |
|
|
printf("key name:%s\n", key->name); |
|
|
|
|
|
|
|
|
|
|
|
if (this_device.configuration_mode == false) { |
|
|
|
|
|
this_device.configuration_start_time = systicket_get_now_ms(); |
|
|
|
|
|
this_device.configuration_mode = true; |
|
|
|
|
|
} else { |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
static void mf_process_interval_key(key_t *key) { |
|
|
static void mf_process_interval_key(key_t *key) { |
|
@ -143,6 +150,23 @@ void hcis_shcedule() { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void configuration_shcedule() { |
|
|
|
|
|
static bool led_state; |
|
|
|
|
|
static uint32_t led_ticket = 0; |
|
|
|
|
|
if (this_device.configuration_mode == true) { |
|
|
|
|
|
if (systicket_haspassedms(this_device.configuration_start_time) > 1000) { |
|
|
|
|
|
this_device.configuration_mode = false; |
|
|
|
|
|
mf_init_all_subdevice_state(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (systicket_haspassedms(led_ticket) > 100) { |
|
|
|
|
|
led_ticket = systicket_get_now_ms(); |
|
|
|
|
|
port_led0_set(led_state); |
|
|
|
|
|
led_state = !led_state; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
void hardware_init() { |
|
|
void hardware_init() { |
|
|
SystemInit(); //配置系统时钟 |
|
|
SystemInit(); //配置系统时钟 |
|
|
DeviceClockAllEnable(); //打开所有外设时钟 |
|
|
DeviceClockAllEnable(); //打开所有外设时钟 |
|
@ -173,6 +197,7 @@ int main() { |
|
|
END(); |
|
|
END(); |
|
|
|
|
|
|
|
|
hcis_shcedule(); |
|
|
hcis_shcedule(); |
|
|
|
|
|
configuration_shcedule(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return 0; |
|
|
return 0; |
|
|