Skip to content

Commit e8ceaf3

Browse files
committed
FramebufferDisplay: remove probably not needed constructor arguments
1 parent acee635 commit e8ceaf3

File tree

3 files changed

+11
-29
lines changed

3 files changed

+11
-29
lines changed

shared-bindings/framebufferio/FramebufferDisplay.c

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -54,41 +54,27 @@
5454
//|
5555
//| :param framebuffer: The framebuffer that the display is connected to
5656
//| :type framebuffer: any core object implementing the framebuffer protocol
57-
//| :param callback: Function or bound method to call when the framebuffer has been updated. The callback receives one argument, the framebuffer object.
5857
//| :param int width: Width in pixels
5958
//| :param int height: Height in pixels
60-
//| :param int colstart: The index if the first visible column
61-
//| :param int rowstart: The index if the first visible row
6259
//| :param int rotation: The rotation of the display in degrees clockwise. Must be in 90 degree increments (0, 90, 180, 270)
6360
//| :param int color_depth: The number of bits of color per pixel transmitted. (Some displays
6461
//| support 18 bit but 16 is easier to transmit. The last bit is extrapolated.)
65-
//| :param bool grayscale: True if the display only shows a single color.
66-
//| :param bool pixels_in_byte_share_row: True when pixels are less than a byte and a byte includes pixels from the same row of the display. When False, pixels share a column.
6762
//| :param int bytes_per_cell: Number of bytes per addressable memory location when color_depth < 8. When greater than one, bytes share a row or column according to pixels_in_byte_share_row.
68-
//| :param bool reverse_pixels_in_byte: Reverses the pixel order within each byte when color_depth < 8. Does not apply across multiple bytes even if there is more than one byte per cell (bytes_per_cell.)
69-
//| :param bool reverse_pixels_in_byte: Reverses the pixel order within each byte when color_depth < 8. Does not apply across multiple bytes even if there is more than one byte per cell (bytes_per_cell.)
70-
//| :param bool reverse_bytes_in_word: Reverses the order of bytes within a word when color_depth == 16
7163
//| :param microcontroller.Pin backlight_pin: Pin connected to the display's backlight
7264
//| :param bool brightness: Initial display brightness. This value is ignored if auto_brightness is True.
7365
//| :param bool auto_brightness: If True, brightness is controlled via an ambient light sensor or other mechanism.
7466
//| :param bool auto_refresh: Automatically refresh the screen
7567
//| :param int native_frames_per_second: Number of display refreshes per second
7668
//|
7769
STATIC mp_obj_t framebufferio_framebufferdisplay_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
78-
enum { ARG_framebuffer, ARG_width, ARG_height, ARG_colstart, ARG_rowstart, ARG_rotation, ARG_color_depth, ARG_grayscale, ARG_pixels_in_byte_share_row, ARG_bytes_per_cell, ARG_reverse_pixels_in_byte, ARG_reverse_bytes_in_word, ARG_backlight_pin, ARG_brightness, ARG_auto_brightness, ARG_auto_refresh, ARG_native_frames_per_second, NUM_ARGS };
70+
enum { ARG_framebuffer, ARG_width, ARG_height, ARG_rotation, ARG_color_depth, ARG_bytes_per_cell, ARG_backlight_pin, ARG_brightness, ARG_auto_brightness, ARG_auto_refresh, ARG_native_frames_per_second, NUM_ARGS };
7971
static const mp_arg_t allowed_args[] = {
8072
{ MP_QSTR_framebuffer, MP_ARG_REQUIRED | MP_ARG_OBJ },
8173
{ MP_QSTR_width, MP_ARG_INT | MP_ARG_KW_ONLY | MP_ARG_REQUIRED, },
8274
{ MP_QSTR_height, MP_ARG_INT | MP_ARG_KW_ONLY | MP_ARG_REQUIRED, },
83-
{ MP_QSTR_colstart, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} },
84-
{ MP_QSTR_rowstart, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} },
8575
{ MP_QSTR_rotation, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} },
8676
{ MP_QSTR_color_depth, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 16} },
87-
{ MP_QSTR_grayscale, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} },
88-
{ MP_QSTR_pixels_in_byte_share_row, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true} },
8977
{ MP_QSTR_bytes_per_cell, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 1} },
90-
{ MP_QSTR_reverse_pixels_in_byte, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} },
91-
{ MP_QSTR_reverse_bytes_in_word, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} },
9278
{ MP_QSTR_backlight_pin, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = mp_const_none} },
9379
{ MP_QSTR_brightness, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = MP_OBJ_NEW_SMALL_INT(1)} },
9480
{ MP_QSTR_auto_brightness, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} },
@@ -117,12 +103,9 @@ STATIC mp_obj_t framebufferio_framebufferdisplay_make_new(const mp_obj_type_t *t
117103
self,
118104
framebuffer,
119105
args[ARG_width].u_int, args[ARG_height].u_int,
120-
args[ARG_colstart].u_int, args[ARG_rowstart].u_int, rotation,
121-
args[ARG_color_depth].u_int, args[ARG_grayscale].u_bool,
122-
args[ARG_pixels_in_byte_share_row].u_bool,
123-
args[ARG_bytes_per_cell].u_bool,
124-
args[ARG_reverse_pixels_in_byte].u_bool,
125-
args[ARG_reverse_bytes_in_word].u_bool,
106+
rotation,
107+
args[ARG_color_depth].u_int,
108+
args[ARG_bytes_per_cell].u_int,
126109
MP_OBJ_TO_PTR(backlight_pin),
127110
brightness,
128111
args[ARG_auto_brightness].u_bool,

shared-bindings/framebufferio/FramebufferDisplay.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,8 @@ extern const mp_obj_type_t framebufferio_framebufferdisplay_type;
4040

4141
void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebufferdisplay_obj_t* self,
4242
mp_obj_t framebuffer, uint16_t width, uint16_t height,
43-
int16_t colstart, int16_t rowstart,
44-
uint16_t rotation, uint16_t color_depth, bool grayscale, bool pixels_in_byte_share_row,
45-
uint8_t bytes_per_cell, bool reverse_pixels_in_byte, bool reverse_bytes_in_word,
43+
uint16_t rotation, uint16_t color_depth,
44+
uint8_t bytes_per_cell,
4645
const mcu_pin_obj_t* backlight_pin, mp_float_t brightness, bool auto_brightness,
4746
bool auto_refresh, uint16_t native_frames_per_second);
4847

