Question: Q 4 . ( 6 pts ) Timer Interrupts The following Thumr - 2 code shows an interrupt handler upon receiving a SysTick interrupt. You

Q4.(6pts) Timer Interrupts The following Thumr-2 code shows an interrupt handler upon receiving a SysTick interrupt. You don't have
to change it at all. Basically this handler invokes the timer_update() routine. Your task is to implement
timer_update((
The timer_update() function uses the following four parameters.
The timer_update() function reads the value of the SECOND_LEFT address, decrements the value by 1
(second), checks the value, branches to _timer_update_done if the value hasn't reached 0, otherwise it needs
to stop the timer and to invoke a user function whose address is maintained in the USR_HANDLER address.
To stop the timer, write STCTRL_STOP to the address of STCTRL.(Don't forget to save back a
decremented value into SECOND_LEFT.)
; Code the rest.
_timer_update_done
MON pc,r; return to SysTick_Handler
The following C program defines sig_handler()(lines 2-4) that is invoked upon receiving a SysTick interrupt
and that changes alarmed from 1 to 2. The main() function (lines 6-16) initializes alarmed to 1(line 8),
schedules sig_hanlder() to be invoked upon a SysTick interrupt (line 9), and starts SysTick to count down for
10 seconds (line 10). The main() function falls into a while() loop (lines 11-14), jumps sig_handler() upon
receiving a Sys Tick interrupt, and gets out of the while() loop as alarmed eventually becomes 2.
The following Thumr-2 code shows an interrupt handler upon receiving a Sys Tick interrupt. You don't have
to change it at all. Basically this handler invokes the timer_update() routine. Your task is to implement
timer_update().
The timer_update() function uses the following four parameters.
 Q4.(6pts) Timer Interrupts The following Thumr-2 code shows an interrupt handler

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!