]> git.tnoah.ca Git - lora-radio.git/commitdiff
Added input button actions
authorMark Qvist <mark@unsigned.io>
Thu, 26 Sep 2024 22:27:24 +0000 (00:27 +0200)
committerMark Qvist <mark@unsigned.io>
Thu, 26 Sep 2024 22:27:24 +0000 (00:27 +0200)
RNode_Firmware.ino

index 4410a91b7a20e3b18a911b6b332b53029039908e..ab1b2e0824833775b3391f821858dcb35bc0fc4e 100644 (file)
@@ -1326,8 +1326,19 @@ void sleep_now() {
 }
 
 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();
+  } else {
+    if (bt_state == BT_STATE_OFF) {
+      bt_start();
+    } else {
+      bt_stop();
+    }
   }
 }