-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fix notify display for SPI1 w/ 36 MHz clock (VGA hires mode) #46
Conversation
@keirf Please don't merge this yet. I'll add similar handling for the user definable hotkeys tomorrow to keep the OSD look consistent. |
It's quite promising that you've found that not changing OSD box size "fixes" the problem. This surely does mean it's some sort of software race rather than some unfixable hardware glitch. So it's something to do with pressing the mode switch hotkey, which changes mode and displays a notifier or hotkey at the exact same time? Is that right? Or is it related to OSD box resize in VGA mode and not the preceding mode switch itself. |
Well, not entirely. Even if not a single mode switch occured (or is about to occur), pressing the 'OSD Off' key sequence while using SPI1 in 36 MHz mode "empties" all subsequent OSD boxes. This even happens for bare v1.9 w/o any configured hot keys. Apart from that, there's also a mode switching issue that is mitigated by the SPI hard reset: |
Ah I see. Okay perhaps I can work out the underlying cause based on testing with vs without your patches. I will stick all your stuff on a branch for now, I expect. |
Thanks! I'd suggest to merge the SPI reset stuff into master. It doesn't hurt and - at least to me - looks like a cleaner way to reinit the peripheral. In all the examples I found about how it's done in STM's own IDE, they do a _deinit first when reconfiguring peripherals. It's not entirely clear what their _deinit stuff does, but their forum suggests it just resets the ports. |
Yes that probably makes sense! |
While I'm sure you will work out the underlying cause of the disappearing OSD contents eventually, for the time being I added a second commit that ensures the OSD size stays the same for hotkey output strings as well while formatting them somewhat pleasantly. |
This is fine, and I'm happy to carry it all on a branch for now. And I will work on it when I have time. Greaseweazle is taking my time at the moment! |
Yeah, I can imagine that. Greaseweazle is very nice, and I know how much time the little details can cost. May I suggest that the branch be the videoswitch-branch that will eventually incorporate the videoswitch-functionality that's been - and still is - my initial intention in all of this? |
Yes that's the plan: videoswitch branch incorporating that feature plus the required fixes. |
Will close this now in favor if PR #47, where I'll add the videoswitch stuff as well. |
Fixes issue #45
The problem lies in the resizing of the OSD box outline. For SPI frequencies > 18 MHz, this leads to the OSD text disappearing.
The reason is not entirely clear, but keeping the OSD box at a constant (maximum) size eliminates the issue.
This PR also fixes SPI initialization by properly resetting and (re-)enabling the peripheral first.