You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Some motor configurations are stored on volatile memory onboard the motor. This memory is reset when the motor disconnects.
What is the behavior that isn't addressed by the existing API?
Motor configuration should be reapplied when the motor reconnects.
OPTIONAL Describe any solutions you've considered
The configuration of every motor should be stored by PROS, as well as whether the motor was connected last cycle or not. If the motor was not connect last cycle, but is during the current cycle, then the last saved configuration needs to be applied. This will require checks on every port every 10ms.
Ideally, this would be implemented in the "C side" of the PROS kernel, so this feature still works if motors are configured using the C API. This would require a static array of 21 structs for each of the 21 ports on the brain, or alternatively a dynamic array, but using a dynamic array introduces opportunities for bugs, although it would be smaller.
Every struct in the array contains the configuration of a motor on a specific port. This struct is updated every time a configuration function is called. Alternatively, the configuration of a motor could be checked every cycle.
Additional context
This is done to an extent by VexOS, but this is limited to motor cartridge and reversal. Ideally this would be handled by VexOS, but its unlikely that this would ever get implemented into VexOS.
I ran into this problem while working on the LemLib/hardware project. Implementing this functionality user-side has many limitations and is harder than opening a PR to add this functionality to the PROS kernel.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Some motor configurations are stored on volatile memory onboard the motor. This memory is reset when the motor disconnects.
What is the behavior that isn't addressed by the existing API?
Motor configuration should be reapplied when the motor reconnects.
OPTIONAL Describe any solutions you've considered
The configuration of every motor should be stored by PROS, as well as whether the motor was connected last cycle or not. If the motor was not connect last cycle, but is during the current cycle, then the last saved configuration needs to be applied. This will require checks on every port every 10ms.
Ideally, this would be implemented in the "C side" of the PROS kernel, so this feature still works if motors are configured using the C API. This would require a static array of 21 structs for each of the 21 ports on the brain, or alternatively a dynamic array, but using a dynamic array introduces opportunities for bugs, although it would be smaller.
Every struct in the array contains the configuration of a motor on a specific port. This struct is updated every time a configuration function is called. Alternatively, the configuration of a motor could be checked every cycle.
Additional context
This is done to an extent by VexOS, but this is limited to motor cartridge and reversal. Ideally this would be handled by VexOS, but its unlikely that this would ever get implemented into VexOS.
I ran into this problem while working on the LemLib/hardware project. Implementing this functionality user-side has many limitations and is harder than opening a PR to add this functionality to the PROS kernel.
The text was updated successfully, but these errors were encountered: