You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importtimeimportboardimportdisplayioimportvectoriodisplay=board.DISPLAYdefshow_and_count_loops_per_second(num_reads: int) ->None:
time_ms=time.monotonic_ns() //1e6next_lps_time=time_ms+1000lps_counter=0whilenum_reads>0:
lps_counter+=1time_ms=time.monotonic_ns() //1e6iftime_ms>next_lps_time:
print(f"Loops per second: {lps_counter}")
num_reads-=1next_lps_time+=1000lps_counter=0print("Empty loop")
show_and_count_loops_per_second(5)
print("\nCreate a vectorio rectangle as big as the screen")
palette=displayio.Palette(1)
palette[0] =0x125690rectangle=vectorio.Rectangle(pixel_shader=palette, width=display.width, height=display.height, x=0, y=0)
rectangle_group=displayio.Group()
rectangle_group.append(rectangle)
display.root_group=rectangle_groupshow_and_count_loops_per_second(5)
print("\nChange rectangle color")
palette[0] =0xFFFF00show_and_count_loops_per_second(5)
Behavior
Empty loop
Loops per second: 64892
Loops per second: 64707
Loops per second: 64781
Loops per second: 64704
Loops per second: 64682
Create a vectorio rectangle as big as the screen
Loops per second: 64931
Loops per second: 74644
Loops per second: 74662
Loops per second: 74627
Loops per second: 74573
Change rectangle color
Loops per second: 8342
Loops per second: 8644
Loops per second: 8801
Loops per second: 8806
Loops per second: 8698
Description
There's something wrong with the vectorio display update, once the palette color change the microcontroller slow down and never recover. To replicate the bug I made the above example.
First the script run an emty loop and measure how many loops are performed in a second. It runs about 65k loops per second,
After the script create a rectangle with vectiorio as big as the screen and measure the looping time again. Now it runs about 75k loops per second. It make sense, the display do not show anymore the console.
Finally the script change the palette color of the rectange and measure for the third time the empty looping time. The loops per second drop below 9k and never recover even after the screen updates are done
Additional information
No response
The text was updated successfully, but these errors were encountered:
I suspected this was the palette being marked dirty and then never cleared. BUT it looks like it should be cleared. There may be a bug further upstream that is preventing the palette dirty bit from being cleared.
CircuitPython version
Code/REPL
Behavior
Description
There's something wrong with the vectorio display update, once the palette color change the microcontroller slow down and never recover. To replicate the bug I made the above example.
First the script run an emty loop and measure how many loops are performed in a second. It runs about 65k loops per second,
After the script create a rectangle with vectiorio as big as the screen and measure the looping time again. Now it runs about 75k loops per second. It make sense, the display do not show anymore the console.
Finally the script change the palette color of the rectange and measure for the third time the empty looping time. The loops per second drop below 9k and never recover even after the screen updates are done
Additional information
No response
The text was updated successfully, but these errors were encountered: