SlideShare a Scribd company logo
For Programming Embedded Systems
Q-02 *Which structure variable points to the tick function?
A) line 8
B) line 98
C) line 62
D) line 19 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
A) line 8 is true
line 8: int (*TickFct) (int);
TickFct is a variable which points to tick function

More Related Content

More from arcotstarsports

You are presented with a patient, named Gerry, who has Down syndrome .pdf
You are presented with a patient, named Gerry, who has Down syndrome .pdfYou are presented with a patient, named Gerry, who has Down syndrome .pdf
You are presented with a patient, named Gerry, who has Down syndrome .pdf
arcotstarsports
 
Write a template function to fill in a STL list with a given array..pdf
Write a template function to fill in a STL list with a given array..pdfWrite a template function to fill in a STL list with a given array..pdf
Write a template function to fill in a STL list with a given array..pdf
arcotstarsports
 
write a method to generate AVL tree of height h wth fewest nodes and.pdf
write a method to generate AVL tree of height h wth fewest nodes and.pdfwrite a method to generate AVL tree of height h wth fewest nodes and.pdf
write a method to generate AVL tree of height h wth fewest nodes and.pdf
arcotstarsports
 
Which of the following is NOT correctWhich of the following is NO.pdf
Which of the following is NOT correctWhich of the following is NO.pdfWhich of the following is NOT correctWhich of the following is NO.pdf
Which of the following is NOT correctWhich of the following is NO.pdf
arcotstarsports
 
What is Mills response to the problem posed by some peoples desi.pdf
What is Mills response to the problem posed by some peoples desi.pdfWhat is Mills response to the problem posed by some peoples desi.pdf
What is Mills response to the problem posed by some peoples desi.pdf
arcotstarsports
 
What is a bivariate distributionSolutionBivariate distributio.pdf
What is a bivariate distributionSolutionBivariate distributio.pdfWhat is a bivariate distributionSolutionBivariate distributio.pdf
What is a bivariate distributionSolutionBivariate distributio.pdf
arcotstarsports
 
What are some of the tools you can use to tune or correct a Linux fi.pdf
What are some of the tools you can use to tune or correct a Linux fi.pdfWhat are some of the tools you can use to tune or correct a Linux fi.pdf
What are some of the tools you can use to tune or correct a Linux fi.pdf
arcotstarsports
 
TrueFalse Insulin spikes in the postabsorptive state.Solution.pdf
TrueFalse Insulin spikes in the postabsorptive state.Solution.pdfTrueFalse Insulin spikes in the postabsorptive state.Solution.pdf
TrueFalse Insulin spikes in the postabsorptive state.Solution.pdf
arcotstarsports
 
The principal role of ATP In the cell is A) serving as structural s.pdf
The principal role of ATP In the cell is  A) serving as structural s.pdfThe principal role of ATP In the cell is  A) serving as structural s.pdf
The principal role of ATP In the cell is A) serving as structural s.pdf
arcotstarsports
 
The neutral theory of evolution proposed that most genetic mutations .pdf
The neutral theory of evolution proposed that most genetic mutations .pdfThe neutral theory of evolution proposed that most genetic mutations .pdf
The neutral theory of evolution proposed that most genetic mutations .pdf
arcotstarsports
 
The oldest living organisms on Earth are plants. Some bristlecone pi.pdf
The oldest living organisms on Earth are plants. Some bristlecone pi.pdfThe oldest living organisms on Earth are plants. Some bristlecone pi.pdf
The oldest living organisms on Earth are plants. Some bristlecone pi.pdf
arcotstarsports
 
Suppose there is a person whose total lung capacity (TLC) is 4.90 L, .pdf
Suppose there is a person whose total lung capacity (TLC) is 4.90 L, .pdfSuppose there is a person whose total lung capacity (TLC) is 4.90 L, .pdf
Suppose there is a person whose total lung capacity (TLC) is 4.90 L, .pdf
arcotstarsports
 
Research the IPv4 ns the IPv6 protocols, then prepare a report that .pdf
Research the IPv4 ns the IPv6 protocols, then prepare a report that .pdfResearch the IPv4 ns the IPv6 protocols, then prepare a report that .pdf
Research the IPv4 ns the IPv6 protocols, then prepare a report that .pdf
arcotstarsports
 
