Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request implements a unified and extensible RGB LED status signaling system for the MCU, replacing the old per-channel LED control with a message-based approach. It introduces a new
LedMsg_tstructure for atomic RGB LED state updates, defines a set of standard LED status patterns for key system states, and updates all relevant tasks and the CLI to use the new system. The documentation is also expanded to describe LED behavior and usage.Core LED System Refactor:
Introduced
LedMsg_tstruct andenum LEDpatternfor atomic RGB LED control, replacing individual channel commands and constants. The LED task now receives full RGB state messages and applies patterns (solid, blink at various rates) via a queue (xLedQueue). Predefined status messages (e.g.,LED_STATUS_NORMAL,LED_STATUS_WARN) are provided for common system states. (projects/cm_mcu/Tasks.h,projects/cm_mcu/LedTask.c,projects/cm_mcu/cm_mcu.c, [1] [2] [3]Refactored the LED task to use the new
LedMsg_tmessage type, supporting atomic updates and consistent blinking patterns for all RGB channels. Legacy per-channel command handling is removed. (projects/cm_mcu/LedTask.c, projects/cm_mcu/LedTask.cL26-R70)System State Integration:
Updated system tasks (
InitTask,PowerSupplyTask,GenericAlarmTask) to send the appropriate predefined LED status message toxLedQueuewhen changing states, ensuring the LED always reflects the current system condition. (projects/cm_mcu/InitTask.c,projects/cm_mcu/PowerSupplyTask.c,projects/cm_mcu/GenericAlarmTask.c, [1] [2] [3] [4]Extended alarm task parameters (
GenericAlarmParams_t) to include pointers to LED status messages for warning, alarm, and normal states, allowing flexible LED signaling for different alarm types. (projects/cm_mcu/AlarmUtilities.h,projects/cm_mcu/AlarmUtilities.c, [1] [2]CLI and Bootloader Support:
Reworked the
ledCLI command to accept symbolic state names (e.g.,normal,warn) and send the correspondingLedMsg_tmessage for debugging and manual override. (projects/cm_mcu/CommandLineTask.c,projects/cm_mcu/commands/SensorControl.c, [1] [2]Updated the bootloader command to directly set the LED to white (all channels on) as a visual indicator before jumping to the bootloader. (
projects/cm_mcu/commands/SoftwareCommands.c, projects/cm_mcu/commands/SoftwareCommands.cR9-R20)Documentation:
projects/cm_mcu/README.md, projects/cm_mcu/README.mdR78-R105)