Fix: Offset cache for "YieldDay" did not work correctly
This commit is contained in:
parent
fbc39ef742
commit
8798ca5a13
@ -82,8 +82,6 @@ void StatisticsParser::clearBuffer()
|
|||||||
{
|
{
|
||||||
memset(_payloadStatistic, 0, STATISTIC_PACKET_SIZE);
|
memset(_payloadStatistic, 0, STATISTIC_PACKET_SIZE);
|
||||||
_statisticLength = 0;
|
_statisticLength = 0;
|
||||||
|
|
||||||
memset(_lastYieldDay, 0, sizeof(_lastYieldDay));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void StatisticsParser::appendFragment(const uint8_t offset, const uint8_t* payload, const uint8_t len)
|
void StatisticsParser::appendFragment(const uint8_t offset, const uint8_t* payload, const uint8_t len)
|
||||||
@ -111,8 +109,7 @@ void StatisticsParser::endAppendFragment()
|
|||||||
// currently all values are zero --> Add last known values to offset
|
// currently all values are zero --> Add last known values to offset
|
||||||
Hoymiles.getMessageOutput()->printf("Yield Day reset detected!\r\n");
|
Hoymiles.getMessageOutput()->printf("Yield Day reset detected!\r\n");
|
||||||
|
|
||||||
setChannelFieldOffset(TYPE_DC, c, FLD_YD,
|
setChannelFieldOffset(TYPE_DC, c, FLD_YD, _lastYieldDay[static_cast<uint8_t>(c)]);
|
||||||
getChannelFieldOffset(TYPE_DC, c, FLD_YD) + _lastYieldDay[static_cast<uint8_t>(c)]);
|
|
||||||
|
|
||||||
_lastYieldDay[static_cast<uint8_t>(c)] = 0;
|
_lastYieldDay[static_cast<uint8_t>(c)] = 0;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -168,5 +168,5 @@ private:
|
|||||||
uint32_t _lastUpdateFromInternal = 0;
|
uint32_t _lastUpdateFromInternal = 0;
|
||||||
|
|
||||||
bool _enableYieldDayCorrection = false;
|
bool _enableYieldDayCorrection = false;
|
||||||
float _lastYieldDay[CH_CNT];
|
float _lastYieldDay[CH_CNT] = {};
|
||||||
};
|
};
|
||||||
Loading…
Reference in New Issue
Block a user