Four Digit Display blocking issue


#1

Hello,

I know there is a lot going on, and we’ve got a few issues we’re all looking at, but I wanted to see where else we need to keep track of outstanding bugs in the firmware. I can open an issue in Github if you like, but I figured that for now I’ll document it here.

I’m going through the firmware and making a large number of changes … I’ll post it here for you soon to review and see what you like, or don’t. :slight_smile:

In the code review I just came across another loop() blocking issue, this time in the four digit display code, which can cause all sorts of timing related issues.

If you look at the code here, you’ll see that this loop can block the code for seconds when updating the display.

This is in the “display analog read command (#77)” and I believe this code will have to be fixed to use timestamps to determine the start and end of the period of updating the display, and allow the loop to keep running.

I am looking at a fix that I might add, but I wanted to ensure that it would follow a style that you prefer.

Again … I’ll post my updated code soon … I’m working to increase the readability and structure of much of it, hoping to be of help and contribute.


#2

Hey,
It does look like the code is indeed blocks other transactions on the GrovePi. I think the easiest way to do this would be to keep checking millis() in each loop iterations and whenever the difference between the last updated time and millis() crosses 250 ms, we can just refresh the value.

Do you have something else in mind for this.

-Karan


#3

Hello,

I do agree … that is how I was thinking it could be solved … I wanted to make sure that was the desired pattern.