-
-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix GPIO assignments #3007
Fix GPIO assignments #3007
Conversation
WalkthroughThe recent updates to the ChibiOS project involve significant changes to GPIO pin assignments and configurations, as well as the reassignment of ADC channel connections. The modifications aim to enhance clarity and maintainability by renaming GPIO pins and adjusting their configurations across various ports. The ADC channel mappings have also been reorganized to reflect the new hardware setup, optimizing how the channels are utilized in the application. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
- Add missing config for PA2 connected to ADC. - Remove ADC channels being wrongly configured. - Fix ADC declaration following this. - Update managed helper for ADC.
9a4595c
to
16b27e1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
targets/ChibiOS/ORGPAL_PALX/board.h (1)
50-68
: Inconsistency Found in GPIO Pin RenamingThe GPIO pin renaming is not consistent across the codebase. The following files still contain old GPIO pin names:
targets/AzureRTOS/ST/ORGPAL_PALTHREE/board.h
targets/ChibiOS/ORGPAL_PALTHREE/board.h
Please update these references to match the new naming conventions.
Analysis chain
Verify Consistency in GPIO Pin Renaming
The GPIO pin macros have been renamed for clarity. Ensure that all instances of these pins in the codebase have been updated to match the new naming conventions.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that GPIO pin renaming is consistent across the codebase. # Test: Search for old and new GPIO pin names to ensure all references are updated. rg --type c --type h $'GPIOA_PIN2|GPIOB_IO1_P18_ADC1_IN9|LINE_IO1_P17_ADC1_IN3|LINE_IO1_P18_ADC1_IN9'Length of output: 2019
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- targets/ChibiOS/ORGPAL_PALX/board.h (17 hunks)
- targets/ChibiOS/ORGPAL_PALX/managed_helpers/ORGPAL_PALX.Adc.cs (2 hunks)
- targets/ChibiOS/ORGPAL_PALX/target_system_device_adc_config.cpp (1 hunks)
Additional comments not posted (4)
targets/ChibiOS/ORGPAL_PALX/target_system_device_adc_config.cpp (1)
11-17
: Ensure ADC Channel Updates Align with Hardware SpecificationsThe changes to the
AdcPortPinConfig
array update the GPIO pin assignments for ADC1. Verify that these changes accurately reflect the hardware design and that the removed configurations are no longer needed.targets/ChibiOS/ORGPAL_PALX/managed_helpers/ORGPAL_PALX.Adc.cs (1)
Line range hint
14-44
:
Verify Accuracy of ADC Channel DescriptionsThe comments for ADC channels have been updated to reflect new pin assignments. Ensure that these descriptions are accurate and match the hardware configuration, as incorrect descriptions could lead to confusion.
targets/ChibiOS/ORGPAL_PALX/board.h (2)
388-537
: Review GPIO Configuration Macros for AccuracyThe configuration macros for GPIO settings have been updated. Ensure that these macros accurately reflect the intended pin modes, types, speeds, and alternate functions.
240-263
: Check Line Assignments for GPIO ConsistencyThe line assignments for GPIO pins have been updated. Verify that these changes are consistent with the new GPIO pin definitions and that they reflect the intended hardware functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- targets/ChibiOS/ORGPAL_PALX/board.h (17 hunks)
- targets/ChibiOS/ORGPAL_PALX/managed_helpers/ORGPAL_PALX.Adc.cs (2 hunks)
- targets/ChibiOS/ORGPAL_PALX/target_system_device_adc_config.cpp (1 hunks)
Additional comments not posted (3)
targets/ChibiOS/ORGPAL_PALX/target_system_device_adc_config.cpp (1)
11-11
: Verify ADC channel mapping change.The ADC channel for GPIOA has been changed from pin 3 to pin 2. Ensure that this change aligns with the hardware configuration and that any dependent code has been updated accordingly.
targets/ChibiOS/ORGPAL_PALX/managed_helpers/ORGPAL_PALX.Adc.cs (1)
14-14
: Ensure updated comment accuracy for Channel 0.The comment for Channel 0 has been updated to reflect a connection to PA2. Ensure this matches the actual hardware setup.
Verification successful
Comment for Channel 0 accurately reflects the hardware connection.
The comment stating that Channel 0 is connected to PA2 in
ORGPAL_PALX.Adc.cs
is correct and consistent with the codebase. No further action is needed.
targets/ChibiOS/ORGPAL_PALX/managed_helpers/ORGPAL_PALX.Adc.cs
: Channel 0 is correctly documented as connected to PA2.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the accuracy of Channel 0's comment in the codebase. # Test: Search for references to Channel 0 and PA2 in the codebase. rg --type cs -A 5 $'Channel_0' rg --type cs -A 5 $'PA2'Length of output: 3940
targets/ChibiOS/ORGPAL_PALX/board.h (1)
52-52
: Verify GPIO pin renaming for GPIOA_PIN2.The definition for GPIOA_PIN2 has been renamed to GPIOA_IO2_ADC1_IN2_NTC. Ensure this change is reflected consistently across the codebase.
Verification successful
Renaming Verified: GPIOA_PIN2 to GPIOA_IO2_ADC1_IN2_NTC
The renaming of
GPIOA_PIN2
toGPIOA_IO2_ADC1_IN2_NTC
has been successfully applied throughout the codebase. No instances ofGPIOA_PIN2
remain, ensuring consistency and correctness in the updated code.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of the renamed GPIOA_PIN2 in the codebase. # Test: Search for references to GPIOA_PIN2 and GPIOA_IO2_ADC1_IN2_NTC in the codebase. rg --type c -A 5 $'GPIOA_PIN2' rg --type c -A 5 $'GPIOA_IO2_ADC1_IN2_NTC'Length of output: 3732
Script:
#!/bin/bash # Description: Verify the usage of the renamed GPIOA_PIN2 across the entire codebase. # Test: Search for any remaining references to GPIOA_PIN2 in the codebase. rg --type c $'GPIOA_PIN2'Length of output: 24
Description
Motivation and Context
How Has This Been Tested?
Screenshots
Types of changes
Checklist
CC @gligorov @networkfusion
Summary by CodeRabbit
New Features
Bug Fixes
Chores