Skip to content

Commit

Permalink
change esp and nano averaging
Browse files Browse the repository at this point in the history
  • Loading branch information
SK21 committed Aug 10, 2024
1 parent c39d076 commit a426cd4
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Modules/ESP32 Rate/RC_ESP32/RC_ESP32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
#include <EthernetUdp.h>

// rate control with ESP32 board: DOIT ESP32 DEVKIT V1
# define InoDescription "RC_ESP32 : 01-Jul-2024"
const uint16_t InoID = 1074; // change to send defaults to eeprom, ddmmy, no leading 0
# define InoDescription "RC_ESP32 : 10-Aug-2024"
const uint16_t InoID = 10084; // 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
const uint8_t Processor = 0; // 0 - ESP32-Wroom-32U

Expand Down
2 changes: 1 addition & 1 deletion Modules/ESP32 Rate/RC_ESP32/RC_ESP32.vcxproj

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions Modules/ESP32 Rate/RC_ESP32/Rate.ino
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@

const uint16_t Debounce = 500; // micros
const uint16_t avgPulses = 24;

volatile unsigned long Duration[MaxProductCount];
volatile unsigned long Durations[2][12];
volatile unsigned long Durations[2][avgPulses];
volatile int FilledCount[2];
volatile unsigned long PulseCount[MaxProductCount];

Expand All @@ -15,9 +19,6 @@ double Omin[MaxProductCount];
double Oave[MaxProductCount];
byte Ocount[MaxProductCount];

const uint16_t Debounce = 500; // micros
const uint16_t avgPulses = 12;

void IRAM_ATTR ISR0()
{
static unsigned long PulseTime;
Expand Down
4 changes: 2 additions & 2 deletions Modules/Nano/RCnano/RCnano.ino
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include "PCA95x5_RC.h" // modified from https://github.com/hideakitai/PCA95x5

// rate control with nano
# define InoDescription "RCnano : 01-Jul-2024"
const uint16_t InoID = 1074; // change to send defaults to eeprom, ddmmy, no leading 0
# define InoDescription "RCnano : 10-Aug-2024"
const uint16_t InoID = 10084; // change to send defaults to eeprom, ddmmy, no leading 0
const uint8_t InoType = 2; // 0 - Teensy AutoSteer, 1 - Teensy Rate, 2 - Nano Rate, 3 - Nano SwitchBox, 4 - ESP Rate

#define MaxProductCount 2
Expand Down
2 changes: 1 addition & 1 deletion Modules/Nano/RCnano/RCnano.vcxproj

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions Modules/Nano/RCnano/Rate.ino
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@

const uint16_t Debounce = 500; // micros
const uint16_t avgPulses = 24;

volatile unsigned long Duration[MaxProductCount];
volatile unsigned long Durations[2][12];
volatile unsigned long Durations[2][avgPulses];
volatile int FilledCount[2];
volatile unsigned long PulseCount[MaxProductCount];

Expand All @@ -15,9 +19,6 @@ double Omin[MaxProductCount];
double Oave[MaxProductCount];
byte Ocount[MaxProductCount];

const uint16_t Debounce = 500; // micros
const uint16_t avgPulses = 12;

void ISR0()
{
static unsigned long PulseTime;
Expand Down
2 changes: 1 addition & 1 deletion Modules/Nano/RCnano/__vm/Compile.vmps.xml

Large diffs are not rendered by default.

0 comments on commit a426cd4

Please sign in to comment.