add activity > inactivity control

This commit is contained in:
YunHorn Technology 2022-11-03 16:00:42 +08:00
parent fccaaf7b45
commit 182d15680c
2 changed files with 4 additions and 1 deletions

View File

@ -213,7 +213,7 @@
#ifdef YUNHORN_STS_M7_ENABLED #ifdef YUNHORN_STS_M7_ENABLED
#define MajorVer 22U #define MajorVer 22U
#define MinorVer 11U #define MinorVer 11U
#define SubMinorVer 02U #define SubMinorVer 03U
#define FirmwareVersion 3U #define FirmwareVersion 3U
#define YUNHORN_STS_M7_NVM_CFG_SIZE 3U #define YUNHORN_STS_M7_NVM_CFG_SIZE 3U
#define YUNHORN_STS_M7_CFG_CMD_SIZE 9U #define YUNHORN_STS_M7_CFG_CMD_SIZE 9U

View File

@ -774,6 +774,9 @@ void USER_APP_AUTO_RESPONDER_Parse(char *tlv_buf, size_t tlv_buf_size)
inact_threshold += (tlv_buf[i++]-0x30); // "P 1 0 0 8 0 4" -> 0*10 + 4 inact_threshold += (tlv_buf[i++]-0x30); // "P 1 0 0 8 0 4" -> 0*10 + 4
inact_duration = (uint8_t) (tlv_buf[i++]-0x30)*10; // "P 1 0 0 8 0 4 0 3" -> 0*10 inact_duration = (uint8_t) (tlv_buf[i++]-0x30)*10; // "P 1 0 0 8 0 4 0 3" -> 0*10
inact_duration += (uint8_t) (tlv_buf[i++]-0x30); // "P 1 0 0 8 0 4 0 3" -> 0*10+3 inact_duration += (uint8_t) (tlv_buf[i++]-0x30); // "P 1 0 0 8 0 4 0 3" -> 0*10+3
if (act_threshold <= inact_threshold)
act_threshold += 2;
} }
STS_MOTION_SENSOR_ACT_INACT_DURATION_Init(); STS_MOTION_SENSOR_ACT_INACT_DURATION_Init();