A critical real-time system must be implemented using the ESP8266 RTOS SDK. The system has 3...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
A critical real-time system must be implemented using the ESP8266 RTOS SDK. The system has 3 jobs: • Job A - aperiodic triggered by a high on a GPIO pin Job B- periodic with a period of 10 units • Job C- periodic with a period of 5 units Figure Q1.b on page 3 contains two potential C listings for the implementation. Which listing would you prefer? Justify your choice. Your answer should iden- tify the specific aspects of each listing that would make it preferable in specific contexts. 1 2 static void JobA() {...}; static void JobB () {...}; static void JobC() {...}; 4 const TickType_t xPeriodB = 10; const TickType_t xPeriodC = 5; 3 5 6 7 8 9 14 15 16 17 18 19 20 10 11 12 static void per_taskB (void *arg) 13 { 21 22 23 24 25 26 27 28 29 30 31 32 33 36 37 38 39 40 41 42 43 44 } 45 46 47 static void isr_hdler (void) { JobA(); } Listing I Pre-emptive Priority with Interrupt } Figure Q1.b: Implementation of a Critical System using the ESP8266 RTOS SDK } TickType_t xLastWake Time; for (;;) { } static void per_taskC(void *arg) { TickType_t xLastWakeTime; for (;;) { } xLastWakeTime = xTaskGetTickCount(); JobB (); 34 void app_main(void) 35 { xLastWakeTime = xTaskGetTickCount(); JobB(); 1 2 gpio_config_t io_conf; io_conf.intr_type= GPIO_INTR_HIGH_LEVEL; io_conf.pin_bit_mask = GPIO_PIN_0; io_conf.mode= GPIO_MODE_INPUT; gpio_config(&io_conf); 3 4 5 6 7 18 vTaskDelayUntil( &xLastWakeTime, xPeriodB); 19 20 8 9 10 11 12 13 14 15 16 17 21 22 23 24 25 33 34 35 36 xTaskCreate (per_taskB, "B", 2048, NULL, 10, NULL); xTaskCreate (per_taskC, "C", 2048, NULL, 11, NULL); gpio_install_isr_service(0); gpio_isr_handler_add (GPIO_NUM_0, isr_hdler, NULL); static void JobA() {...}; static void JobB () {...}; static void JobC() {...}; const TickType_t xSlot = 5; } 37 38 39 } static void cyclicx (void *arg) { TickType_t xLastWake Time; for (;;) { } 26 27 28 void app_main(void) 29 { vTaskDelayUntil( &xLastWakeTime, xPeriodC ); 30 31 32 Listing II Cyclic Executive JobC(); } // Slot 1 of 2 xLastWakeTime = xTaskGetTickCount(); if (gpio_get_level (GPIO INPUT_O)) JobA(); - JobB(); JobC(); vTaskDelayUntil( &xLastWakeTime, xSlot); //Slot 2 of 2 xLastWakeTime = xTaskGetTickCount(); if (gpio_get_level (GPIO_NUM_0)) JobA(); 5 marks vTaskDelayUntil( &xLastWakeTime, xSlot ); for (;;) { gpio_config_t io_conf; io_conf.pin_bit_mask = GPIO_INPUT_10_0; io_conf.mode = GPIO_MODE_INPUT; gpio_config(kio_conf); cyclicx(); A critical real-time system must be implemented using the ESP8266 RTOS SDK. The system has 3 jobs: • Job A - aperiodic triggered by a high on a GPIO pin Job B- periodic with a period of 10 units • Job C- periodic with a period of 5 units Figure Q1.b on page 3 contains two potential C listings for the implementation. Which listing would you prefer? Justify your choice. Your answer should iden- tify the specific aspects of each listing that would make it preferable in specific contexts. 1 2 static void JobA() {...}; static void JobB () {...}; static void JobC() {...}; 4 const TickType_t xPeriodB = 10; const TickType_t xPeriodC = 5; 3 5 6 7 8 9 14 15 16 17 18 19 20 10 11 12 static void per_taskB (void *arg) 13 { 21 22 23 24 25 26 27 28 29 30 31 32 33 36 37 38 39 40 41 42 43 44 } 45 46 47 static void isr_hdler (void) { JobA(); } Listing I Pre-emptive Priority with Interrupt } Figure Q1.b: Implementation of a Critical System using the ESP8266 RTOS SDK } TickType_t xLastWake Time; for (;;) { } static void per_taskC(void *arg) { TickType_t xLastWakeTime; for (;;) { } xLastWakeTime = xTaskGetTickCount(); JobB (); 34 void app_main(void) 35 { xLastWakeTime = xTaskGetTickCount(); JobB(); 1 2 gpio_config_t io_conf; io_conf.intr_type= GPIO_INTR_HIGH_LEVEL; io_conf.pin_bit_mask = GPIO_PIN_0; io_conf.mode= GPIO_MODE_INPUT; gpio_config(&io_conf); 3 4 5 6 7 18 vTaskDelayUntil( &xLastWakeTime, xPeriodB); 19 20 8 9 10 11 12 13 14 15 16 17 21 22 23 24 25 33 34 35 36 xTaskCreate (per_taskB, "B", 2048, NULL, 10, NULL); xTaskCreate (per_taskC, "C", 2048, NULL, 11, NULL); gpio_install_isr_service(0); gpio_isr_handler_add (GPIO_NUM_0, isr_hdler, NULL); static void JobA() {...}; static void JobB () {...}; static void JobC() {...}; const TickType_t xSlot = 5; } 37 38 39 } static void cyclicx (void *arg) { TickType_t xLastWake Time; for (;;) { } 26 27 28 void app_main(void) 29 { vTaskDelayUntil( &xLastWakeTime, xPeriodC ); 30 31 32 Listing II Cyclic Executive JobC(); } // Slot 1 of 2 xLastWakeTime = xTaskGetTickCount(); if (gpio_get_level (GPIO INPUT_O)) JobA(); - JobB(); JobC(); vTaskDelayUntil( &xLastWakeTime, xSlot); //Slot 2 of 2 xLastWakeTime = xTaskGetTickCount(); if (gpio_get_level (GPIO_NUM_0)) JobA(); 5 marks vTaskDelayUntil( &xLastWakeTime, xSlot ); for (;;) { gpio_config_t io_conf; io_conf.pin_bit_mask = GPIO_INPUT_10_0; io_conf.mode = GPIO_MODE_INPUT; gpio_config(kio_conf); cyclicx();
Expert Answer:
Answer rating: 100% (QA)
Listing II Cyclic Executive is preferable in this context as it is a better fit for the realtime sys... View the full answer
Related Book For
Discrete Time Signal Processing
ISBN: 978-0137549207
2nd Edition
Authors: Alan V. Oppenheim, Rolan W. Schafer
Posted Date:
Students also viewed these computer engineering questions
-
17 18 19 20 21 22 23 7285 24 26 The original coordinates of the point in polor coordinates are X'-r cos (+0) and Yor cos (+0) 29 30 A decoder is a combinational circuit that converts binary...
-
1 D 6 7 8 9 20 21 22 23 24 25 26 27 28 29 30 31 Martin Balinsky, a foreign exchange trader at Credit Suisse (Warsaw), is exploring uncovered interest arbitrage possibilities. He wants to invest...
-
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ARASIN22227 17 18 19 20 21 23 24 25 26 1) (2) Sales Price per unit Variable Cost per unit Contribution per unit Contribution Margin Ratio Break Even Point Sales...
-
2) Assume that your widget manufacturing company has a total annual demand of N widgets per year evenly distributed across the year. Each widget cost $b dollars in material and manufacturing costs to...
-
Highlight, Inc., owns all outstanding stock of Kiort Corporation. The two companies report the following balances for the year ending December 31, 2011: On January 1, 2011, Highlight acquired on the...
-
Capital Edge Company has found that, historically, 0.5% of its current accounts receivable, 3% of accounts 1 to 30 days past due, 4.5% of accounts 31 to 60 days past due, 8% of accounts 61 to 90 days...
-
On June 8, 2017, Eugene Weiner made a post on Isaac Aflalos Facebook page. The post read, Yurim and Isaac took advantage of a old 94plus sick man elder abuse [sic]. Alflalo took umbrage to the post...
-
In recent years, Walz Company has purchased three machines. Because of frequent employee turnover in the accounting department, a different accountant was in charge of selecting the depreciation...
-
= Suppose f(z) is analytic for |z| < 3. If |(z)| 1, and (i) (1) = 0, what is the maximum value of |f(0)|? For which func- tions is the maximum attained?
-
Martha has not made any taxable gifts in her past Check and complete the excel spreadsheet of total assets. ASSUME BENNY DIES ON DECEMBER 31, 2020. Prepare a Reconciliation of Gross Estate to the...
-
What is hyperthyroidism?
-
Give an example of a self-fulfilling prophecy that you had. Be specific!
-
For a business plan of a bakery: Make the operational marketing to introduce the marketing mix 4Ps: In Promotion we have to state the 4 elements -advertisement -sales promotion -public relationship...
-
Divide students into groups of 4-5 and ask them to generate as many thoughts and ideas they have about the following groups of people: Afro-Caribbean, Indigenous, Irish, Italian, Jewish, and Latino....
-
Would it be better for students to work for a year before starting a degree?
-
For a business of your choice, explain how it used IMC tools to deliver a successful IMC campaign. In your answer explain which tools they used and how did it help them achieve their objective.
-
+ The following are the statements of comprehensive income and financial positions of Green Limited: Green Limited Statement of Comprehensive Income for the Year Ended 31 December 2018 GHC Sales...
-
Find the market equilibrium point for the following demand and supply functions. Demand: 2p = - q + 56 Supply: 3p - q = 34
-
Consider the complex sequence (a) Find the Fourier transform X(e j? ) of x[n]. (b) Find the N-point DFT X[k] of the finite-length sequence x[n]. (c) Find the DFT of x[n] for case ? 0 = 2?k 0 /N,...
-
Suppose x c (t) is a periodic continuous-time signal with period 1 ms and for which the Fourier series is The Fourier series coefficients k are zero for |k| > 9.x c (t) is sampled with a sample...
-
In Figure, h[n] is the impulse response of the LTI system within the inner box. The input to system h[n] is v[n], and the output is w[n]. The z-transform of h[n], H(z), exists in the following region...
-
Figure P19.4 shows two hot streams and two cold streams for heat integration (subject to \(\Delta T_{\min }=20^{\circ} \mathrm{C}\) ). (i) What are the energy targets? (ii) Show a network design...
-
Figure P19.5 shows an existing design of a process plant, containing two exothermic processes. These require streams of reactants as shown in the diagram, and produce products at the temperatures...
-
Recalculate the problem in P19.5 using a \(\Delta T_{\min }=10{ }^{\circ} \mathrm{C}\). Comment on the effect of reducing the minimum temperature difference. [ (a) \(T_{\mathrm{C}_{\text {pinch...
Study smarter with the SolutionInn App