Introduce several const statements

This commit is contained in:
Thomas Basler
2023-12-07 15:19:04 +01:00
parent e0c07b9bcf
commit 8b5d406a4f
13 changed files with 37 additions and 41 deletions

View File

@@ -216,13 +216,13 @@ void AlarmLogParser::setMessageType(AlarmMessageType_t type)
void AlarmLogParser::getLogEntry(uint8_t entryId, AlarmLogEntry_t* entry, AlarmMessageLocale_t locale)
{
uint8_t entryStartOffset = 2 + entryId * ALARM_LOG_ENTRY_SIZE;
const uint8_t entryStartOffset = 2 + entryId * ALARM_LOG_ENTRY_SIZE;
int timezoneOffset = getTimezoneOffset();
const int timezoneOffset = getTimezoneOffset();
HOY_SEMAPHORE_TAKE();
uint32_t wcode = (uint16_t)_payloadAlarmLog[entryStartOffset] << 8 | _payloadAlarmLog[entryStartOffset + 1];
const uint32_t wcode = (uint16_t)_payloadAlarmLog[entryStartOffset] << 8 | _payloadAlarmLog[entryStartOffset + 1];
uint32_t startTimeOffset = 0;
if (((wcode >> 13) & 0x01) == 1) {
startTimeOffset = 12 * 60 * 60;