Merge branch 'NewHC05Changes_433Mhz' into BlueDigitLCD
Conflicts resolved: src/Afterburner.cpp src/Bluetooth/BluetoothHC05.cpp src/OLED/433MHzScreen.cpp src/OLED/433MHzScreen.h src/Protocol/BlueWireTask.cpp src/Protocol/TxManage.cpp
This commit is contained in:
commit
aa90c83a06
|
@ -25,10 +25,11 @@ extern void forceBootInit();
|
||||||
#define USE_QUEUE
|
#define USE_QUEUE
|
||||||
|
|
||||||
|
|
||||||
esp32FOTA::esp32FOTA(String firwmareType, int firwmareVersion)
|
esp32FOTA::esp32FOTA(String firwmareType, int firwmareVersion, bool isBeta)
|
||||||
{
|
{
|
||||||
_firwmareType = firwmareType;
|
_firwmareType = firwmareType;
|
||||||
_firwmareVersion = firwmareVersion;
|
_firwmareVersion = firwmareVersion;
|
||||||
|
_bIsBeta = isBeta;
|
||||||
useDeviceID = false;
|
useDeviceID = false;
|
||||||
// _endCallback = NULL;
|
// _endCallback = NULL;
|
||||||
_queue = xQueueCreate(1, 256);
|
_queue = xQueueCreate(1, 256);
|
||||||
|
@ -254,6 +255,7 @@ esp32FOTA::execHTTPcheck()
|
||||||
delete[] JSONMessage;
|
delete[] JSONMessage;
|
||||||
Serial.println("Parsing failed");
|
Serial.println("Parsing failed");
|
||||||
delay(5000);
|
delay(5000);
|
||||||
|
http.end(); //Free the resources
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,23 +275,32 @@ esp32FOTA::execHTTPcheck()
|
||||||
|
|
||||||
delete[] JSONMessage;
|
delete[] JSONMessage;
|
||||||
|
|
||||||
if (plversion > _firwmareVersion && fwtype == _firwmareType)
|
if(fwtype == _firwmareType) {
|
||||||
|
if(_bIsBeta) { // if beta version being used, check for equal version number
|
||||||
|
if (plversion >= _firwmareVersion)
|
||||||
{
|
{
|
||||||
_newVersion = plversion;
|
_newVersion = plversion;
|
||||||
|
http.end(); //Free the resources
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
_newVersion = 0;
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
if (plversion > _firwmareVersion)
|
||||||
|
{
|
||||||
|
_newVersion = plversion;
|
||||||
|
http.end(); //Free the resources
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_newVersion = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Serial.println("Error on HTTP request");
|
Serial.println("Error on HTTP request");
|
||||||
return false;
|
// return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
http.end(); //Free the resources
|
http.end(); //Free the resources
|
||||||
|
@ -454,16 +465,25 @@ esp32FOTA::decodeResponse(char* resp)
|
||||||
_bin = plbin;
|
_bin = plbin;
|
||||||
|
|
||||||
|
|
||||||
if (plversion > _firwmareVersion && fwtype == _firwmareType)
|
if(fwtype == _firwmareType) {
|
||||||
|
if(_bIsBeta) { // if beta version being used, check for equal version number
|
||||||
|
if (plversion >= _firwmareVersion)
|
||||||
{
|
{
|
||||||
_newVersion = plversion;
|
_newVersion = plversion;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
else {
|
||||||
|
if (plversion > _firwmareVersion)
|
||||||
{
|
{
|
||||||
|
_newVersion = plversion;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
_newVersion = 0;
|
_newVersion = 0;
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -26,7 +26,7 @@ struct sFOTAqueue{
|
||||||
class esp32FOTA
|
class esp32FOTA
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
esp32FOTA(String firwmareType, int firwmareVersion);
|
esp32FOTA(String firwmareType, int firwmareVersion, bool isBeta);
|
||||||
void execOTA();
|
void execOTA();
|
||||||
bool execHTTPcheck();
|
bool execHTTPcheck();
|
||||||
bool useDeviceID;
|
bool useDeviceID;
|
||||||
|
@ -50,6 +50,7 @@ private:
|
||||||
String _firwmareType;
|
String _firwmareType;
|
||||||
int _firwmareVersion;
|
int _firwmareVersion;
|
||||||
int _newVersion;
|
int _newVersion;
|
||||||
|
bool _bIsBeta;
|
||||||
String _checkURL;
|
String _checkURL;
|
||||||
String _host;
|
String _host;
|
||||||
String _bin;
|
String _bin;
|
||||||
|
|
|
@ -135,7 +135,7 @@
|
||||||
const int FirmwareRevision = 40;
|
const int FirmwareRevision = 40;
|
||||||
const int FirmwareSubRevision = 0;
|
const int FirmwareSubRevision = 0;
|
||||||
const int FirmwareMinorRevision = 1;
|
const int FirmwareMinorRevision = 1;
|
||||||
const char* FirmwareDate = "22 May 2020";
|
const char* FirmwareDate = "19 Jun 2020";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Macro to check the outputs of TWDT functions and trigger an abort if an
|
* Macro to check the outputs of TWDT functions and trigger an abort if an
|
||||||
|
@ -1203,8 +1203,11 @@ bool getGPIOout(int channel)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
float getVersion()
|
float getVersion(bool betarevision)
|
||||||
{
|
{
|
||||||
|
if(betarevision)
|
||||||
|
return float(FirmwareMinorRevision);
|
||||||
|
else
|
||||||
return float(FirmwareRevision) * 0.1f + float(FirmwareSubRevision) * .001f;
|
return float(FirmwareRevision) * 0.1f + float(FirmwareSubRevision) * .001f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1499,12 +1502,12 @@ void reqHeaterCalUpdate()
|
||||||
// return BlueWireData;
|
// return BlueWireData;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
int UHFsubcode(int val)
|
// int UHFsubcode(int val)
|
||||||
{
|
// {
|
||||||
val &= 0x03;
|
// val &= 0x03;
|
||||||
val = 0x0001 << val;
|
// val = 0x0001 << val;
|
||||||
return val;
|
// return val;
|
||||||
}
|
// }
|
||||||
|
|
||||||
void checkUHF()
|
void checkUHF()
|
||||||
{
|
{
|
||||||
|
|
|
@ -128,6 +128,7 @@ CBluetoothHC05::begin()
|
||||||
}
|
}
|
||||||
|
|
||||||
DebugPort.print(" Setting baud rate to 9600N81...");
|
DebugPort.print(" Setting baud rate to 9600N81...");
|
||||||
|
//if(!ATCommand("AT+UART=9600,1,0\r\n")) {
|
||||||
if(!ATCommand("AT+UART=38400,1,0\r\n")) {
|
if(!ATCommand("AT+UART=38400,1,0\r\n")) {
|
||||||
DebugPort.println("FAILED");
|
DebugPort.println("FAILED");
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,26 +157,22 @@ CVersionInfoScreen::animate()
|
||||||
// show ascending up arrow if firmware update is available on web server
|
// show ascending up arrow if firmware update is available on web server
|
||||||
_animateCount++;
|
_animateCount++;
|
||||||
WRAPUPPERLIMIT(_animateCount, 3, 0);
|
WRAPUPPERLIMIT(_animateCount, 3, 0);
|
||||||
/* int ypos = 11 + 16 - 7 - _animateCount;
|
|
||||||
_display.fillRect(0, 11, 10, 21, BLACK);
|
|
||||||
_display.drawBitmap(2, ypos, WifiOutIconInfo.pBitmap, WifiOutIconInfo.width, 7, WHITE); // upload arrow - from web to afterburner
|
|
||||||
_display.fillRect(1, 12, 7, 2, WHITE); // top bar
|
|
||||||
_drawBitmap(0, 11+17, WWWIconInfo); // www icon*/
|
|
||||||
|
|
||||||
int newVer = isUpdateAvailable();
|
int newVer = isUpdateAvailable();
|
||||||
if((_animateCount & 0x02) && newVer) {
|
if((_animateCount & 0x02) && newVer) {
|
||||||
|
_display.setTextColor(WHITE);
|
||||||
|
_drawBitmap(118, 24, UpdateIconInfo);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_display.setTextColor(BLACK);
|
||||||
|
_display.fillRect(118, 24, 9, 10, BLACK);
|
||||||
|
}
|
||||||
char msg[32];
|
char msg[32];
|
||||||
int major = (int)(newVer * 0.01);
|
int major = (int)(newVer * 0.01);
|
||||||
int minor = newVer - major*100;
|
int minor = newVer - major*100;
|
||||||
float prtMajor = major * 0.1;
|
float prtMajor = major * 0.1;
|
||||||
sprintf(msg, "V%.1f.%d", prtMajor, minor);
|
sprintf(msg, "V%.1f.%d", prtMajor, minor);
|
||||||
_printMenuText(128, 15, msg, false, eRightJustify);
|
_printMenuText(128, 15, msg, false, eRightJustify);
|
||||||
_drawBitmap(118, 24, UpdateIconInfo);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
_display.fillRect(82, 15, 46, 7, BLACK);
|
|
||||||
_display.fillRect(118, 24, 9, 10, BLACK);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,7 +173,7 @@ CTxManage::PrepareFrame(const CProtocol& basisFrame, bool isBTCmaster)
|
||||||
|
|
||||||
float altitude;
|
float altitude;
|
||||||
if(getTempSensor().getAltitude(altitude)) { // if a BME280 is fitted
|
if(getTempSensor().getAltitude(altitude)) { // if a BME280 is fitted
|
||||||
// use calcualted height
|
// use calculated height
|
||||||
// set 0xeb 0x47 in "unknown bytes"
|
// set 0xeb 0x47 in "unknown bytes"
|
||||||
// - 0xeb happens with all pressure quipped units
|
// - 0xeb happens with all pressure quipped units
|
||||||
// - 0x47 with all other than coffee pod which sends 0x00?
|
// - 0x47 with all other than coffee pod which sends 0x00?
|
||||||
|
|
|
@ -49,7 +49,7 @@ extern bool hasHtrData();
|
||||||
extern int getBlueWireStat();
|
extern int getBlueWireStat();
|
||||||
extern int getSmartError();
|
extern int getSmartError();
|
||||||
extern bool isCyclicStopStartActive();
|
extern bool isCyclicStopStartActive();
|
||||||
extern float getVersion();
|
extern float getVersion(bool betarevision = false);
|
||||||
const char* getVersionStr(bool beta=false);
|
const char* getVersionStr(bool beta=false);
|
||||||
extern const char* getVersionDate();
|
extern const char* getVersionDate();
|
||||||
extern int getBoardRevision();
|
extern int getBoardRevision();
|
||||||
|
|
|
@ -38,7 +38,7 @@ bool CheckFirmwareCRC(int filesize);
|
||||||
void onSuccess();
|
void onSuccess();
|
||||||
void onWebProgress(size_t progress, size_t total);
|
void onWebProgress(size_t progress, size_t total);
|
||||||
|
|
||||||
esp32FOTA FOTA("afterburner-fota-http", int(getVersion()*1000));
|
esp32FOTA FOTA("afterburner-fota-http", int(getVersion()*1000), getVersion(true) != 0 ? true : false);
|
||||||
unsigned long FOTAtime = millis() + 60000; // initial check in a minutes time
|
unsigned long FOTAtime = millis() + 60000; // initial check in a minutes time
|
||||||
int FOTAauth = 0;
|
int FOTAauth = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue