|
|
@ -9,7 +9,7 @@ |
|
|
|
#include "cmt2300a.h" |
|
|
|
#include "../hm/radio.h" |
|
|
|
|
|
|
|
#define CMT_SWITCH_CHANNEL_CYCLE 5 |
|
|
|
//#define CMT_SWITCH_CHANNEL_CYCLE 5
|
|
|
|
|
|
|
|
template<uint32_t DTU_SN = 0x81001765> |
|
|
|
class CmtRadio : public Radio { |
|
|
@ -150,9 +150,9 @@ class CmtRadio : public Radio { |
|
|
|
} |
|
|
|
|
|
|
|
inline void sendSwitchChCmd(Inverter<> *iv, uint8_t ch) { |
|
|
|
if(CMT_SWITCH_CHANNEL_CYCLE > ++mSwitchCycle) |
|
|
|
return; |
|
|
|
mSwitchCycle = 0; |
|
|
|
//if(CMT_SWITCH_CHANNEL_CYCLE > ++mSwitchCycle)
|
|
|
|
// return;
|
|
|
|
//mSwitchCycle = 0;
|
|
|
|
|
|
|
|
/** ch:
|
|
|
|
* 0x00: 860.00 MHz |
|
|
@ -176,7 +176,7 @@ class CmtRadio : public Radio { |
|
|
|
packet_t p; |
|
|
|
p.millis = millis() - mMillis; |
|
|
|
if(CmtStatus::SUCCESS == mCmt.getRx(p.packet, &p.len, 28, &p.rssi)) { |
|
|
|
mSwitchCycle = 0; |
|
|
|
//mSwitchCycle = 0;
|
|
|
|
p.ch = 0; // not used for CMT inverters
|
|
|
|
mBufCtrl.push(p); |
|
|
|
} |
|
|
@ -191,7 +191,7 @@ class CmtRadio : public Radio { |
|
|
|
bool mCmtAvail = false; |
|
|
|
bool mRqstGetRx = false; |
|
|
|
uint32_t mMillis = 0; |
|
|
|
uint8_t mSwitchCycle = 0; |
|
|
|
//uint8_t mSwitchCycle = 0;
|
|
|
|
}; |
|
|
|
|
|
|
|
#endif /*__HMS_RADIO_H__*/ |
|
|
|