Since the new season has started, the long process of migrating everything over to 2025 has begun. As of now, we have correctly migrated everything over to versions of 2025 except the CANSparkMax code. I have been onto the REV page for migration (Migrating to REVLib 2025 | REVLib), and I can’t seem to find a way to fix our CANSparkMaxUtil for our Spark Max Controllers. The code is below, any help would be great! Out git hub is online as well: GitHub - FRCTeam3543/FRC3543_SwerveBaseCode
Migrating configuring status frame periods are explained in this section of the migration guide. The biggest difference is that the settings are broken up by signals in each status, but ultimately the status frames are being configured.
It looks like this the code snippet you included is meant to limit the SPARK’s CAN utilization depending on the device’s specific use, but with 2025 REVLib and firmware, a majority of status frames are disabled by default and relevant status frame are automatically enabled when a .getX() for a sensor is called in the program.
Unfortunately enableExternalUSBControl() was removed for 2025 due to refactoring of our infrastructure, and it is not currently planned to be added back.
So the enableExternalUSBControl() is removed fully. Okay! So I see where the frame status is being defined and the before + the after. The only thing now would be what it would be replaced with:
config.signals.primaryEncoderPositionPeriodMs(5);
or
max.configure(config, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters);
or
double position = max.getEncoder().getPosition();
Hi, with the new season changes, we found our library is broken because of the REVLib changes. I scanned through the Migration document and fixed most of the issues. But it doesn’t have answers to some of the issues. Here are the broken features that I can’t find fixes for:
Voltage Compensation feature seems to be gone but I can’t find any mention on what replaces it. I am assuming it is replaced by ControlType.kVoltage. Please confirm.
restoreFactoryDefaults is gone. I read the migration doc but want to confirm if I understand it correctly. If I just want to reset everything to factory default, should I create an empty SparkMaxConfig and call max.configure with the empty SparkMaxConfig and use kResetSafeParameters and kPersistParameters?
setClosedLoopRampRate and setOpenLoopRampRate are gone. What are the replacements?
Thanks for the quick response. I have implemented all that. But I got another question. For follower mode, I found a disableFollowerMode but I don’t see a corresponding “enableFollowerMode”. From looking at the code, it looks like the follow method is an implicit “enable” because the disableFollowerMode method is exactly identical to the follow method except for setting the leaderId to zero and invert to false. Please confirm.