I've been playing about with the LCD plug, using lcd.createChar() to perform animations of characters that were already written onto the LCD.
It works really well. Reminds me of VDU23 from the BBC micro days :-)
So then I decided to implement a screensaver on the Timer2 interrupt to turn the screen off after 10 seconds if I hadn't pressed any buttons.
This worked really well too.
Then after a few minutes I noticed some corruption on the screen... Due to a bit of lazy programming I was sending lcd.noBacklight() every 10 seconds, even if the screen was already off. However this seems to have shown up an issue.
I think what is happening is the i2c message in the main loop updating the custom characters is sometimes getting interrupted (literally) with the backlight off message and ending up as a strange hybrid mix up of bytes.
Now I know how I can solve this, just put the noBacklight command in the main loop, and just set a boolean flag in the timer which it checks.
So my question is: Is this expected (mis)behaviour? Is putting the command in the interrupt considered bad programming?
