From c34a80983b412cf05387231f7ec600aceedc8b6f Mon Sep 17 00:00:00 2001 From: Lucas LucidVR <35583218+lucas-vrtech@users.noreply.github.com> Date: Sat, 30 Jul 2022 15:22:06 -0400 Subject: [PATCH] Error out if users try to use gpio0 while using usb communication. NO BUGS ALLOWED!!! --- firmware/lucidgloves-firmware/_main.ino | 5 +++++ firmware/lucidgloves-firmware/lucidgloves-firmware.ino | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/firmware/lucidgloves-firmware/_main.ino b/firmware/lucidgloves-firmware/_main.ino index d1f6c2d..2a97184 100644 --- a/firmware/lucidgloves-firmware/_main.ino +++ b/firmware/lucidgloves-firmware/_main.ino @@ -1,5 +1,10 @@ #define ALWAYS_CALIBRATING CALIBRATION_LOOPS == -1 +#define CALIB_OVERRIDE false +#if USING_CALIB_PIN && COMMUNICATION == COMM_SERIAL && PIN_CALIB == 0 && !CALIB_OVERRIDE + #error "You can't set your calibration pin to 0 over usb. You can calibrate with the BOOT button when using bluetooth only. Set CalibOverride to true to override this." +#endif + ICommunication* comm; int loops = 0; void setup() { diff --git a/firmware/lucidgloves-firmware/lucidgloves-firmware.ino b/firmware/lucidgloves-firmware/lucidgloves-firmware.ino index 7befc82..6f89bf5 100644 --- a/firmware/lucidgloves-firmware/lucidgloves-firmware.ino +++ b/firmware/lucidgloves-firmware/lucidgloves-firmware.ino @@ -67,7 +67,7 @@ #define PIN_TRIG_BTN 12 //unused if gesture set #define PIN_GRAB_BTN 13 //unused if gesture set #define PIN_PNCH_BTN 23 //unused if gesture set - #define PIN_CALIB 12 //button for recalibration + #define PIN_CALIB 12 //button for recalibration (You can set this to GPIO0 to use the BOOT button, but only when using Bluetooth.) #define DEBUG_LED 2 #define PIN_PINKY_MOTOR 5 //used for force feedback #define PIN_RING_MOTOR 18 //^