Skip to content

Commit

Permalink
define pin not connected
Browse files Browse the repository at this point in the history
  • Loading branch information
AgHardware committed Jan 26, 2024
1 parent 3fb47ac commit 8486cf2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions Modules/Teensy Rate/RCteensy/RCteensy.ino
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
#include <Adafruit_SPIDevice.h>

// rate control with Teensy 4.1
# define InoDescription "RCteensy : 09-Jan-2024"
const uint16_t InoID = 9014; // change to send defaults to eeprom, ddmmy, no leading 0
# define InoDescription "RCteensy : 25-Jan-2024"
const uint16_t InoID = 25014; // change to send defaults to eeprom, ddmmy, no leading 0
const uint8_t InoType = 1; // 0 - Teensy AutoSteer, 1 - Teensy Rate, 2 - Nano Rate, 3 - Nano SwitchBox, 4 - ESP Rate

#define MaxReadBuffer 100 // bytes
#define MaxProductCount 2
#define NC 0xFF // Pin are not connected

struct ModuleConfig
{
Expand All @@ -35,7 +36,7 @@ struct ModuleConfig
uint8_t IP3 = 60;
uint8_t RelayControl = 5; // 0 - no relays, 1 - RS485, 2 - PCA9555 8 relays, 3 - PCA9555 16 relays, 4 - MCP23017, 5 - Teensy GPIO
uint8_t ESPserialPort = 1; // serial port to connect to wifi module
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
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
};

ModuleConfig MDL;
Expand Down
2 changes: 1 addition & 1 deletion Modules/Teensy Rate/RCteensy/RCteensy.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
<CLanguageStandard>gnu11</CLanguageStandard>
<CAdditionalWarning />
<CppAdditionalWarning />
<ForcedIncludeFiles>$(ProjectDir)..\..\..\..\..\..\..\..\..\program files\microsoft visual studio\2022\community\common7\ide\extensions\k5efmrr3.kil\Micro Platforms\default\vm-intelli-pre.h;$(ProjectDir)..\..\..\..\..\..\..\AppData\Local\Temp\VMBuilds\RCteensy\teensy41\Release\.vmintelli\2be9fd39c8b35a25180fc6dbc3d07884\vm-intelli-gcc-defines.h;$(ProjectDir)..\..\..\..\..\..\..\..\..\program files\microsoft visual studio\2022\community\common7\ide\extensions\k5efmrr3.kil\Micro Platforms\default\vm-intelli-post.h;$(ProjectDir)__vm\.RCteensy.vsarduino.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
<ForcedIncludeFiles>$(ProjectDir)..\..\..\..\..\..\..\..\..\program files\microsoft visual studio\2022\community\common7\ide\extensions\osqpjdds.xje\Micro Platforms\default\vm-intelli-pre.h;$(ProjectDir)..\..\..\..\..\..\..\AppData\Local\Temp\VMBuilds\RCteensy\teensy41\Release\.vmintelli\4e03964cb693f7bd0cccd297cb53f368\vm-intelli-gcc-defines.h;$(ProjectDir)..\..\..\..\..\..\..\..\..\program files\microsoft visual studio\2022\community\common7\ide\extensions\osqpjdds.xje\Micro Platforms\default\vm-intelli-post.h;$(ProjectDir)__vm\.RCteensy.vsarduino.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
<UndefineAllPreprocessorDefinitions>true</UndefineAllPreprocessorDefinitions>
<IgnoreStandardIncludePath>true</IgnoreStandardIncludePath>
<PreprocessorDefinitions>_VMICRO_INTELLISENSE;__HARDWARE_imxrt1062__;__HARDWARE_IMXRT1062__;__IMXRT1062__;TEENSYDUINO=156;ARDUINO=108019;ARDUINO_TEENSY41;F_CPU=600000000;USB_SERIAL;LAYOUT_US_ENGLISH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand Down
2 changes: 1 addition & 1 deletion Modules/Teensy Rate/RCteensy/Relays.ino
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ void CheckRelays()
if (j < 1) Rlys = NewLo; else Rlys = NewHi;
for (int i = 0; i < 8; i++)
{
if (MDL.RelayPins[i + j * 8] > 1) // check if relay is enabled
if (MDL.RelayPins[i + j * 8] < NC) // 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 8486cf2

Please sign in to comment.