-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add PicoDVI support #7880
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
Add PicoDVI support #7880
Conversation
PicoDVI in CP support 640x480 and 800x480 on Feather DVI, Pico and Pico W. 1 and 2 bit grayscale are full resolution. 8 and 16 bit color are half resolution. Memory layout is modified to give the top most 4k of ram to the second core. Its MPU is used to prevent flash access after startup. The port saved word is moved to a watchdog scratch register so that it doesn't get overwritten by other things in RAM. Right align status bar and scroll area. This normally gives a few pixels of padding on the left hand side and improves the odds it is readable in a case. Fixes micropython#7562 Fixes c stack checking. The length was correct but the top was being set to the current stack pointer instead of the correct top. Fixes micropython#7643 This makes Bitmap subscr raise IndexError instead of ValueError when the index arguments are wrong.
The part where it fixes the stack crashes, has been tested by me and and Retiredwizard, across all esp mcu's. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Code looks good for consistency, etc. Other people tested the actual video, so I did not do that.
As discussed in Discord.. I think I reduced the code as much as I can... hopefully Tested in Problemimport board
import displayio
from bitmaptools import draw_line
display = board.DISPLAY
group = displayio.Group()
palette = displayio.Palette(1)
palette[0] = 0xFFFFFF
a2 = displayio.Group(x=0, y=0, scale=1)
a2bitmap = displayio.Bitmap(300, 300, 2)
tile2 = displayio.TileGrid(a2bitmap, pixel_shader=palette, x=0, y=0)
draw_line(a2bitmap, 1, 1, 1, 300, 1)
draw_line(a2bitmap, 1, 1, 200, 200, 1,)
a2.append(tile2)
group.append(a2)
display.show(group)
So Not sure if my display resolution is all wrong, but I should get 640x480? If it is my mistake, sorry :). |
The above message from @jposada202020 is discussed in #7894 (and is now a closed issue).
|
The picodvi PR #7880 switched the saved word to the watchdog register since it reworked the RAM layout. This works for reset_into_safe_mode because the watchdog scratch registers are preserved by soft resets. They *aren't* preserved for pressing the reset button. So it broken manual safe mode. Switch back to using RAM to store the saved word but use the pico-sdks "uninitialized" designation instead of a fixed location. Also fixes USB host feather status neopixel by setting the power pin.
PicoDVI in CP support 640x480 and 800x480 on Feather DVI, Pico and Pico W. 1 and 2 bit grayscale are full resolution. 8 and 16 bit color are half resolution.
Memory layout is modified to give the top most 4k of ram to the second core. Its MPU is used to prevent flash access after startup.
The port saved word is moved to a watchdog scratch register so that it doesn't get overwritten by other things in RAM.
Right align status bar and scroll area. This normally gives a few pixels of padding on the left hand side and improves the odds it is readable in a case. Fixes #7562
Fixes c stack checking. The length was correct but the top was being set to the current stack pointer instead of the correct top. Fixes #7643
This makes Bitmap subscr raise IndexError instead of ValueError when the index arguments are wrong.