The first parameter of display is the line number and the


Consider a system that employs a preemptive real-time OS. There are multiple threads that need to update a shared LCD display. Consider this example with two foreground threads (thread1 thread2) and one background thread (isr) that all output to a three-line LCD. Free is a global variable, initialized to 1.

2446_f8835e2a-852f-452b-b704-a1ba0bc6130f.png

The first parameter of Display is the line number, and the second parameter is a 16-bit number. You may call the two LCD_GoTo LCD_OutDec functions without writing them. Your Display function will effectively perform the following (this program has a critical section).

735_e8200bee-b765-4862-bb91-12148172fe6e.png

Rewrite this Display function to remove the critical sections. You CANNOT disable interrupts at all. You should not introduce new critical sections. You CANNOT allow threads to block or spin. If the LCD is busy, then the output is simply skipped. You may not change the thread code or the Display function prototype. Basically you will add software to this existing Display function, but not thread1, thread2, or isr.

Request for Solution File

Ask an Expert for Answer!!
Mechanical Engineering: The first parameter of display is the line number and the
Reference No:- TGS01468311

Expected delivery within 24 Hours