Move HOY_BOOT_FREQ from define to function
This commit is contained in:
parent
58f0121c11
commit
16cd1a90d5
@ -7,8 +7,6 @@
|
|||||||
#include "crc.h"
|
#include "crc.h"
|
||||||
#include <FunctionalInterrupt.h>
|
#include <FunctionalInterrupt.h>
|
||||||
|
|
||||||
#define HOY_BOOT_FREQ 868000000 // Hoymiles boot/init frequency after power up inverter or connection lost for 15 min
|
|
||||||
|
|
||||||
uint32_t HoymilesRadio_CMT::getFrequencyFromChannel(const uint8_t channel) const
|
uint32_t HoymilesRadio_CMT::getFrequencyFromChannel(const uint8_t channel) const
|
||||||
{
|
{
|
||||||
return (_radio->getBaseFrequency() + channel * getChannelWidth());
|
return (_radio->getBaseFrequency() + channel * getChannelWidth());
|
||||||
@ -199,6 +197,12 @@ uint32_t HoymilesRadio_CMT::getChannelWidth()
|
|||||||
return FH_OFFSET * CMT2300A_ONE_STEP_SIZE;
|
return FH_OFFSET * CMT2300A_ONE_STEP_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t HoymilesRadio_CMT::getInvBootFrequency()
|
||||||
|
{
|
||||||
|
// Hoymiles boot/init frequency after power up inverter or connection lost for 15 min
|
||||||
|
return 868000000;
|
||||||
|
}
|
||||||
|
|
||||||
void ARDUINO_ISR_ATTR HoymilesRadio_CMT::handleInt1()
|
void ARDUINO_ISR_ATTR HoymilesRadio_CMT::handleInt1()
|
||||||
{
|
{
|
||||||
_packetSent = true;
|
_packetSent = true;
|
||||||
@ -218,7 +222,7 @@ void HoymilesRadio_CMT::sendEsbPacket(CommandAbstract& cmd)
|
|||||||
_radio->stopListening();
|
_radio->stopListening();
|
||||||
|
|
||||||
if (cmd.getDataPayload()[0] == 0x56) { // @todo(tbnobody) Bad hack to identify ChannelChange Command
|
if (cmd.getDataPayload()[0] == 0x56) { // @todo(tbnobody) Bad hack to identify ChannelChange Command
|
||||||
cmtSwitchDtuFreq(HOY_BOOT_FREQ);
|
cmtSwitchDtuFreq(getInvBootFrequency());
|
||||||
}
|
}
|
||||||
|
|
||||||
Hoymiles.getMessageOutput()->printf("TX %s %.2f MHz --> ",
|
Hoymiles.getMessageOutput()->printf("TX %s %.2f MHz --> ",
|
||||||
|
|||||||
@ -30,6 +30,8 @@ public:
|
|||||||
uint32_t getMaxFrequency() const;
|
uint32_t getMaxFrequency() const;
|
||||||
static uint32_t getChannelWidth();
|
static uint32_t getChannelWidth();
|
||||||
|
|
||||||
|
static uint32_t getInvBootFrequency();
|
||||||
|
|
||||||
uint32_t getFrequencyFromChannel(const uint8_t channel) const;
|
uint32_t getFrequencyFromChannel(const uint8_t channel) const;
|
||||||
uint8_t getChannelFromFrequency(const uint32_t frequency) const;
|
uint8_t getChannelFromFrequency(const uint32_t frequency) const;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user