Skip to content

Commit

Permalink
Disabled suspend during PWM
Browse files Browse the repository at this point in the history
  • Loading branch information
mishadesh committed Jan 15, 2024
1 parent 2c92b88 commit c55c3cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 4 additions & 2 deletions examples/light-switch-app/telink/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,17 @@ void AppTask::PC0ButtonActionHandler(AppEvent * aEvent)
{
isActive = true;
k_timer_start(&sPC0ResetTimer, K_MSEC(3000), K_NO_WAIT);
pm_policy_state_lock_get(PM_STATE_STANDBY, PM_ALL_SUBSTATES); //this need to be uncommented with deep sleep mode
pm_policy_state_lock_get(PM_STATE_STANDBY, PM_ALL_SUBSTATES);
pm_policy_state_lock_get(PM_STATE_SUSPEND_TO_IDLE, PM_ALL_SUBSTATES);
//pwm_set_dt(&pwm_motor1, PWM_MSEC(6), PWM_MSEC(3));
pwm_set_dt(&pwm_motor2, PWM_MSEC(6), PWM_MSEC(3));
}
else
{
isActive = false;
k_timer_stop(&sPC0ResetTimer);
pm_policy_state_lock_put(PM_STATE_STANDBY, PM_ALL_SUBSTATES); //this need to be uncommented with deep sleep mode
pm_policy_state_lock_put(PM_STATE_STANDBY, PM_ALL_SUBSTATES);
pm_policy_state_lock_put(PM_STATE_SUSPEND_TO_IDLE, PM_ALL_SUBSTATES);
//pwm_set_dt(&pwm_motor1, 0, 0);
pwm_set_dt(&pwm_motor2, 0, 0);
}
Expand Down
2 changes: 0 additions & 2 deletions src/platform/telink/tlsr9528a_retention.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@
};

&pwm0 {
clk32k-ch4-enable;
clk32k-ch5-enable;
pinctrl-0 = <&pwm_ch4_pa2_default &pwm_ch5_pa3_default>;
};

Expand Down

0 comments on commit c55c3cd

Please sign in to comment.