Species I Species II Species III Species IV Ancestral sequence IV Sit.pdf
Species I Species II Species III Species IV Ancestral sequence IV Sit.pdfSpecies I Species II Species III Species IV Ancestral sequence IV Sit.pdf
Species I Species II Species III Species IV Ancestral sequence IV Sit.pdf
arcotstarsports
 
Solve the differential equation y+y=sin(x). Im thinking I ne.pdf
Solve the differential equation y+y=sin(x). Im thinking I ne.pdfSolve the differential equation y+y=sin(x). Im thinking I ne.pdf
Solve the differential equation y+y=sin(x). Im thinking I ne.pdf
arcotstarsports
 
Please write a non-recursive procedure to print all nodes for a bina.pdf
Please write a non-recursive procedure to print all nodes for a bina.pdfPlease write a non-recursive procedure to print all nodes for a bina.pdf
Please write a non-recursive procedure to print all nodes for a bina.pdf
arcotstarsports
 
Please do C, D, and E For the given f Z right arrow Z, decide wheth.pdf
Please do C, D, and E For the given f Z right arrow Z, decide wheth.pdfPlease do C, D, and E For the given f Z right arrow Z, decide wheth.pdf
Please do C, D, and E For the given f Z right arrow Z, decide wheth.pdf
arcotstarsports
 
need help with code I wrote. This code is a maze gui, and i need hel.pdf
need help with code I wrote. This code is a maze gui, and i need hel.pdfneed help with code I wrote. This code is a maze gui, and i need hel.pdf
need help with code I wrote. This code is a maze gui, and i need hel.pdf
arcotstarsports
 
Microbiology question Which of the following is the most unique a.pdf
Microbiology question Which of the following is the most unique a.pdfMicrobiology question Which of the following is the most unique a.pdf
Microbiology question Which of the following is the most unique a.pdf
arcotstarsports
 
Is Event B dependent or independent of Event A A green ball is draw.pdf
Is Event B dependent or independent of Event A A green ball is draw.pdfIs Event B dependent or independent of Event A A green ball is draw.pdf
Is Event B dependent or independent of Event A A green ball is draw.pdf
arcotstarsports
 

More from arcotstarsports (20)

You are presented with a patient, named Gerry, who has Down syndrome .pdf
You are presented with a patient, named Gerry, who has Down syndrome .pdfYou are presented with a patient, named Gerry, who has Down syndrome .pdf
You are presented with a patient, named Gerry, who has Down syndrome .pdf
 
Write a template function to fill in a STL list with a given array..pdf
Write a template function to fill in a STL list with a given array..pdfWrite a template function to fill in a STL list with a given array..pdf
Write a template function to fill in a STL list with a given array..pdf
 
write a method to generate AVL tree of height h wth fewest nodes and.pdf
write a method to generate AVL tree of height h wth fewest nodes and.pdfwrite a method to generate AVL tree of height h wth fewest nodes and.pdf
write a method to generate AVL tree of height h wth fewest nodes and.pdf
 
Which of the following is NOT correctWhich of the following is NO.pdf
Which of the following is NOT correctWhich of the following is NO.pdfWhich of the following is NOT correctWhich of the following is NO.pdf
Which of the following is NOT correctWhich of the following is NO.pdf
 
What is Mills response to the problem posed by some peoples desi.pdf
What is Mills response to the problem posed by some peoples desi.pdfWhat is Mills response to the problem posed by some peoples desi.pdf
What is Mills response to the problem posed by some peoples desi.pdf
 
What is a bivariate distributionSolutionBivariate distributio.pdf
What is a bivariate distributionSolutionBivariate distributio.pdfWhat is a bivariate distributionSolutionBivariate distributio.pdf
What is a bivariate distributionSolutionBivariate distributio.pdf
 
What are some of the tools you can use to tune or correct a Linux fi.pdf
What are some of the tools you can use to tune or correct a Linux fi.pdfWhat are some of the tools you can use to tune or correct a Linux fi.pdf
What are some of the tools you can use to tune or correct a Linux fi.pdf
 
