|
|
@ -14,7 +14,7 @@ static key_t s_keys[] = { |
|
|
|
s_key_init("intervalkey", port_gpio_get_interval_key_state), |
|
|
|
}; |
|
|
|
|
|
|
|
static ThisDevice_t this_device = {.power = false}; |
|
|
|
static ThisDevice_t this_device; |
|
|
|
|
|
|
|
static void mf_init_all_subdevice_state() { |
|
|
|
port_debug_set(false); |
|
|
@ -28,14 +28,23 @@ static void mf_init_all_subdevice_state() { |
|
|
|
port_led_b_set(false); |
|
|
|
} |
|
|
|
|
|
|
|
//开始工作 |
|
|
|
static void startwork() { port_fan_set(true); } |
|
|
|
//停止工作 |
|
|
|
static void stopwork() { port_fan_set(false); } |
|
|
|
|
|
|
|
static void poweron() { |
|
|
|
this_device.power = true; |
|
|
|
port_fan_set(true); |
|
|
|
this_device.ozone_level = level_low; |
|
|
|
this_device.ozone_module = normal; |
|
|
|
startwork(); |
|
|
|
|
|
|
|
return; |
|
|
|
} |
|
|
|
static void powerdown() { |
|
|
|
this_device.power = false; |
|
|
|
port_fan_set(false); |
|
|
|
stopwork(); |
|
|
|
|
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
@ -52,14 +61,23 @@ static void mf_process_poweron_key(key_t *key) { |
|
|
|
return; |
|
|
|
} |
|
|
|
static void mf_process_level_key(key_t *key) { |
|
|
|
if (!this_device.power) { |
|
|
|
return; |
|
|
|
} |
|
|
|
printf("key name:%s\n", key->name); |
|
|
|
return; |
|
|
|
} |
|
|
|
static void mf_process_timer_key(key_t *key) { |
|
|
|
if (!this_device.power) { |
|
|
|
return; |
|
|
|
} |
|
|
|
printf("key name:%s\n", key->name); |
|
|
|
return; |
|
|
|
} |
|
|
|
static void mf_process_interval_key(key_t *key) { |
|
|
|
if (!this_device.power) { |
|
|
|
return; |
|
|
|
} |
|
|
|
printf("key name:%s\n", key->name); |
|
|
|
return; |
|
|
|
} |
|
|
|