Question: Problem # 8 ( 1 5 points ) : An LED was used, and its GPIO user configuration in RTOS was properly predefined separately. The

Problem # 8(15 points): An LED was used, and its GPIO user configuration in RTOS was properly predefined separately. The names to access pins are configured as Board_LED0 and Board_LED1. LEDs and resistors are connected to these pins as shown on the right side. It is assumed that the values of the resistors are properly chosen for the proper brightness of the LEDs, when they are tuned on. A TI RTOS program was created for this test circuit as shown on the next page. In this RTOS program, the tick period was configured as 1000\mu s. Describe the behaviors of both LEDs, when the TI RTOS program is executing. You can answer it as ON, OFF, or Blink. If your answer is Blink, make sur (%)? Make sure to include derivations and/or explanati// Headers and user driver configuration were not shown but properly defined unsigned int test =0; Void task1Fxn(UArg arg0){ while (1){ Semaphore_pend(semHandle, BIOS_WAIT_FOREVER); GPIO_toggle(Board_LED1); if ((test&0x01)==1) GPIO_write(Board_LEDO, Board_LED_ON); Task_sleep((UInt)arg0); test =0; Semaphore_post(semHandle); }} Void task2Fxn(UArg arg0){ while (1){ Semaphore_pend(semHandle, BIOS_WAIT_FOREVER); GPIO_write(Board_LEDO, Board_LED_OFF); Task_sleep((UInt)arg0); test++; Semaphore_post(semHandle); }} int main(void){ Task_Params task1Params, task2Params; Semaphore_Params semParams; Board_initGeneral(); Board_initGPIO(); GPIO_write(Board_LEDO, Board_LED_OFF); GPIO_write(Board_LED1, Board_LED_OFF); Task_Params_init(&task1Params); task1Params.arg0=150; task1Params.stackSize = TASKSTACKSIZE; task1Params.stack = &task1Stack; task1Params.priority =1 ; Task_construct(&task1Struct, (Task_FuncPtr)task1Fxn, &task1Params, NULL); Task_Params_init(&task2Params); task2Params.arg0=50; task2Params.stackSize = TASKSTACKSIZE; task2Params.stack = &task2Stack; task2Params.priority =1 ; Task_construct(&task2Struct, (Task_FuncPtr)task2Fxn, &task2Params, NULL); Semaphore_Params_init(&semParams); Semaphore_construct(&semStruct, 1, &semParams); semHandle = Semaphore_handle(&semStruct); BIOS_start(); return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!