-
Notifications
You must be signed in to change notification settings - Fork 111
Frontend: add new joystick button functions #3506
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
Frontend: add new joystick button functions #3506
Conversation
Reviewer's GuideThis PR extends the BTN_FUNCTION enum by adding new joystick button mappings for script triggers and detailed servo controls for channels 4 through 6, aligning the frontend with recent ArduSub updates. Class diagram for updated BTN_FUNCTION enum with new joystick button functionsclassDiagram
class BTN_FUNCTION {
<<enum>>
RELAY_2_MOMENTARY
RELAY_3_MOMENTARY
RELAY_4_MOMENTARY
SCRIPT_1
SCRIPT_2
SCRIPT_3
SCRIPT_4
SERVO_4_MIN
SERVO_4_MAX
SERVO_4_CENTER
SERVO_4_INC
SERVO_4_DEC
SERVO_4_MIN_MOMENTARY
SERVO_4_MAX_MOMENTARY
SERVO_4_MIN_TOGGLE
SERVO_4_MAX_TOGGLE
SERVO_5_MIN
SERVO_5_MAX
SERVO_5_CENTER
SERVO_5_INC
SERVO_5_DEC
SERVO_5_MIN_MOMENTARY
SERVO_5_MAX_MOMENTARY
SERVO_5_MIN_TOGGLE
SERVO_5_MAX_TOGGLE
SERVO_6_MIN
SERVO_6_MAX
SERVO_6_CENTER
SERVO_6_INC
SERVO_6_DEC
SERVO_6_MIN_MOMENTARY
SERVO_6_MAX_MOMENTARY
SERVO_6_MIN_TOGGLE
SERVO_6_MAX_TOGGLE
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey there - I've reviewed your changes - here's some feedback:
- Consider refactoring the repeated SERVO_N_* enum entries into a computed helper or generator pattern to reduce manual duplication and prevent potential indexing errors.
- Double-check that the numeric values for SCRIPT and SERVO ranges exactly align with the upstream ArduSub definitions to avoid any off-by-one mismatches.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider refactoring the repeated SERVO_N_* enum entries into a computed helper or generator pattern to reduce manual duplication and prevent potential indexing errors.
- Double-check that the numeric values for SCRIPT and SERVO ranges exactly align with the upstream ArduSub definitions to avoid any off-by-one mismatches.
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Relevant to #3501 |
updating the enum with the newer joystick button functions in ArduSub
Summary by Sourcery
Update the BTN_FUNCTION enum to include new joystick mappings for running scripts and controlling servo channels 4–6.
New Features: