diff --git a/firmware/device_check.cpp b/firmware/device_check.cpp index e09a76c..7c54317 100644 --- a/firmware/device_check.cpp +++ b/firmware/device_check.cpp @@ -213,29 +213,29 @@ void device_check_run() Serial.println("Diagnostics complete"); -while (1) + while (1) { -drawStatus(status); + drawStatus(status); -if (btnUp()) -{ -selectedIndex--; -if (selectedIndex < 0) selectedIndex = MAX_ITEMS - 1; -delay(150); -} + if (btnUp()) + { + selectedIndex--; + if (selectedIndex < 0) selectedIndex = MAX_ITEMS - 1; + delay(150); + } -if (btnDown()) -{ -selectedIndex++; -if (selectedIndex >= MAX_ITEMS) selectedIndex = 0; -delay(150); -} + if (btnDown()) + { + selectedIndex++; + if (selectedIndex >= MAX_ITEMS) selectedIndex = 0; + delay(150); + } -if (btnBack()) -{ -delay(150); -break; -} + if (btnBack()) + { + delay(150); + break; + } }} diff --git a/firmware/firmware.ino b/firmware/firmware.ino index 12fb296..83ba1f8 100644 --- a/firmware/firmware.ino +++ b/firmware/firmware.ino @@ -39,24 +39,16 @@ RF24 radio2(CE2_PIN, CSN2_PIN); SPIClass *RADIO_SPI; +void deactivateNRF1() { + digitalWrite(CSN1_PIN, HIGH); + digitalWrite(CE1_PIN, LOW); +} +void deactivateNRF2() { + digitalWrite(CSN2_PIN, HIGH); + digitalWrite(CE2_PIN, LOW); +} -// ================= BLE SCAN ================= -//BLEScan *pBLEScan; -// -// -//void startBLEScan() -//{ -// BLEDevice::init(""); -// -// pBLEScan = BLEDevice::getScan(); -// -// pBLEScan->setActiveScan(true); -// -// pBLEScan->start(5); -// -// Serial.println("BLE scan complete"); -//} // ================= SYSTEM INFO ================= void printSystemUsage() @@ -110,16 +102,16 @@ void setup() USB.begin(); Keyboard.begin(); - // Begin Ble mouse - bleMouse.begin(); // NRF SPI safety - pinMode(CSN1_PIN, OUTPUT); - digitalWrite(CSN1_PIN, HIGH); + //pinMode(CSN1_PIN, OUTPUT); + //digitalWrite(CSN1_PIN, HIGH); - pinMode(CSN2_PIN, OUTPUT); - digitalWrite(CSN2_PIN, HIGH); + //pinMode(CSN2_PIN, OUTPUT); + //digitalWrite(CSN2_PIN, HIGH); + deactivateNRF1(); + deactivateNRF2(); RADIO_SPI = new SPIClass(FSPI); RADIO_SPI->begin(NRF_SCK, NRF_MISO, NRF_MOSI);