Question: (This exercise is slightly modified from D. E. Simon, An Embedded Software Primer, Addison-Wesley Professional, 1999.) Where in the following code do you need
(This exercise is slightly modified from D. E. Simon, "An Embedded Software Primer," Addison-Wesley Professional, 1999.) Where in the following code do you need to disable and re-enable interrupts to make the function reentrant? Rewrite this function to make it reentrant. static int iValue; int iFix Value (int iParm) { } int iTemp; iTemp = iValue; iTemp +iParm * 17; if (iTemp > 4922) iTemp =iParm; Value = iTemp; iParmiTemp + 179; if (iParm
Step by Step Solution
There are 3 Steps involved in it
To make the function iFixValue reentrant we need to protect the shared variable iValue from concurrent access by disabling interrupts during its acces... View full answer
Get step-by-step solutions from verified subject matter experts
