mirror of
https://github.com/lumapu/ahoy.git
synced 2025-04-28 17:56:21 +02:00
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
This commit is contained in:
parent
78cbd7749d
commit
5120aa473b
5 changed files with 50 additions and 10 deletions
|
@ -1,5 +1,9 @@
|
||||||
# Development Changes
|
# 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
|
## 0.8.152 - 2024-10-07
|
||||||
* patching MqTT library to prevent raise conditions while using semaphores
|
* patching MqTT library to prevent raise conditions while using semaphores
|
||||||
* update ESP32 espressif platform to `0.6.9`
|
* update ESP32 espressif platform to `0.6.9`
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
//-------------------------------------
|
//-------------------------------------
|
||||||
#define VERSION_MAJOR 0
|
#define VERSION_MAJOR 0
|
||||||
#define VERSION_MINOR 8
|
#define VERSION_MINOR 8
|
||||||
#define VERSION_PATCH 152
|
#define VERSION_PATCH 153
|
||||||
//-------------------------------------
|
//-------------------------------------
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint8_t ch;
|
uint8_t ch;
|
||||||
|
|
|
@ -168,8 +168,13 @@ enum class CmtStatus : uint8_t {
|
||||||
#define CMT2300A_MASK_PKT_OK_FLG 0x01
|
#define CMT2300A_MASK_PKT_OK_FLG 0x01
|
||||||
|
|
||||||
class Cmt2300a {
|
class Cmt2300a {
|
||||||
|
private: /*types*/
|
||||||
|
static constexpr uint8_t CmtTimeoutMs = 40;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Cmt2300a() {}
|
Cmt2300a()
|
||||||
|
: lastMillis {0}
|
||||||
|
{}
|
||||||
|
|
||||||
void setup(uint8_t pinSclk, uint8_t pinSdio, uint8_t pinCsb, uint8_t pinFcsb) {
|
void setup(uint8_t pinSclk, uint8_t pinSdio, uint8_t pinCsb, uint8_t pinFcsb) {
|
||||||
mSpi.init(pinSdio, pinSclk, pinCsb, 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(CMT2300A_MASK_TX_DONE_FLG == mSpi.readReg(CMT2300A_CUS_INT_CLR1)) {
|
||||||
if(cmtSwitchStatus(CMT2300A_GO_STBY, CMT2300A_STA_STBY)) {
|
if(cmtSwitchStatus(CMT2300A_GO_STBY, CMT2300A_STA_STBY)) {
|
||||||
mTxPending = false;
|
mTxPending = false;
|
||||||
|
lastMillis = 0;
|
||||||
goRx();
|
goRx();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -226,9 +232,6 @@ class Cmt2300a {
|
||||||
}
|
}
|
||||||
|
|
||||||
CmtStatus getRx(uint8_t buf[], uint8_t *rxLen, uint8_t maxlen, int8_t *rssi) {
|
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))
|
if(0x1b != (mSpi.readReg(CMT2300A_CUS_INT_FLAG) & 0x1b))
|
||||||
return CmtStatus::FIFO_EMPTY;
|
return CmtStatus::FIFO_EMPTY;
|
||||||
|
|
||||||
|
@ -252,8 +255,19 @@ class Cmt2300a {
|
||||||
}
|
}
|
||||||
|
|
||||||
CmtStatus tx(uint8_t buf[], uint8_t len) {
|
CmtStatus tx(uint8_t buf[], uint8_t len) {
|
||||||
if(mTxPending)
|
if(mTxPending) {
|
||||||
return CmtStatus::ERR_TX_PENDING;
|
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) {
|
if(mInRxMode) {
|
||||||
mInRxMode = false;
|
mInRxMode = false;
|
||||||
|
@ -284,6 +298,7 @@ class Cmt2300a {
|
||||||
|
|
||||||
if(!cmtSwitchStatus(CMT2300A_GO_TX, CMT2300A_STA_TX))
|
if(!cmtSwitchStatus(CMT2300A_GO_TX, CMT2300A_STA_TX))
|
||||||
return CmtStatus::ERR_SWITCH_STATE;
|
return CmtStatus::ERR_SWITCH_STATE;
|
||||||
|
lastMillis = millis();
|
||||||
|
|
||||||
// wait for tx done
|
// wait for tx done
|
||||||
mTxPending = true;
|
mTxPending = true;
|
||||||
|
@ -560,6 +575,8 @@ class Cmt2300a {
|
||||||
uint8_t mCusIntFlag = 0;
|
uint8_t mCusIntFlag = 0;
|
||||||
uint8_t mRqstCh = 0, mCurCh = 0;
|
uint8_t mRqstCh = 0, mCurCh = 0;
|
||||||
RegionCfg mRegionCfg = RegionCfg::EUROPE;
|
RegionCfg mRegionCfg = RegionCfg::EUROPE;
|
||||||
|
|
||||||
|
uint32_t lastMillis;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /*__CMT2300A_H__*/
|
#endif /*__CMT2300A_H__*/
|
||||||
|
|
|
@ -50,7 +50,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function hide() {
|
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) {
|
if (bin !== env) {
|
||||||
var html = ml("div", {class: "row"}, [
|
var html = ml("div", {class: "row"}, [
|
||||||
ml("div", {class: "row my-3"}, "{#WARN_DIFF_ENV}"),
|
ml("div", {class: "row my-3"}, "{#WARN_DIFF_ENV}"),
|
||||||
|
@ -60,8 +62,20 @@
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
modal("{#UPDATE_MODAL}", html)
|
modal("{#UPDATE_MODAL}", html)
|
||||||
} else
|
} else {
|
||||||
|
if(ver[1] != "9")
|
||||||
start()
|
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() {
|
function start() {
|
||||||
|
|
|
@ -1333,6 +1333,11 @@
|
||||||
"en": "your environment may not match the update file!",
|
"en": "your environment may not match the update file!",
|
||||||
"de": "Die ausgewählte Firmware passt u.U. nicht zum Chipsatz!"
|
"de": "Die ausgewä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öglich (Partition Layout geändert), bitte per Websinstaller neu installieren"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"token": "CONTIUE",
|
"token": "CONTIUE",
|
||||||
"en": "continue",
|
"en": "continue",
|
||||||
|
|
Loading…
Add table
Reference in a new issue