Browse Source

fix: set CMT radio type for HMS inverters with 1410 serial and fix duration_reserve index

HMS-1000-2T with a leading 1410 serial (#1845) never got ivRadioType set
(stayed UNKNOWN), so CMT specific handling in Communication.h (frequency
switching, timeouts) was skipped. In addition duration_reserve[] had only
2 entries while it is indexed by the 3 value INV_RADIO_TYPE enum
(UNKNOWN, NRF, CMT), so CMT read out of bounds and NRF/UNKNOWN were shifted.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
pull/1908/head
Claude Code 1 week ago
parent
commit
730e55e6c6
  1. 2
      src/hm/hmDefines.h
  2. 1
      src/hm/hmSystem.h

2
src/hm/hmDefines.h

@ -119,7 +119,7 @@ enum {INV_RADIO_TYPE_UNKNOWN = 0, INV_RADIO_TYPE_NRF, INV_RADIO_TYPE_CMT};
#define DURATION_TXFRAME 85 // timeout parameter for first transmission and first expected frame (time to first channel switch from tx start!) (ms) #define DURATION_TXFRAME 85 // timeout parameter for first transmission and first expected frame (time to first channel switch from tx start!) (ms)
#define DURATION_LISTEN_MIN 5 // time to stay at least on a listening channel (ms) #define DURATION_LISTEN_MIN 5 // time to stay at least on a listening channel (ms)
#define DURATION_PAUSE_LASTFR 45 // how long to pause after last frame (ms) #define DURATION_PAUSE_LASTFR 45 // how long to pause after last frame (ms)
const uint8_t duration_reserve[2] = {65, 115}; const uint8_t duration_reserve[3] = {65, 65, 115}; // index = INV_RADIO_TYPE_(UNKNOWN, NRF, CMT)
#define LIMIT_FAST_IV 85 // time limit to qualify an inverter as very fast answering inverter #define LIMIT_FAST_IV 85 // time limit to qualify an inverter as very fast answering inverter
#define LIMIT_VERYFAST_IV 70 // time limit to qualify an inverter as very fast answering inverter #define LIMIT_VERYFAST_IV 70 // time limit to qualify an inverter as very fast answering inverter

1
src/hm/hmSystem.h

@ -78,6 +78,7 @@ class HmSystem {
iv->ivRadioType = INV_RADIO_TYPE_CMT; iv->ivRadioType = INV_RADIO_TYPE_CMT;
} else if(iv->config->serial.b[5] == 0x14) { } else if(iv->config->serial.b[5] == 0x14) {
iv->ivGen = IV_HMS; iv->ivGen = IV_HMS;
iv->ivRadioType = INV_RADIO_TYPE_CMT;
if(iv->config->serial.b[4] == 0x10) if(iv->config->serial.b[4] == 0x10)
iv->type = INV_TYPE_2CH; iv->type = INV_TYPE_2CH;
} else if(iv->config->serial.u64 != 0ULL) { } else if(iv->config->serial.u64 != 0ULL) {

Loading…
Cancel
Save