Skip to content

Commit

Permalink
Fix rapidfire boot delay
Browse files Browse the repository at this point in the history
  • Loading branch information
pkendall64 committed Jan 29, 2023
1 parent 5eeab17 commit 3ccbef5
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 11 deletions.
1 change: 0 additions & 1 deletion src/fusion.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include "module_base.h"
#include <Arduino.h>

#undef VRX_BOOT_DELAY
#define VRX_BOOT_DELAY 1000

#define VRX_UART_BAUD 500000 // fusion uses 500k baud between the ESP8266 and the STM32
Expand Down
1 change: 0 additions & 1 deletion src/hdzero.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "module_base.h"
#include <Arduino.h>

#undef VRX_BOOT_DELAY
#define VRX_BOOT_DELAY 7000

#define VRX_RESPONSE_TIMEOUT 500
Expand Down
1 change: 0 additions & 1 deletion src/module_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
void
ModuleBase::Init()
{
delay(VRX_BOOT_DELAY);
}

void
Expand Down
2 changes: 0 additions & 2 deletions src/module_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

#include <Arduino.h>

#define VRX_BOOT_DELAY 0

class ModuleBase
{
public:
Expand Down
9 changes: 5 additions & 4 deletions src/rapidfire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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; // '>'
Expand All @@ -59,7 +60,7 @@ Rapidfire::SendBuzzerCmd()

void
Rapidfire::SendIndexCmd(uint8_t index)
{
{
uint8_t newBand = index / 8 + 1;
uint8_t newChannel = index % 8;

Expand Down Expand Up @@ -194,7 +195,7 @@ Rapidfire::SendSPI(uint8_t* buf, uint8_t bufLen)
digitalWrite(PIN_CLK, HIGH);
delayMicroseconds(periodMicroSec / 2);

bufByte <<= 1;
bufByte <<= 1;
}
}
DBGLN("");
Expand All @@ -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);
Expand Down
1 change: 0 additions & 1 deletion src/rapidfire.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include "module_base.h"
#include <Arduino.h>

#undef VRX_BOOT_DELAY
#define VRX_BOOT_DELAY 2000

#define BIT_BANG_FREQ 1000
Expand Down
1 change: 0 additions & 1 deletion src/skyzone_msp.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "module_base.h"
#include <Arduino.h>

#undef VRX_BOOT_DELAY
#define VRX_BOOT_DELAY 2000

#define VRX_RESPONSE_TIMEOUT 500
Expand Down

0 comments on commit 3ccbef5

Please sign in to comment.