SlideShare a Scribd company logo
1 of 1
Download to read offline
For Programming Embedded Systems
Q-07 *Whcih variable and condition is sued to detect unfinished tasks (interrupted interrupt)?
A) Line 28
B) Line 36
C) Line 25
D) Line 22 I. #include "rims.h" 2 3 4. typedef struct task state BL LedOff; break; default: int
state; unsigned long period; unsigned long elapsedTime: int (*TickFct) (int); taski state ) I
Transitions switch (state) case BL Ledoff: 11. task tasks [2] break; case BL Ledon: 13. const
unsigned char tasksNum 2; 14. const unsigned long periodBlinkLed = 1500; 15. const unsigned
long periodThreeLeds 500; break; default: break; ) // State actions 17, const unsigned long
tasksPeriodGCD = 500; return state 19. int TickFct BlinkLed (int state) 20. int TickFct
ThreeLeds (int state) 22. unsigned char process!ngRdyTasks = 0; 23. void TimerISR 98. enum
TL States TL TO, TL T1, TL T2 TL State; 100 99. int TickFct ThreeLeds (int state) ( 101
VARIABLES MUST BE DECLARED STATIC/ unsigned char i; if (processingRdyTasks)
/*e.g., static int x = 0; */ /*variables for state machine go here. printf ("Period too short  "): 103
switch (state) case -1: process!ngRdyTasks = 1; for (1 = 0; 1 = 107 108 109 tasks [i].period) case
TL TO: tasks [1]. state = 1 tasks[i].TickFct (tasks[i].state); state = TL T1; tasks[i].elapsedTime0
break; case TL T1: 112 113 tasks [1].elapsedTime += tasksPeriodGCD; processingRdyTasks - 0;
state = TL T2 115 116 38. int main) break; case TL T2: unsigned char i=0; tasks [1]. state =-1;
tasks [1].period = periodBlinkLed; tasks [1] .elapsedTime tasks [1] ·period; tasks [1].TickFct
6T1ckFct BlinkLed; 118 119 120 121 122 123 1 state = TL T0; break; default: state --1; tasks [1]
, state = -1; tasks [1].period periodThreeLeas; tasks [1].elapsedTime = tasks [1].period; tasks
[1].TICkFct = &TICkfct; ThreeLeas; 125 switch (state) 127 128 129 130 case TL TO: get
Timerset (tasksPeriodGCD); break case TL T1: TimerOn () while (1) Sleep return 0 133 135 137
139 h break case TL T2: 61. enum BL States BL Ledoff, BL Ledon BL State; 62. int TickFct
BlinkLed (int state) *VARIABLES MUST BE DECLARED STATIC break; 64. /*e.g., static Int
X = 0; */ 65. /*variables for state machine go here/ default: break switch (state) case-1: return
state state = BL LedOff break; 146 case BL Ledoff: state = BL Ledon; break; case BL Ledon: 1
Solution
c) Line 25 is correct
Line 25 contains if condition and processingRdyTasks variable is used to detect the unfinished
tasks

More Related Content

More from mumnesh

Problem 1 Create Node class (or use what you have done in Lab4)• .pdf
Problem 1 Create Node class (or use what you have done in Lab4)• .pdfProblem 1 Create Node class (or use what you have done in Lab4)• .pdf
Problem 1 Create Node class (or use what you have done in Lab4)• .pdf
mumnesh
 
Hi, please I need help with the correct answer to the above multiple.pdf
Hi, please I need help with the correct answer to the above multiple.pdfHi, please I need help with the correct answer to the above multiple.pdf
Hi, please I need help with the correct answer to the above multiple.pdf
mumnesh
 
Discuss the dangers associated with hydrogen sulfide in the petro.pdf
Discuss the dangers associated with hydrogen sulfide in the petro.pdfDiscuss the dangers associated with hydrogen sulfide in the petro.pdf
Discuss the dangers associated with hydrogen sulfide in the petro.pdf
mumnesh
 
CommunicationsSystems have four basic properties (holism, equi-fi.pdf
CommunicationsSystems have four basic properties (holism, equi-fi.pdfCommunicationsSystems have four basic properties (holism, equi-fi.pdf
CommunicationsSystems have four basic properties (holism, equi-fi.pdf
mumnesh
 
Abraham Shine recently opaned his own accounting fiem on April 1, whi.pdf
Abraham Shine recently opaned his own accounting fiem on April 1, whi.pdfAbraham Shine recently opaned his own accounting fiem on April 1, whi.pdf
Abraham Shine recently opaned his own accounting fiem on April 1, whi.pdf
mumnesh
 
14. Suppose I have collected the names of people in several separate.pdf
14. Suppose I have collected the names of people in several separate.pdf14. Suppose I have collected the names of people in several separate.pdf
14. Suppose I have collected the names of people in several separate.pdf
mumnesh
 
4. The size of instructions can be fixed or variable. What are advant.pdf
4. The size of instructions can be fixed or variable. What are advant.pdf4. The size of instructions can be fixed or variable. What are advant.pdf
4. The size of instructions can be fixed or variable. What are advant.pdf
mumnesh
 

More from mumnesh (20)

Poisson distribution] The number of data packets arriving in 1 sec at.pdf
Poisson distribution] The number of data packets arriving in 1 sec at.pdfPoisson distribution] The number of data packets arriving in 1 sec at.pdf
Poisson distribution] The number of data packets arriving in 1 sec at.pdf
 
Problem 1 Create Node class (or use what you have done in Lab4)• .pdf
Problem 1 Create Node class (or use what you have done in Lab4)• .pdfProblem 1 Create Node class (or use what you have done in Lab4)• .pdf
Problem 1 Create Node class (or use what you have done in Lab4)• .pdf
 
One of your friends has several brothers and sisters, each quite dif.pdf
One of your friends has several brothers and sisters, each quite dif.pdfOne of your friends has several brothers and sisters, each quite dif.pdf
One of your friends has several brothers and sisters, each quite dif.pdf
 
Malpighiaceae luonanthaceae Ochnaceae Flacourtiaceae O Monilophytes G.pdf
Malpighiaceae luonanthaceae Ochnaceae Flacourtiaceae O Monilophytes G.pdfMalpighiaceae luonanthaceae Ochnaceae Flacourtiaceae O Monilophytes G.pdf
Malpighiaceae luonanthaceae Ochnaceae Flacourtiaceae O Monilophytes G.pdf
 
In JavaWrite a program that reads a text file that contains a gra.pdf
In JavaWrite a program that reads a text file that contains a gra.pdfIn JavaWrite a program that reads a text file that contains a gra.pdf
In JavaWrite a program that reads a text file that contains a gra.pdf
 
How does Pb and TCE partition between components of soil (mineral, o.pdf
How does Pb and TCE partition between components of soil (mineral, o.pdfHow does Pb and TCE partition between components of soil (mineral, o.pdf
How does Pb and TCE partition between components of soil (mineral, o.pdf
 
Hi, please I need help with the correct answer to the above multiple.pdf
Hi, please I need help with the correct answer to the above multiple.pdfHi, please I need help with the correct answer to the above multiple.pdf
Hi, please I need help with the correct answer to the above multiple.pdf
 
For which phyla are megaspores a shared trait Bryophyta Monilophyt.pdf
For which phyla are megaspores a shared trait  Bryophyta  Monilophyt.pdfFor which phyla are megaspores a shared trait  Bryophyta  Monilophyt.pdf
For which phyla are megaspores a shared trait Bryophyta Monilophyt.pdf
 
For analysis of Thermodynamic Cycle, we draw T-s or P-h diagram. Why.pdf
For analysis of Thermodynamic Cycle, we draw T-s or P-h diagram. Why.pdfFor analysis of Thermodynamic Cycle, we draw T-s or P-h diagram. Why.pdf
For analysis of Thermodynamic Cycle, we draw T-s or P-h diagram. Why.pdf
 
Fill in the blank. A contingency table relates only continuous rando.pdf
Fill in the blank. A contingency table relates  only continuous rando.pdfFill in the blank. A contingency table relates  only continuous rando.pdf
Fill in the blank. A contingency table relates only continuous rando.pdf
 
Discuss the dangers associated with hydrogen sulfide in the petro.pdf
Discuss the dangers associated with hydrogen sulfide in the petro.pdfDiscuss the dangers associated with hydrogen sulfide in the petro.pdf
Discuss the dangers associated with hydrogen sulfide in the petro.pdf
 
Complete the following paragraph to describe the various reproductive.pdf
Complete the following paragraph to describe the various reproductive.pdfComplete the following paragraph to describe the various reproductive.pdf
Complete the following paragraph to describe the various reproductive.pdf
 
CommunicationsSystems have four basic properties (holism, equi-fi.pdf
CommunicationsSystems have four basic properties (holism, equi-fi.pdfCommunicationsSystems have four basic properties (holism, equi-fi.pdf
CommunicationsSystems have four basic properties (holism, equi-fi.pdf
 
Based on your reading of the GCU introduction and the textbooks, wha.pdf
Based on your reading of the GCU introduction and the textbooks, wha.pdfBased on your reading of the GCU introduction and the textbooks, wha.pdf
Based on your reading of the GCU introduction and the textbooks, wha.pdf
 
Answer using Giardias, Shiga-toxin producing E.coli1.Causative Agn.pdf
Answer using Giardias, Shiga-toxin producing E.coli1.Causative Agn.pdfAnswer using Giardias, Shiga-toxin producing E.coli1.Causative Agn.pdf
Answer using Giardias, Shiga-toxin producing E.coli1.Causative Agn.pdf
 
Abraham Shine recently opaned his own accounting fiem on April 1, whi.pdf
Abraham Shine recently opaned his own accounting fiem on April 1, whi.pdfAbraham Shine recently opaned his own accounting fiem on April 1, whi.pdf
Abraham Shine recently opaned his own accounting fiem on April 1, whi.pdf
 
29. This figure shows the principal coronary blood vessels. Which one.pdf
29. This figure shows the principal coronary blood vessels. Which one.pdf29. This figure shows the principal coronary blood vessels. Which one.pdf
29. This figure shows the principal coronary blood vessels. Which one.pdf
 
14. Suppose I have collected the names of people in several separate.pdf
14. Suppose I have collected the names of people in several separate.pdf14. Suppose I have collected the names of people in several separate.pdf
14. Suppose I have collected the names of people in several separate.pdf
 
4. The size of instructions can be fixed or variable. What are advant.pdf
4. The size of instructions can be fixed or variable. What are advant.pdf4. The size of instructions can be fixed or variable. What are advant.pdf
4. The size of instructions can be fixed or variable. What are advant.pdf
 
13. What is the difference between post-consumer recycled materials a.pdf
13. What is the difference between post-consumer recycled materials a.pdf13. What is the difference between post-consumer recycled materials a.pdf
13. What is the difference between post-consumer recycled materials a.pdf
 

Recently uploaded

Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
AnaAcapella
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
EADTU
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
EADTU
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MysoreMuleSoftMeetup
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
Peter Brusilovsky
 

Recently uploaded (20)

Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 
Introduction to TechSoup’s Digital Marketing Services and Use Cases
Introduction to TechSoup’s Digital Marketing  Services and Use CasesIntroduction to TechSoup’s Digital Marketing  Services and Use Cases
Introduction to TechSoup’s Digital Marketing Services and Use Cases
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 
Ernest Hemingway's For Whom the Bell Tolls
Ernest Hemingway's For Whom the Bell TollsErnest Hemingway's For Whom the Bell Tolls
Ernest Hemingway's For Whom the Bell Tolls
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 

For Programming Embedded SystemsQ-07 Whcih variable and condition.pdf

  • 1. For Programming Embedded Systems Q-07 *Whcih variable and condition is sued to detect unfinished tasks (interrupted interrupt)? A) Line 28 B) Line 36 C) Line 25 D) Line 22 I. #include "rims.h" 2 3 4. typedef struct task state BL LedOff; break; default: int state; unsigned long period; unsigned long elapsedTime: int (*TickFct) (int); taski state ) I Transitions switch (state) case BL Ledoff: 11. task tasks [2] break; case BL Ledon: 13. const unsigned char tasksNum 2; 14. const unsigned long periodBlinkLed = 1500; 15. const unsigned long periodThreeLeds 500; break; default: break; ) // State actions 17, const unsigned long tasksPeriodGCD = 500; return state 19. int TickFct BlinkLed (int state) 20. int TickFct ThreeLeds (int state) 22. unsigned char process!ngRdyTasks = 0; 23. void TimerISR 98. enum TL States TL TO, TL T1, TL T2 TL State; 100 99. int TickFct ThreeLeds (int state) ( 101 VARIABLES MUST BE DECLARED STATIC/ unsigned char i; if (processingRdyTasks) /*e.g., static int x = 0; */ /*variables for state machine go here. printf ("Period too short "): 103 switch (state) case -1: process!ngRdyTasks = 1; for (1 = 0; 1 = 107 108 109 tasks [i].period) case TL TO: tasks [1]. state = 1 tasks[i].TickFct (tasks[i].state); state = TL T1; tasks[i].elapsedTime0 break; case TL T1: 112 113 tasks [1].elapsedTime += tasksPeriodGCD; processingRdyTasks - 0; state = TL T2 115 116 38. int main) break; case TL T2: unsigned char i=0; tasks [1]. state =-1; tasks [1].period = periodBlinkLed; tasks [1] .elapsedTime tasks [1] ·period; tasks [1].TickFct 6T1ckFct BlinkLed; 118 119 120 121 122 123 1 state = TL T0; break; default: state --1; tasks [1] , state = -1; tasks [1].period periodThreeLeas; tasks [1].elapsedTime = tasks [1].period; tasks [1].TICkFct = &TICkfct; ThreeLeas; 125 switch (state) 127 128 129 130 case TL TO: get Timerset (tasksPeriodGCD); break case TL T1: TimerOn () while (1) Sleep return 0 133 135 137 139 h break case TL T2: 61. enum BL States BL Ledoff, BL Ledon BL State; 62. int TickFct BlinkLed (int state) *VARIABLES MUST BE DECLARED STATIC break; 64. /*e.g., static Int X = 0; */ 65. /*variables for state machine go here/ default: break switch (state) case-1: return state state = BL LedOff break; 146 case BL Ledoff: state = BL Ledon; break; case BL Ledon: 1 Solution c) Line 25 is correct Line 25 contains if condition and processingRdyTasks variable is used to detect the unfinished tasks