shared-module/framebufferio/FramebufferDisplay.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@
4242
#include "tick.h"
4343

4444
void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebufferdisplay_obj_t* self,
45-
mp_obj_t framebuffer, uint16_t width, uint16_t height, int16_t colstart, int16_t rowstart,
46-
uint16_t rotation, uint16_t color_depth, bool grayscale, bool pixels_in_byte_share_row,
47-
uint8_t bytes_per_cell, bool reverse_pixels_in_byte, bool reverse_bytes_in_word,
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,
4848
const mcu_pin_obj_t* backlight_pin, mp_float_t brightness, bool auto_brightness,
4949
bool auto_refresh, uint16_t native_frames_per_second) {
5050
// Turn off auto-refresh as we init.
@@ -55,8 +55,8 @@ void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebu
5555
uint16_t ram_width = 0x100;
5656
uint16_t ram_height = 0x100;
5757

58-
displayio_display_core_construct(&self->core, NULL, width, height, ram_width, ram_height, colstart, rowstart, rotation,
59-
color_depth, grayscale, pixels_in_byte_share_row, bytes_per_cell, reverse_pixels_in_byte, reverse_bytes_in_word);
58+
displayio_display_core_construct(&self->core, NULL, width, height, ram_width, ram_height, 0, 0, rotation,
59+
color_depth, false, false, bytes_per_cell, false, false);
6060

6161
self->auto_brightness = auto_brightness;
6262
self->first_manual_refresh = !auto_refresh;

0 commit comments

Comments
 (0)