aboutsummaryrefslogtreecommitdiff
path: root/firmware/ble_mouse.cpp
diff options
context:
space:
mode:
authorkrolyxon <me@krolyxon.com>2026-05-11 14:01:44 +0530
committerkrolyxon <me@krolyxon.com>2026-05-11 14:01:44 +0530
commitf34b1e2fbd94bcc8d0ee2e2e2e43e214d0b329a1 (patch)
tree235d29da4668906d1e11d651980cea8b0c69dec7 /firmware/ble_mouse.cpp
parent360d2d2ad3bd584014683f3579fc2e2348c16852 (diff)
Migrate to PlatformIO
Now since i have been able to make PSRAM working with platformio, i don't have to use this shitty Arduino-IDE anymore which does not even allow me to use subfolders like a normal programmer would do
Diffstat (limited to 'firmware/ble_mouse.cpp')
-rw-r--r--firmware/ble_mouse.cpp74
1 files changed, 0 insertions, 74 deletions
diff --git a/firmware/ble_mouse.cpp b/firmware/ble_mouse.cpp
deleted file mode 100644
index 8e666ec..0000000
--- a/firmware/ble_mouse.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-#include <Arduino.h>
-#include <BleMouse.h>
-#include "badusb.h"
-#include "config.h"
-
-#include "buttons.h"
-#include "display.h"
-
-// ===== BLE MOUSE =====
-// BleMouse bleMouse("Orion-RF", "Orion-RF", 100);
-extern BleMouse bleMouse;
-
-// ===== MAIN =====
-void ble_mouse_run()
-{
- u8g2.clearBuffer();
- u8g2.setFont(u8g2_font_6x10_tr);
- u8g2.drawStr(10, 25, "BLE Mouse");
- u8g2.drawStr(10, 45, "Connecting...");
- u8g2.sendBuffer();
-
- delay(800);
-
- while (1)
- {
- // 🔥 EXIT FIRST (clean)
- if (btnBack()) break;
-
- bool connected = bleMouse.isConnected();
-
- int dx = 0;
- int dy = 0;
-
- if (connected)
- {
- if (!digitalRead(BTN_UP)) dy = -6;
- if (!digitalRead(BTN_DOWN)) dy = 6;
- if (!digitalRead(BTN_LEFT)) dx = -6;
- if (!digitalRead(BTN_RIGHT)) dx = 6;
-
- if (dx || dy)
- bleMouse.move(dx, dy);
-
- // ✅ single click (not spam)
- static bool lastSelect = false;
- bool currentSelect = !digitalRead(BTN_SELECT);
-
- if (currentSelect && !lastSelect)
- bleMouse.click(MOUSE_LEFT);
-
- lastSelect = currentSelect;
- }
-
- // ===== UI =====
- u8g2.clearBuffer();
- u8g2.setFont(u8g2_font_6x10_tr);
-
- u8g2.drawStr(10, 20, "BLE Mouse");
-
- if (connected)
- u8g2.drawStr(10, 35, "Connected");
- else
- u8g2.drawStr(10, 35, "Waiting");
-
- u8g2.drawStr(10, 55, "BACK = Exit");
-
- u8g2.sendBuffer();
-
- delay(10); // important for BLE stability
- }
-}
-
-
-