更改按键,已经添加msp重启
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
button_t btn;
|
||||
|
||||
cfg_board_pin_io_t key_switch = {
|
||||
.pin = 9,
|
||||
.en_lev = 0,};
|
||||
.pin = 18,
|
||||
.en_lev = 1,};
|
||||
cfg_board_pin_io_t boot_switch = {
|
||||
.pin = 18,
|
||||
.en_lev = 0,};
|
||||
@@ -174,7 +174,7 @@ void button_work_init() {
|
||||
|
||||
pin_cfg_input(&key_switch);
|
||||
// pin_cfg_output(&boot_switch);
|
||||
gpio_to_high_z(&boot_switch);
|
||||
// gpio_to_high_z(&boot_switch);
|
||||
|
||||
button_init(&btn, read_button_pin, my_button_handler);
|
||||
|
||||
@@ -208,4 +208,22 @@ void key_test(void)
|
||||
os_thread_sleep(5000);
|
||||
|
||||
boot_set_high_z();
|
||||
}
|
||||
|
||||
void boot_set_2(uint8_t value)
|
||||
{
|
||||
pin_cfg_output(&boot_switch);
|
||||
pin_set_valid(&boot_switch, value);
|
||||
os_work_suspend(&work_handler_button);
|
||||
}
|
||||
|
||||
void boot_set_high_z_2(void)
|
||||
{
|
||||
pin_cfg_input(&key_switch);
|
||||
os_work_resume(&work_handler_button,10);
|
||||
}
|
||||
|
||||
bool key_get_status(void)
|
||||
{
|
||||
return pin_get_valid(&key_switch);
|
||||
}
|
||||
Reference in New Issue
Block a user