42
42
#include "tick.h"
43
43
44
44
void common_hal_framebufferio_framebufferdisplay_construct (framebufferio_framebufferdisplay_obj_t * self ,
45
- mp_obj_t framebuffer , uint16_t width , uint16_t height ,
46
- uint16_t rotation , uint16_t color_depth ,
47
- uint8_t bytes_per_cell ,
48
- bool auto_refresh , uint16_t native_frames_per_second ) {
45
+ mp_obj_t framebuffer ,
46
+ uint16_t rotation ,
47
+ bool auto_refresh ) {
49
48
// Turn off auto-refresh as we init.
50
49
self -> auto_refresh = false;
51
50
self -> framebuffer = framebuffer ;
@@ -54,15 +53,29 @@ void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebu
54
53
uint16_t ram_width = 0x100 ;
55
54
uint16_t ram_height = 0x100 ;
56
55
57
- displayio_display_core_construct (& self -> core , NULL , width , height , ram_width , ram_height , 0 , 0 , rotation ,
58
- color_depth , false, false, bytes_per_cell , false, false);
56
+ displayio_display_core_construct (
57
+ & self -> core ,
58
+ NULL ,
59
+ self -> framebuffer_protocol -> get_width (self -> framebuffer ),
60
+ self -> framebuffer_protocol -> get_height (self -> framebuffer ),
61
+ ram_width ,
62
+ ram_height ,
63
+ 0 ,
64
+ 0 ,
65
+ rotation ,
66
+ self -> framebuffer_protocol -> get_color_depth (self -> framebuffer ),
67
+ false,
68
+ false,
69
+ self -> framebuffer_protocol -> get_bytes_per_cell (self -> framebuffer ),
70
+ false,
71
+ false);
59
72
60
73
self -> first_manual_refresh = !auto_refresh ;
61
74
62
- self -> native_frames_per_second = native_frames_per_second ;
63
- self -> native_ms_per_frame = 1000 / native_frames_per_second ;
75
+ self -> native_frames_per_second = self -> framebuffer_protocol -> get_native_frames_per_second ( self -> framebuffer ) ;
76
+ self -> native_ms_per_frame = 1000 / self -> native_frames_per_second ;
64
77
65
- supervisor_start_terminal (width , height );
78
+ supervisor_start_terminal (self -> core . width , self -> core . height );
66
79
67
80
// Set the group after initialization otherwise we may send pixels while we delay in
68
81
// initialization.
0 commit comments