Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix initialisation delay #82

Merged
merged 1 commit into from
Feb 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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