File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,11 @@ const uint32_t timer_ms_period = (auxclk_freq_hz / 1000) - 1;
3636 */
3737volatile uint32_t systick_ms = 0 ;
3838
39+ /**
40+ * Whether the timer has been suspended
41+ */
42+ static int systick_is_suspended ;
43+
3944/**
4045 * The systick interrupt service routine (ISR) which will be called every millisecond.
4146 */
@@ -57,6 +62,7 @@ void systick_isr_C(void) {
5762void systick_suspend (void ) {
5863 /* Disable the timer interrupt */
5964 TimerDisable (SOC_TMR_0_REGS , TMR_TIMER12 );
65+ systick_is_suspended = 1 ;
6066}
6167
6268/**
@@ -65,6 +71,7 @@ void systick_suspend(void) {
6571void systick_resume (void ) {
6672 /* Enable the timer interrupt */
6773 TimerEnable (SOC_TMR_0_REGS , TMR_TIMER12 , TMR_ENABLE_CONT );
74+ systick_is_suspended = 0 ;
6875}
6976
7077/**
@@ -116,8 +123,8 @@ void pbdrv_clock_busy_delay_ms(uint32_t ms) {
116123}
117124
118125bool pbdrv_clock_is_ticking (void ) {
119- // TODO
120- return true ;
126+ // TODO: Check current interrupt status as well
127+ return ! systick_is_suspended ;
121128}
122129
123130#endif // PBDRV_CONFIG_CLOCK_TIAM1808
You can’t perform that action at this time.
0 commit comments