Conversation
|
|
||
| use crate::error::{bail_on, map_errno}; | ||
|
|
||
| pub const CONTROLLER_MAX_LINE_LENGTH: usize = 14; |
There was a problem hiding this comment.
Maybe this should go in pros-sys because it determines constraints on a function from that module. Also if controller display gets implemented in sim it'd be good to have that constant available because the simulator already uses other constants from pros-sys like errno values.
|
I think it's a little worrying how this makes it harder to read controller inputs without much obvious increase in safety. For example if you want to periodically rumble the controller from another thread but still read its inputs from opcontrol you'll need a mutex to share the controller, even though those two actions (reading joysticks and playing the haptic feedback) could happen in parallel. |
|
I think it is worth considering renaming the master controller to main or some similar word. |
Primary and partner might work because that's what VEXcode uses. |
Describe the changes this PR makes. Why should it be merged?
Controllerinto peripherals to enforce singleton access.Additional Context
ButtonsandJoysticksneed to exist now other than as a fancy namespace struct.