Edit Mode Swing Options issues

I’m having a couple of issues with EDIT MODE swing options.

Most notably, when cycling through the options, I don’t seem to be able to preview what any of the options look like while in EDIT MODE. I have to set one, exit edit mode and reboot saber for it to take effect.

Second, I seem to be having issues where the Swing Options are not updating after changing them once. I’ll set it to option 5, and reboot saber, and it’ll be visible/working, then I’ll set it to a different option and it won’t update what it’s showing, but it does update the setting. I have to re-upload the config through Arduino before it will show the last option i selected in Edit Mode.

Post the style code displaying the issue.

Sure, it’s on github. This is also the same font where cycling to Ignition option 7 in EDIT mode was locking up the board. I’ve left that option available for you to debug it too.

Can you just paste the specific style here or use pastebin.com so I know exactly what I need to look at?

Like so:

StylePtr<...>()

Or post a link directly to the style on github. (click on the line number, select permalink)

Ok. The style is broken up into a bunch of using functions to reduce duplicate code and organize everything.

The main style code is here:

Swing options:

All the using functions referenced there are in this file

Yup, there’s a bug in Swing Option (been there since OS6 release but nobody’s caught or reported). I’ve fixed and submitted PR when @profezzorn gets a chance to merge it.

Merged.
Do we have a second verification?

Hoping user could test but wasn’t sure with all the pre-8 stuff in master.

I think it should be fine.
If not, I’ll do a cherrypick and test on the 7.x branch.

@BlackDragonN001 can you test and confirm the fix?

Click green “Code” button and choose Download ZIP, when you extract you may need to rename folder “ProffieOS”.

Then upload and test.

Thanks.

tested, and it works now. Yay. Now just to figure out why that ignition option crashes. Should that topic be moved to ProffieOS forum section?

Figured out why that Ignition option froze up the board. Strobe Frequency cannot be 0, causes a Divide by 0 error/lock up. Maybe should put a compile warning or a failsafe like strobe_frequency ? comparison and if it’s 0, use 1 instead? Or a note in the comments of Strobe that says “Don’t do that”

You could add that here:

Thank you for finding the problem!
I’ve submitted a fix on github, not sure if it will be for ProffieOS 8.x or cherry-picked into 7.14 yet…