Browse Source

update

master
zwsd 3 years ago
parent
commit
52b77c9301
  1. 26
      APP/main.c

26
APP/main.c

@ -37,31 +37,39 @@ static void mf_init_all_subdevice_state() {
static void time_set_led_state(uint8_t led_num, bool state) { static void time_set_led_state(uint8_t led_num, bool state) {
switch (led_num) { switch (led_num) {
case 0: case 0:
port_led0_set(state);
port_led0_set(false);
port_led1_set(false);
port_led2_set(false);
port_led3_set(false);
break; break;
case 1: case 1:
port_led0_set(state); port_led0_set(state);
port_led1_set(state);
port_led1_set(false);
port_led2_set(false);
port_led3_set(false);
break; break;
case 2: case 2:
port_led0_set(state); port_led0_set(state);
port_led1_set(state); port_led1_set(state);
port_led2_set(state);
port_led2_set(false);
port_led3_set(false);
break; break;
case 3: case 3:
port_led0_set(state); port_led0_set(state);
port_led1_set(state); port_led1_set(state);
port_led2_set(state); port_led2_set(state);
port_led3_set(state);
port_led3_set(false);
break; break;
default:
printf("no more led\n");
case 4:
port_led0_set(state); port_led0_set(state);
port_led1_set(state); port_led1_set(state);
port_led2_set(state); port_led2_set(state);
port_led3_set(state); port_led3_set(state);
break; break;
default:
printf("no more led\n");
break;
} }
} }
@ -125,8 +133,8 @@ static void mf_process_timer_key(key_t *key) {
this_device.configuration_mode = true; this_device.configuration_mode = true;
} else { } else {
this_device.time_led_num = this_device.time_led_num + 1; this_device.time_led_num = this_device.time_led_num + 1;
if (this_device.time_led_num > 3) {
this_device.time_led_num = this_device.time_led_num - 3;
if (this_device.time_led_num > 4) {
this_device.time_led_num = this_device.time_led_num - 4;
} }
} }

Loading…
Cancel
Save