mirror of
https://github.com/markqvist/RNode_Firmware.git
synced 2025-07-02 18:36:46 -04:00
Added input button actions
This commit is contained in:
parent
b1d097f6d4
commit
ac819ecb20
1 changed files with 12 additions and 1 deletions
|
@ -1326,8 +1326,19 @@ void sleep_now() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void button_event(uint8_t event, unsigned long duration) {
|
void button_event(uint8_t event, unsigned long duration) {
|
||||||
if (duration > 2000) {
|
if (duration > 6000) {
|
||||||
|
bt_enable_pairing();
|
||||||
|
} else if (duration > 4000) {
|
||||||
|
console_active = true;
|
||||||
|
console_start();
|
||||||
|
} else if (duration > 2000) {
|
||||||
sleep_now();
|
sleep_now();
|
||||||
|
} else {
|
||||||
|
if (bt_state == BT_STATE_OFF) {
|
||||||
|
bt_start();
|
||||||
|
} else {
|
||||||
|
bt_stop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue