Dig Only V3 PCB, Fixed Hz setting reporting bug fix

This commit is contained in:
Ray Jones 2019-09-25 19:38:19 +10:00
parent d30536e939
commit af34331401
5 changed files with 18 additions and 15 deletions

View file

@ -1119,10 +1119,10 @@ float getTemperatureDesired()
return getHeaterInfo().getHeaterDemand();
}
else {
// if(getThermostatModeActive())
if(getThermostatModeActive())
return RTC_Store.getDesiredTemp();
// else
// return RTC_Store.getDesiredPump();
else
return RTC_Store.getDesiredPump();
}
}
@ -1497,7 +1497,7 @@ bool isCyclicActive()
void setupGPIO()
{
if(BoardRevision == 10 || BoardRevision == 20 || BoardRevision == 21) {
if(BoardRevision == 10 || BoardRevision == 20 || BoardRevision == 21 || BoardRevision == 30) {
// some special considerations for GPIO inputs, depending upon PCB hardware
// V1.0 PCBs only expose bare inputs, which are pulled high. Active state into ESP32 is LOW.
// V2.0+ PCBs use an input transistor buffer. Active state into ESP32 is HIGH (inverted).

View file

@ -302,7 +302,7 @@ CGPIOSetupScreen::keyHandler(uint8_t event)
_rowSel--;
if((_rowSel == 3) && (_GPIOparams.in2Mode != CGPIOin2::Thermostat))
_rowSel--; // force skip if not set to external thermostat
if((_rowSel == 1) && (getBoardRevision() == BRD_V2_GPIO_NOALG)) // GPIO but NO analog support
if((_rowSel == 1) && ((getBoardRevision() == BRD_V2_GPIO_NOALG) || (getBoardRevision() == BRD_V3_GPIO_NOALG))) // GPIO but NO analog support
_rowSel--; // force skip if analog input is not supported by PCB
LOWERLIMIT(_rowSel, 0);
}
@ -311,7 +311,7 @@ CGPIOSetupScreen::keyHandler(uint8_t event)
if(event & key_Up) {
switch(_rowSel) {
case 0:
if(getBoardRevision() == BRD_V2_GPIO_NOALG) // GPIO but NO Analog support
if((getBoardRevision() == BRD_V2_GPIO_NOALG) || (getBoardRevision() == BRD_V3_GPIO_NOALG)) // GPIO but NO Analog support
_rowSel++; // force skip if analog input is not supported by PCB
case 1:
case 2:

View file

@ -87,7 +87,7 @@ CVersionInfoScreen::show()
_drawBitmap(18, 34, HardwareIconInfo);
int PCB = getBoardRevision();
_printMenuText(41, 38, getBoardRevisionString(PCB));
if(PCB == BRD_V2_GPIO_NOALG) {
if(PCB == BRD_V2_GPIO_NOALG || PCB == BRD_V3_GPIO_NOALG) {
_display.fillRect(70, 36, 57, 11, WHITE);
_printInverted(99, 38, "No Analog", true, eCentreJustify);
}

View file

@ -52,11 +52,12 @@
// Input state truth table
// GPIO25 GPIO26 GPIO33
// ------ ------ ------
// V1.0 HIGH HIGH HIGH
// unmodified V2.0 LOW HIGH LOW
// modified V2.0 LOW LOW HIGH
// V2.1 LOW LOW HIGH
// No GPIO V2.0 HIGH LOW HIGH
// V1.0 HIGH HIGH HIGH - green V1 PCB
// unmodified V2.0 LOW HIGH LOW - digital only (V2 PCB)
// modified V2.0 LOW LOW HIGH - full GPIO (V2 or V3 PCB)
// V2.1 LOW LOW HIGH - digital only (modified V2 PCB)
// No GPIO V2.0 HIGH LOW HIGH - no GPIO (V2 or V3 PCB, 0R in C6)
// V2.1 LOW LOW LOW - digital only (V3 PCB, 0R in C6)
//
//
// ****************************************************************************************
@ -114,10 +115,10 @@ int BoardDetect()
revision = BRD_V2_GPIO_NOALG;
DebugPort.println("Board detect: digital input test reveals V2.0 PCB - Digital only GPIO (V2.1 userID)");
}
// original V2 PCB, no traces cut n shunted, pin 26 grounded via 0R instead of 100n cap, dig inputs pulled low by transistors
// V3 PCB, no traces cut n shunted, pin 26 grounded via 0R instead of 100n cap, dig inputs pulled low by transistors
else if((pin33 == LOW) && (pin26 == LOW) && (pin25 == LOW)) {
revision = BRD_V2_GPIO_NOALG;
DebugPort.println("Board detect: digital input test reveals V2.0 PCB - Digital only GPIO (V2.1 userID)");
revision = BRD_V3_GPIO_NOALG;
DebugPort.println("Board detect: digital input test reveals V3.0 PCB - Digital only GPIO (V2.1 userID)");
}
// original V2 PCB, pin 26 grounded via 0R instead of 100n cap, digio transistors not fitted dig in pins pull high
else if((pin33 == HIGH) && (pin26 == LOW) && (pin25 == HIGH)) {
@ -153,6 +154,7 @@ const char* getBoardRevisionString(int ID)
case BRD_V2_FULLGPIO: return "V2.2";
case BRD_V2_NOGPIO: return "V2.0";
case BRD_V2_GPIO_NOALG: return "V2.1";
case BRD_V3_GPIO_NOALG: return "V2.1";
default: return "???";
}
}

View file

@ -33,6 +33,7 @@
#define BRD_V2_GPIO_NOALG 20 // original V20 board - no cut traces - analog on wrong pin :-(
#define BRD_V2_FULLGPIO 21 // V2 board cut traces tranposed GPIO1 & Analog
#define BRD_V2_NOGPIO 22 // V2 board forced short on analog input - NO GPIO mode
#define BRD_V3_GPIO_NOALG 30 // V3 board - no cut traces - analog input grounded
int BoardDetect();
void BoardRevisionReset();