valid msg

This commit is contained in:
yihaoDeng 2023-12-05 21:04:29 +08:00
parent d4f237d2fe
commit 4cfcbf71ad
1 changed files with 2 additions and 1 deletions

View File

@ -66,7 +66,8 @@ typedef uint16_t tmsg_t;
static inline bool tmsgIsValid(tmsg_t type) {
int8_t maxSegIdx = TMSG_SEG_CODE(TDMT_MAX_MSG);
int segIdx = TMSG_SEG_CODE(type);
int segIdx = TMSG_SEG_CODE(type);
if (segIdx >= 0 && segIdx < maxSegIdx) {
return type < tMsgRangeDict[segIdx];
}