Browse Source

0.8.153

* added update warning once 0.9.x should be installed -> not possible using OTA because of changed partition layout
* improved CMT communication
development03
Lukas Pusch 2 weeks ago
parent
commit
5120aa473b
  1. 4
      src/CHANGES.md
  2. 2
      src/defines.h
  3. 29
      src/hms/cmt2300a.h
  4. 20
      src/web/html/update.html
  5. 5
      src/web/lang.json

4
src/CHANGES.md

@ -1,5 +1,9 @@
# Development Changes
## 0.8.153 - 2025-03-05
* added update warning once 0.9.x should be installed -> not possible using OTA because of changed partition layout
* improved CMT communication
## 0.8.152 - 2024-10-07
* patching MqTT library to prevent raise conditions while using semaphores
* update ESP32 espressif platform to `0.6.9`

2
src/defines.h

@ -13,7 +13,7 @@
//-------------------------------------
#define VERSION_MAJOR 0
#define VERSION_MINOR 8
#define VERSION_PATCH 152
#define VERSION_PATCH 153
//-------------------------------------
typedef struct {
uint8_t ch;

29
src/hms/cmt2300a.h

@ -168,8 +168,13 @@ enum class CmtStatus : uint8_t {
#define CMT2300A_MASK_PKT_OK_FLG 0x01
class Cmt2300a {
private: /*types*/
static constexpr uint8_t CmtTimeoutMs = 40;
public:
Cmt2300a() {}
Cmt2300a()
: lastMillis {0}
{}
void setup(uint8_t pinSclk, uint8_t pinSdio, uint8_t pinCsb, uint8_t pinFcsb) {
mSpi.init(pinSdio, pinSclk, pinCsb, pinFcsb);
@ -182,6 +187,7 @@ class Cmt2300a {
if(CMT2300A_MASK_TX_DONE_FLG == mSpi.readReg(CMT2300A_CUS_INT_CLR1)) {
if(cmtSwitchStatus(CMT2300A_GO_STBY, CMT2300A_STA_STBY)) {
mTxPending = false;
lastMillis = 0;
goRx();
}
}
@ -226,9 +232,6 @@ class Cmt2300a {
}
CmtStatus getRx(uint8_t buf[], uint8_t *rxLen, uint8_t maxlen, int8_t *rssi) {
if(mTxPending)
return CmtStatus::ERR_TX_PENDING;
if(0x1b != (mSpi.readReg(CMT2300A_CUS_INT_FLAG) & 0x1b))
return CmtStatus::FIFO_EMPTY;
@ -252,8 +255,19 @@ class Cmt2300a {
}
CmtStatus tx(uint8_t buf[], uint8_t len) {
if(mTxPending)
return CmtStatus::ERR_TX_PENDING;
if(mTxPending) {
if(CmtTimeoutMs < (millis() - lastMillis)) {
DPRINT(DBG_ERROR, "CMT, last TX timeout: ");
DBGPRINT(String(millis() - lastMillis));
DBGPRINTLN("ms");
}
while(mTxPending && (CmtTimeoutMs > (millis() - lastMillis))) {
vTaskDelay(10);
}
mTxPending = false;
goRx();
}
if(mInRxMode) {
mInRxMode = false;
@ -284,6 +298,7 @@ class Cmt2300a {
if(!cmtSwitchStatus(CMT2300A_GO_TX, CMT2300A_STA_TX))
return CmtStatus::ERR_SWITCH_STATE;
lastMillis = millis();
// wait for tx done
mTxPending = true;
@ -560,6 +575,8 @@ class Cmt2300a {
uint8_t mCusIntFlag = 0;
uint8_t mRqstCh = 0, mCurCh = 0;
RegionCfg mRegionCfg = RegionCfg::EUROPE;
uint32_t lastMillis;
};
#endif /*__CMT2300A_H__*/

20
src/web/html/update.html

@ -50,7 +50,9 @@
}
function hide() {
var bin = document.getElementsByName("update")[0].value.slice(-env.length-4, -4)
let fw = document.getElementsByName("update")[0].value
var bin = fw.slice(-env.length-4, -4)
let ver = fw.split("_")[2].split(".")
if (bin !== env) {
var html = ml("div", {class: "row"}, [
ml("div", {class: "row my-3"}, "{#WARN_DIFF_ENV}"),
@ -60,8 +62,20 @@
])
])
modal("{#UPDATE_MODAL}", html)
} else
start()
} else {
if(ver[1] != "9")
start()
else {
var html = ml("div", {class: "row"}, [
ml("div", {class: "row my-3"}, "{#ERROR_UPGRADE_NOT_POSSIBLE}"),
ml("div", {class: "row"}, [
ml("div", {class: "col-6"}, ml("input", {type: "button", class: "btn", value: "{#CANCEL}", onclick: function() { modalClose(); }}, null))
])
])
modal("{#UPDATE_MODAL}", html)
}
}
}
function start() {

5
src/web/lang.json

@ -1333,6 +1333,11 @@
"en": "your environment may not match the update file!",
"de": "Die ausgew&auml;hlte Firmware passt u.U. nicht zum Chipsatz!"
},
{
"token": "ERROR_UPGRADE_NOT_POSSIBLE",
"en": "OTA updade to version 0.9.x not possible, partition layout changed",
"de": "Aktualisierung auf Version 0.9.x nicht per Update m&ouml;glich (Partition Layout ge&auml;ndert), bitte per Websinstaller neu installieren"
},
{
"token": "CONTIUE",
"en": "continue",

Loading…
Cancel
Save