File tree Expand file tree Collapse file tree 3 files changed +24
-4
lines changed
Expand file tree Collapse file tree 3 files changed +24
-4
lines changed Original file line number Diff line number Diff line change 4242 dc = LCD_DC ,
4343 cs = LCD_CS ,
4444)
45+
46+ # lv.color_format_get_size(lv.COLOR_FORMAT.RGB565) = 2 bytes per pixel * 320 * 240 px = 153600 bytes
47+ # The default was /10 so 15360 bytes.
48+ # /2 = 76800 shows something on display and then hangs the board
49+ # /2 = 38400 works and pretty high framerate but camera gets ESP_FAIL
50+ # /2 = 19200 works, including camera at 9FPS
51+ # 28800 is between the two and still works with camera!
52+ # 30720 is /5 and is already too much
53+ BUFFER_SIZE = const (28800 )
54+ fb1 = display_bus .allocate_framebuffer (_BUFFER_SIZE , lcd_bus .MEMORY_INTERNAL | lcd_bus .MEMORY_DMA )
55+ fb2 = display_bus .allocate_framebuffer (_BUFFER_SIZE , lcd_bus .MEMORY_INTERNAL | lcd_bus .MEMORY_DMA )
56+
4557display = st7789 .ST7789 (
4658 data_bus = display_bus ,
59+ frame_buffer1 = fb1 ,
60+ frame_buffer2 = fb2 ,
4761 display_width = TFT_VER_RES ,
4862 display_height = TFT_HOR_RES ,
4963 backlight_pin = LCD_BL ,
6276indev = cst816s .CST816S (touch_dev ,startup_rotation = lv .DISPLAY_ROTATION ._180 ) # button in top left, good
6377
6478lv .init ()
65- display .set_rotation (lv .DISPLAY_ROTATION ._90 )
79+ display .set_rotation (lv .DISPLAY_ROTATION ._90 ) # must be done after initializing display and creating the touch drivers, to ensure proper handling
6680
6781# Gesture IDs:
6882# 0: press
Original file line number Diff line number Diff line change 33import machine
44
55# Constants
6- CURRENT_OS_VERSION = "0.0.3 "
6+ CURRENT_OS_VERSION = "0.0.4 "
77TFT_HOR_RES = 320
88TFT_VER_RES = 240
99NOTIFICATION_BAR_HEIGHT = 24
1818SLIDER_MAX_VALUE = 100
1919SLIDER_DEFAULT_VALUE = 100
2020
21- CLOCK_UPDATE_INTERVAL = 100 # 10 or even 1 ms doesn't seem to change the framerate but 100ms is enough
21+ CLOCK_UPDATE_INTERVAL = 1000 # 10 or even 1 ms doesn't seem to change the framerate but 100ms is enough
2222WIFI_ICON_UPDATE_INTERVAL = 1500
2323TEMPERATURE_UPDATE_INTERVAL = 2000
2424MEMFREE_UPDATE_INTERVAL = 5000 # not too frequent because there's a forced gc.collect() to give it a reliable value
2929drawer_open = False
3030bar_open = True
3131
32- th = task_handler .TaskHandler (duration = 6 )
32+ # lowering the duration from default 33 to 6 seems to increase the camera framerate from 5.5 to 9 and the UI framerate from 15 to 20fps
33+ # lowering to 1 doesn't seem to help out the camera framerate (so it's maxed out) but the UI goes to 26 FPS with it!
34+ #th = task_handler.TaskHandler()
35+ th = task_handler .TaskHandler (duration = 1 )
3336
3437rootscreen = lv .screen_active ()
3538rootlabel = lv .label (rootscreen )
Original file line number Diff line number Diff line change 2222
2323python3 make.py --ota --partition-size=4194304 --flash-size=16 esp32 BOARD=ESP32_GENERIC_S3 BOARD_VARIANT=SPIRAM_OCT DISPLAY=st7789 INDEV=cst816s USER_C_MODULE=" /home/user/sources/micropython-camera-API/src/micropython.cmake" " $manifest "
2424
25+ # build for unix:
26+ # python3 make.py unix DISPLAY=sdl_display INDEV=sdl_pointer
27+
2528popd
You can’t perform that action at this time.
0 commit comments