Added altitude test manipulation

This commit is contained in:
Ray Jones 2020-06-22 06:18:06 +10:00
parent aa90c83a06
commit 30fae779d9
2 changed files with 31 additions and 10 deletions

View file

@ -227,6 +227,8 @@ bool bHaveWebClient = false;
bool bBTconnected = false;
long BootTime;
extern int altitudeTest;
////////////////////////////////////////////////////////////////////////////////////////////////////////
// Bluetooth instantiation
//
@ -994,6 +996,19 @@ void checkDebugCommands()
bSendVal = true;
}
#endif
else if(rxVal == 'a') {
switch(altitudeTest) {
case 0: altitudeTest = 100; break;
case 100: altitudeTest = 4000; break;
case 4000: altitudeTest = 10000; break;
case 10000: altitudeTest = 20000; break;
case 20000: altitudeTest = 0; break;
}
if(altitudeTest)
DebugPort.printf("Forcing altitude to %d\r\n", altitudeTest);
else
DebugPort.println("Normal altitude control");
}
else if(rxVal == 'b') {
bReportBlueWireData = !bReportBlueWireData;
DebugPort.printf("Toggled raw blue wire data reporting %s\r\n", bReportBlueWireData ? "ON" : "OFF");

View file

@ -50,6 +50,7 @@
unsigned long CTxManage::m_nStartTime = 0;
int CTxManage::m_nTxGatePin = 0;
int altitudeTest = 0;
// Timer callback operates at ISRL
// this means we should avoid any function NOT in IRAM.
@ -171,18 +172,23 @@ CTxManage::PrepareFrame(const CProtocol& basisFrame, bool isBTCmaster)
m_TxFrame.setTemperature_Min(NVstore.getHeaterTuning().Tmin); // Minimum settable temperature
m_TxFrame.setTemperature_Max(NVstore.getHeaterTuning().Tmax); // Maximum settable temperature
float altitude;
if(getTempSensor().getAltitude(altitude)) { // if a BME280 is fitted
// use calculated height
// set 0xeb 0x47 in "unknown bytes"
// - 0xeb happens with all pressure quipped units
// - 0x47 with all other than coffee pod which sends 0x00?
m_TxFrame.setAltitude(altitude, true);
if(altitudeTest) {
m_TxFrame.setAltitude(altitudeTest, true);
}
else {
// default height - yes it is weird, but that's what the simple controllers send!
// set 0x01 0x2c in "unknown bytes" - all no pressure equipped OEM controlelrs do that
m_TxFrame.setAltitude(3500, false);
float altitude;
if(getTempSensor().getAltitude(altitude)) { // if a BME280 is fitted
// use calculated height
// set 0xeb 0x47 in "unknown bytes"
// - 0xeb happens with all pressure quipped units
// - 0x47 with all other than coffee pod which sends 0x00?
m_TxFrame.setAltitude(altitude, true);
}
else {
// default height - yes it is weird, but that's what the simple controllers send!
// set 0x01 0x2c in "unknown bytes" - all no pressure equipped OEM controlelrs do that
m_TxFrame.setAltitude(3500, false);
}
}
m_TxFrame.setPump_Prime(_prime);