Rally Point
Three sensor subsystems on a data logger must all finish their initialization before the coordinator task can begin recording. Each sensor task takes a different amount of time to calibrate. The coordinator must block until every sensor has checked in, then print a summary.
Use a FreeRTOS event group to synchronize the three sensor tasks with the coordinator. Each sensor sets its own bit when ready; the coordinator waits for all three bits before proceeding.
Sensor tasks should print "READY:<name>" when they finish calibrating, where name is ACCEL, GYRO, or MAG. The coordinator then prints "ALL_READY" followed by "DONE".
Each sensor's READY line appears as its calibration finishes — the calibration delays make ACCEL finish first, then GYRO, then MAG — and the coordinator's two lines come last.
Available FreeRTOS APIs: xEventGroupCreate() xEventGroupSetBits(event_group, bits_to_set) xEventGroupWaitBits(event_group, bits_to_wait, clear_on_exit, wait_for_all, timeout) xTaskCreate(function, name, stack_size, param, priority, handle) vTaskStartScheduler() vTaskDelay(ticks) pdMS_TO_TICKS(ms) pdTRUE / pdFALSE portMAX_DELAY configMINIMAL_STACK_SIZE
Include event_groups.h for the event group APIs.