diff --git a/src/fusion.h b/src/fusion.h index 74858a8..cb439fe 100644 --- a/src/fusion.h +++ b/src/fusion.h @@ -3,7 +3,6 @@ #include "module_base.h" #include -#undef VRX_BOOT_DELAY #define VRX_BOOT_DELAY 1000 #define VRX_UART_BAUD 500000 // fusion uses 500k baud between the ESP8266 and the STM32 diff --git a/src/hdzero.h b/src/hdzero.h index 0403f3d..7320525 100644 --- a/src/hdzero.h +++ b/src/hdzero.h @@ -5,7 +5,6 @@ #include "module_base.h" #include -#undef VRX_BOOT_DELAY #define VRX_BOOT_DELAY 7000 #define VRX_RESPONSE_TIMEOUT 500 diff --git a/src/module_base.cpp b/src/module_base.cpp index 38d6fcc..515b1e7 100644 --- a/src/module_base.cpp +++ b/src/module_base.cpp @@ -3,7 +3,6 @@ void ModuleBase::Init() { - delay(VRX_BOOT_DELAY); } void diff --git a/src/module_base.h b/src/module_base.h index 9886fb2..63ffd9e 100644 --- a/src/module_base.h +++ b/src/module_base.h @@ -3,8 +3,6 @@ #include #include "msp.h" -#define VRX_BOOT_DELAY 0 - class ModuleBase { public: diff --git a/src/rapidfire.cpp b/src/rapidfire.cpp index d36fbd3..a8ca76e 100644 --- a/src/rapidfire.cpp +++ b/src/rapidfire.cpp @@ -7,6 +7,7 @@ Rapidfire::Init() { ModuleBase::Init(); + delay(VRX_BOOT_DELAY); EnableSPIMode(); // https://github.com/ExpressLRS/ExpressLRS/pull/1489 & https://github.com/ExpressLRS/Backpack/pull/65 pinMode(PIN_MOSI, INPUT); @@ -44,7 +45,7 @@ void Rapidfire::SendBuzzerCmd() { DBGLN("Beep!"); - + uint8_t cmd[4]; cmd[0] = RF_API_BEEP_CMD; // 'S' cmd[1] = RF_API_DIR_GRTHAN; // '>' @@ -59,7 +60,7 @@ Rapidfire::SendBuzzerCmd() void Rapidfire::SendIndexCmd(uint8_t index) -{ +{ uint8_t newBand = index / 8 + 1; uint8_t newChannel = index % 8; @@ -194,7 +195,7 @@ Rapidfire::SendSPI(uint8_t* buf, uint8_t bufLen) digitalWrite(PIN_CLK, HIGH); delayMicroseconds(periodMicroSec / 2); - bufByte <<= 1; + bufByte <<= 1; } } DBGLN(""); @@ -203,7 +204,7 @@ Rapidfire::SendSPI(uint8_t* buf, uint8_t bufLen) digitalWrite(PIN_CLK, LOW); digitalWrite(PIN_CS, HIGH); delay(100); - + pinMode(PIN_MOSI, INPUT); pinMode(PIN_CLK, INPUT); pinMode(PIN_CS, INPUT); diff --git a/src/rapidfire.h b/src/rapidfire.h index 370486c..b70b3ca 100644 --- a/src/rapidfire.h +++ b/src/rapidfire.h @@ -3,7 +3,6 @@ #include "module_base.h" #include -#undef VRX_BOOT_DELAY #define VRX_BOOT_DELAY 2000 #define BIT_BANG_FREQ 1000 diff --git a/src/skyzone_msp.h b/src/skyzone_msp.h index 0869fc4..b8d08fe 100644 --- a/src/skyzone_msp.h +++ b/src/skyzone_msp.h @@ -5,7 +5,6 @@ #include "module_base.h" #include -#undef VRX_BOOT_DELAY #define VRX_BOOT_DELAY 2000 #define VRX_RESPONSE_TIMEOUT 500