Hello! Recently, something in my code is making my screen shift (as in, the stuff I draw to the screen appears shifted horizontally or vertically) or flip upside down (see video).
My guess is that this somehow happens when I try to write outside the screen boundaries, but is there something else that would cause this?
If it is writing out of bounds, it looks like the library functions like DrawRect and WriteString do not do boundary checks. Do I need to write my own wrapper functions that compute string width etc? Maybe I should just use WriteStringAligned for this, as I think it just doesn’t draw the string if it’s too big.
I am having similar problems with my build. Usually happens when there is a lot of non-UI related activity (turning knobs, incoming MIDI). My theory was this has something to do with v-sync. However, it looks there is no way to control or even detect when the v-sync event happens from Daisy.
Hmm. I think that fits with what I’ve seen, though in the video I managed to make it happen just by turning the encoder back and forth quickly.
I wonder if decreasing the frequency of checking midi & knobs and updating UI would help?
I haven’t found any solution, to be honest. Part of the problem is I don’t understand if there is any safe way to write to the display so it doesn’t shift. I wish I had better understanding of how the OLED display works and the protocols that drive it (SPI/I2C).
Well that sucks. The weird thing for me is I’ve been working on a Patch project for months, and this hardly ever happened (a few times when I was debugging). But now on a new project, it happens almost every time I run it.
Question for electro-smith: if you can’t tell us what causes this, can you tell us how to reset the screen? I’ve noticed that, if my screensaver runs, the screen is flipped back to normal after it comes back. But I haven’t tracked down what is happening to cause that. A reset would be useful, if we can’t solve the underlying problem.
@Takumi_Ogata any suggestions?
It’d be really nice to hear from Electrosmith on this one
BTW, I was wrong – my screensaver is not resetting the screen. I think I’ve seen the screen reset without restarting the Patch, but now I’m not sure.
I also started wondering if there was something wrong with that Patch unit, since my other two units have never really had a problem (with different firmware). But I loaded this project onto one of those Patches and was able to make the screen flip by turning the encoder back and forth.
But a serious amount of encoder-turning causes no issues with the other firmware.