@@ -1082,7 +1082,7 @@ ISM6HG256XStatusTypeDef ISM6HG256XSensor::Enable_Wake_Up_Detection(ISM6HG256X_Se
10821082 return ISM6HG256X_ERROR;
10831083 }
10841084 /* Set wake-up threshold */
1085- if (Set_Wake_Up_Threshold (63 ) != ISM6HG256X_OK) {
1085+ if (Set_Wake_Up_Threshold (1 , 3 ) != ISM6HG256X_OK) {
10861086 return ISM6HG256X_ERROR;
10871087 }
10881088 /* Set wake-up durantion */
@@ -1153,7 +1153,7 @@ ISM6HG256XStatusTypeDef ISM6HG256XSensor::Disable_Wake_Up_Detection()
11531153 return ISM6HG256X_ERROR;
11541154 }
11551155 /* Reset wake-up threshold */
1156- if (Set_Wake_Up_Threshold (0 ) != ISM6HG256X_OK) {
1156+ if (Set_Wake_Up_Threshold (0 , 0 ) != ISM6HG256X_OK) {
11571157 return ISM6HG256X_ERROR;
11581158 }
11591159 /* Reset wake-up durantion */
@@ -1167,12 +1167,13 @@ ISM6HG256XStatusTypeDef ISM6HG256XSensor::Disable_Wake_Up_Detection()
11671167* @param Threshold wake up detection threshold
11681168* @retval 0 in case of success, an error code otherwise
11691169*/
1170- ISM6HG256XStatusTypeDef ISM6HG256XSensor::Set_Wake_Up_Threshold (uint32_t Threshold)
1170+ ISM6HG256XStatusTypeDef ISM6HG256XSensor::Set_Wake_Up_Threshold (uint32_t Threshold, uint32_t InactivityThreshold )
11711171{
11721172 ism6hg256x_act_thresholds_t wake_up_ths;
11731173 if (ism6hg256x_act_thresholds_get (®_ctx, &wake_up_ths) != ISM6HG256X_OK) {
11741174 return ISM6HG256X_ERROR;
11751175 }
1176+ wake_up_ths.inactivity_cfg .wu_inact_ths_w = (uint8_t )InactivityThreshold;
11761177 wake_up_ths.threshold = (uint8_t )Threshold;
11771178 if (ism6hg256x_act_thresholds_set (®_ctx, &wake_up_ths) != ISM6HG256X_OK) {
11781179 return ISM6HG256X_ERROR;
@@ -1186,12 +1187,12 @@ ISM6HG256XStatusTypeDef ISM6HG256XSensor::Set_Wake_Up_Threshold(uint32_t Thresho
11861187*/
11871188ISM6HG256XStatusTypeDef ISM6HG256XSensor::Set_Wake_Up_Duration (uint8_t Duration)
11881189{
1189- ism6hg256x_act_wkup_time_windows_t dur_t ;
1190- if (ism6hg256x_act_wkup_time_windows_get (®_ctx, &dur_t ) != ISM6HG256X_OK) {
1190+ ism6hg256x_act_thresholds_t wake_up_ths ;
1191+ if (ism6hg256x_act_thresholds_get (®_ctx, &wake_up_ths ) != ISM6HG256X_OK) {
11911192 return ISM6HG256X_ERROR;
11921193 }
1193- dur_t . shock = Duration;
1194- if (ism6hg256x_act_wkup_time_windows_set (®_ctx, dur_t ) != ISM6HG256X_OK) {
1194+ wake_up_ths. duration = ( uint8_t ) Duration;
1195+ if (ism6hg256x_act_thresholds_set (®_ctx, &wake_up_ths ) != ISM6HG256X_OK) {
11951196 return ISM6HG256X_ERROR;
11961197 }
11971198 return ISM6HG256X_OK;
0 commit comments