TrueFalse Insulin spikes in the postabsorptive state.Solution.pdf
TrueFalse Insulin spikes in the postabsorptive state.Solution.pdfTrueFalse Insulin spikes in the postabsorptive state.Solution.pdf
TrueFalse Insulin spikes in the postabsorptive state.Solution.pdf
 
The principal role of ATP In the cell is A) serving as structural s.pdf
The principal role of ATP In the cell is  A) serving as structural s.pdfThe principal role of ATP In the cell is  A) serving as structural s.pdf
The principal role of ATP In the cell is A) serving as structural s.pdf
 
The neutral theory of evolution proposed that most genetic mutations .pdf
The neutral theory of evolution proposed that most genetic mutations .pdfThe neutral theory of evolution proposed that most genetic mutations .pdf
The neutral theory of evolution proposed that most genetic mutations .pdf
 
The oldest living organisms on Earth are plants. Some bristlecone pi.pdf
The oldest living organisms on Earth are plants. Some bristlecone pi.pdfThe oldest living organisms on Earth are plants. Some bristlecone pi.pdf
The oldest living organisms on Earth are plants. Some bristlecone pi.pdf
 
Suppose there is a person whose total lung capacity (TLC) is 4.90 L, .pdf
Suppose there is a person whose total lung capacity (TLC) is 4.90 L, .pdfSuppose there is a person whose total lung capacity (TLC) is 4.90 L, .pdf
Suppose there is a person whose total lung capacity (TLC) is 4.90 L, .pdf
 
Research the IPv4 ns the IPv6 protocols, then prepare a report that .pdf
Research the IPv4 ns the IPv6 protocols, then prepare a report that .pdfResearch the IPv4 ns the IPv6 protocols, then prepare a report that .pdf
Research the IPv4 ns the IPv6 protocols, then prepare a report that .pdf
 
Species I Species II Species III Species IV Ancestral sequence IV Sit.pdf
Species I Species II Species III Species IV Ancestral sequence IV Sit.pdfSpecies I Species II Species III Species IV Ancestral sequence IV Sit.pdf
Species I Species II Species III Species IV Ancestral sequence IV Sit.pdf
 
Solve the differential equation y+y=sin(x). Im thinking I ne.pdf
Solve the differential equation y+y=sin(x). Im thinking I ne.pdfSolve the differential equation y+y=sin(x). Im thinking I ne.pdf
Solve the differential equation y+y=sin(x). Im thinking I ne.pdf
 
Please write a non-recursive procedure to print all nodes for a bina.pdf
Please write a non-recursive procedure to print all nodes for a bina.pdfPlease write a non-recursive procedure to print all nodes for a bina.pdf
Please write a non-recursive procedure to print all nodes for a bina.pdf
 
Please do C, D, and E For the given f Z right arrow Z, decide wheth.pdf
Please do C, D, and E For the given f Z right arrow Z, decide wheth.pdfPlease do C, D, and E For the given f Z right arrow Z, decide wheth.pdf
Please do C, D, and E For the given f Z right arrow Z, decide wheth.pdf
 
need help with code I wrote. This code is a maze gui, and i need hel.pdf
need help with code I wrote. This code is a maze gui, and i need hel.pdfneed help with code I wrote. This code is a maze gui, and i need hel.pdf
need help with code I wrote. This code is a maze gui, and i need hel.pdf
 
Microbiology question Which of the following is the most unique a.pdf
Microbiology question Which of the following is the most unique a.pdfMicrobiology question Which of the following is the most unique a.pdf
Microbiology question Which of the following is the most unique a.pdf
 
Is Event B dependent or independent of Event A A green ball is draw.pdf
Is Event B dependent or independent of Event A A green ball is draw.pdfIs Event B dependent or independent of Event A A green ball is draw.pdf
Is Event B dependent or independent of Event A A green ball is draw.pdf
 

Recently uploaded

The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
Col Mukteshwar Prasad
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
Nguyen Thanh Tu Collection
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 

Recently uploaded (20)

The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 

For Programming Embedded SystemsQ-02 Which structure variable poi.pdf

  • 1. For Programming Embedded Systems Q-02 *Which structure variable points to the tick function? A) line 8 B) line 98 C) line 62 D) line 19 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 A) line 8 is true line 8: int (*TickFct) (int); TickFct is a variable which points to tick function