embedded systems real time oprating system
$10-30 CAD
$10-30 CAD
Paid on delivery
Modify previous blinky LEDs code to have same result, i.e., blinking Red, Green, and Blue ones, respectively but this time instead of implementing three tasks:
static void prvSetupHardware(void)
{
SystemCoreClockUpdate();
Board_Init();
/* Initial state for each LED is off */
Board_LED_Set(Red, false);
Board_LED_Set(Green, false);
Board_LED_Set(Blue, false);
}
static void vLEDTaskRed(void *pvParameters)
{
colour_t *colourCS;
colourCS = (colour_t *) pvParameters;
palette_t col = colourCS[Red].colour;
portTickType numticks = colourCS[Red].delayTicks;
portTickType xLastWakeTime;
xLastWakeTime = xTaskGetTickCount();
while (1)
{
Board_LED_Set(col, true);
vTaskDelayUntil(&xLastWakeTime, numticks);
Board_LED_Set(col, false);
vTaskDelayUntil(&xLastWakeTime, (numticks << 1));
}
}
static void vLEDTaskGreen(void *pvParameters)
{
colour_t *colourCS;
colourCS = (colour_t *) pvParameters;
palette_t col = colourCS[Green].colour;
portTickType numticks = colourCS[Green].delayTicks;
portTickType xLastWakeTime;
xLastWakeTime = xTaskGetTickCount();
while (1)
{
vTaskDelayUntil(&xLastWakeTime, numticks);
Board_LED_Set(col, true);
vTaskDelayUntil(&xLastWakeTime, numticks);
Board_LED_Set(col, false);
vTaskDelayUntil(&xLastWakeTime, numticks);
}
}
Have only one task implementation using Mutex concept!
Project ID: 22257043
About the project
Remote project
Active 5 yrs ago
Looking to make some money?
Benefits of bidding on Freelancer
Set your budget and timeframe
It's free to sign up and bid on jobs