Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

19. What are the constraints on TV advertising in Germany?

Answered: 1 week ago