Skip to content

Commit

Permalink
Revert "define pin not connected"
Browse files Browse the repository at this point in the history
This reverts commit f8a16ca.
  • Loading branch information
SK21 committed Jan 26, 2024
1 parent 24754ab commit f8a2588
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
11 changes: 5 additions & 6 deletions Modules/ESP32 Rate/RC_ESP32/RC_ESP32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
#include <ESP2SOTA.h> // https://github.com/pangodream/ESP2SOTA

// rate control with ESP32 board: DOIT ESP32 DEVKIT V1
# define InoDescription "RC_ESP32 : 25-Jan-2024"
const uint16_t InoID = 25014; // change to send defaults to eeprom, ddmmy, no leading 0
# define InoDescription "RC_ESP32 : 24-Jan-2024"
const uint16_t InoID = 24014; // change to send defaults to eeprom, ddmmy, no leading 0
const uint8_t InoType = 4; // 0 - Teensy AutoSteer, 1 - Teensy Rate, 2 - Nano Rate, 3 - Nano SwitchBox, 4 - ESP Rate

#define MaxReadBuffer 100 // bytes
Expand All @@ -40,8 +40,6 @@ const uint8_t InoType = 4; // 0 - Teensy AutoSteer, 1 - Teensy Rate, 2 - Nano R
#define OutputEnablePin 27
#define DriverAddress 0x55

#define NC 0xFF // Pin are not connected

struct ModuleConfig
{
uint8_t ID = 0;
Expand All @@ -53,7 +51,7 @@ struct ModuleConfig
uint8_t IP2 = 5;
uint8_t IP3 = 60;
uint8_t RelayControl = 1; // 0 - no relays, 1 - PCA9685, 2 - PCA9555 8 relays, 3 - PCA9555 16 relays, 4 - MCP23017, 5 - Teensy GPIO
uint8_t RelayPins[16] = { 8,9,10,11,12,25,26,27,NC,NC,NC,NC,NC,NC,NC,NC }; // pin numbers when GPIOs are used for relay control (5), default RC11
uint8_t RelayPins[16] = { 8,9,10,11,12,25,26,27,0,0,0,0,0,0,0,0 }; // pin numbers when GPIOs are used for relay control (5), default RC11
char Name[ModStringLengths] = "RateModule";
char Password[ModStringLengths] = "111222333";
uint8_t AdsAddress = 0x48; // enter 0 to search all
Expand Down Expand Up @@ -137,6 +135,8 @@ bool PCA9685_found = false;
Adafruit_MCP23X17 MCP;
bool MCP23017_found = false;

int TimedCombo(byte, bool); // function prototype

// analog
struct AnalogConfig
{
Expand All @@ -150,7 +150,6 @@ AnalogConfig AINs;
int ADS1115_Address;
bool ADSfound = false;

int TimedCombo(byte, bool); // function prototype
void IRAM_ATTR ISR0(); // function prototype
void IRAM_ATTR ISR1();

Expand Down
6 changes: 3 additions & 3 deletions Modules/ESP32 Rate/RC_ESP32/Relays.ino
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ void CheckRelays()
if (BitState)
{
// on
PWMServoDriver.setPWM(IOpin, 4096, 0);
PWMServoDriver.setPWM(IOpin, 4096, 0);
PWMServoDriver.setPWM(IOpin + 1, 0, 4096);
}
else
{
// off
PWMServoDriver.setPWM(IOpin, 0, 4096);
PWMServoDriver.setPWM(IOpin, 0, 4096);
PWMServoDriver.setPWM(IOpin + 1, 4096, 0);
}
RelayStatus[i] = BitState;
Expand Down Expand Up @@ -199,7 +199,7 @@ void CheckRelays()
if (j < 1) Rlys = NewLo; else Rlys = NewHi;
for (int i = 0; i < 8; i++)
{
if (MDL.RelayPins[i + j * 8] < NC) // check if relay is enabled
if (MDL.RelayPins[i + j * 8] > 1) // check if relay is enabled
{
if (bitRead(Rlys, i)) digitalWrite(MDL.RelayPins[i + j * 8], MDL.RelayOnSignal); else digitalWrite(MDL.RelayPins[i + j * 8], !MDL.RelayOnSignal);
}
Expand Down

0 comments on commit f8a2588

Please sign in to comment.