Browse Source

update

master
zwsd 3 years ago
parent
commit
4b048f78ab
  1. 25
      APP/main.c
  2. 1
      APP/this_device.h

25
APP/main.c

@ -88,6 +88,13 @@ static void mf_process_timer_key(key_t *key) {
return;
}
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;
}
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() {
SystemInit(); //
DeviceClockAllEnable(); //
@ -173,6 +197,7 @@ int main() {
END();
hcis_shcedule();
configuration_shcedule();
}
return 0;

1
APP/this_device.h

@ -19,4 +19,5 @@ typedef struct {
ozone_module_t ozone_module;
bool configuration_mode;
uint32_t configuration_start_time;
} ThisDevice_t;
Loading…
Cancel
Save