Browse Source

update

master
zwsd 3 years ago
parent
commit
14ddd63930
  1. 30
      APP/main.c
  2. 2
      APP/this_device.h

30
APP/main.c

@ -53,6 +53,7 @@ static void mf_process_poweron_key(key_t *key) {
printf("key name:%s\n", key->name); printf("key name:%s\n", key->name);
if (!this_device.power) { if (!this_device.power) {
mf_init_all_subdevice_state();
poweron(); poweron();
} else { } else {
powerdown(); powerdown();
@ -62,6 +63,7 @@ static void mf_process_poweron_key(key_t *key) {
} }
static void mf_process_level_key(key_t *key) { static void mf_process_level_key(key_t *key) {
if (!this_device.power) { if (!this_device.power) {
mf_init_all_subdevice_state();
return; return;
} }
printf("key name:%s\n", key->name); printf("key name:%s\n", key->name);
@ -69,6 +71,7 @@ static void mf_process_level_key(key_t *key) {
} }
static void mf_process_timer_key(key_t *key) { static void mf_process_timer_key(key_t *key) {
if (!this_device.power) { if (!this_device.power) {
mf_init_all_subdevice_state();
return; return;
} }
printf("key name:%s\n", key->name); printf("key name:%s\n", key->name);
@ -76,6 +79,7 @@ static void mf_process_timer_key(key_t *key) {
} }
static void mf_process_interval_key(key_t *key) { static void mf_process_interval_key(key_t *key) {
if (!this_device.power) { if (!this_device.power) {
mf_init_all_subdevice_state();
return; return;
} }
printf("key name:%s\n", key->name); printf("key name:%s\n", key->name);
@ -96,6 +100,30 @@ static void onkey(key_t *key, key_state_t key_state) {
key_module_t key_module = key_module_init(s_keys, onkey); key_module_t key_module = key_module_init(s_keys, onkey);
//
void device_level_process() {}
//
void device_time_process() {}
void hcis_shcedule_process() {
if (!this_device.power) {
mf_init_all_subdevice_state();
return;
}
device_level_process();
device_time_process();
}
void hcis_shcedule() {
static uint32_t ticket = 0;
if (systicket_haspassedms(ticket) > 30) {
ticket = systicket_get_now_ms();
hcis_shcedule_process();
}
}
void hardware_init() { void hardware_init() {
SystemInit(); // SystemInit(); //
DeviceClockAllEnable(); // DeviceClockAllEnable(); //
@ -124,6 +152,8 @@ int main() {
// debug light // debug light
DO_IT_EACH_MS(150) { flip_debuf_light_level(); } DO_IT_EACH_MS(150) { flip_debuf_light_level(); }
END(); END();
hcis_shcedule();
} }
return 0; return 0;

2
APP/this_device.h

@ -17,4 +17,6 @@ typedef struct {
bool power; bool power;
ozone_level_t ozone_level; ozone_level_t ozone_level;
ozone_module_t ozone_module; ozone_module_t ozone_module;
bool configuration_mode;
} ThisDevice_t; } ThisDevice_t;
Loading…
Cancel
Save