Ran pre-commit locally

This commit is contained in:
Mark Roberts 2020-09-29 15:37:06 -04:00 committed by Scott Shawcroft
parent b1e1237887
commit 9f19a8a760
No known key found for this signature in database
GPG Key ID: 0DFD512649C052DA
6 changed files with 22 additions and 22 deletions

View File

@ -111,15 +111,15 @@
//| :param bool backlight_on_high: If True, pulling the backlight pin high turns the backlight on."""
//| ...
//|
STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_args,
STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_args,
const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_display_bus, ARG_init_sequence, 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_set_column_command, ARG_set_row_command, ARG_write_ram_command,
ARG_set_vertical_scroll, ARG_backlight_pin, ARG_brightness_command,
ARG_brightness, ARG_auto_brightness, ARG_single_byte_bounds, ARG_data_as_commands,
ARG_auto_refresh, ARG_native_frames_per_second, ARG_backlight_on_high,
enum { ARG_display_bus, ARG_init_sequence, 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_set_column_command, ARG_set_row_command, ARG_write_ram_command,
ARG_set_vertical_scroll, ARG_backlight_pin, ARG_brightness_command,
ARG_brightness, ARG_auto_brightness, ARG_single_byte_bounds, ARG_data_as_commands,
ARG_auto_refresh, ARG_native_frames_per_second, ARG_backlight_on_high,
ARG_SH1107_addressing };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_display_bus, MP_ARG_REQUIRED | MP_ARG_OBJ },

View File

@ -45,7 +45,7 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self,
uint8_t set_column_command, uint8_t set_row_command, uint8_t write_ram_command, uint8_t set_vertical_scroll,
uint8_t* init_sequence, uint16_t init_sequence_len, const mcu_pin_obj_t* backlight_pin, uint16_t brightness_command,
mp_float_t brightness, bool auto_brightness,
bool single_byte_bounds, bool data_as_commands, bool auto_refresh, uint16_t native_frames_per_second,
bool single_byte_bounds, bool data_as_commands, bool auto_refresh, uint16_t native_frames_per_second,
bool backlight_on_high, bool SH1107_addressing);
bool common_hal_displayio_display_show(displayio_display_obj_t* self,

View File

@ -48,7 +48,7 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self,
uint8_t set_row_command, uint8_t write_ram_command, uint8_t set_vertical_scroll,
uint8_t* init_sequence, uint16_t init_sequence_len, const mcu_pin_obj_t* backlight_pin,
uint16_t brightness_command, mp_float_t brightness, bool auto_brightness,
bool single_byte_bounds, bool data_as_commands, bool auto_refresh, uint16_t native_frames_per_second,
bool single_byte_bounds, bool data_as_commands, bool auto_refresh, uint16_t native_frames_per_second,
bool backlight_on_high, bool SH1107_addressing) {
// Turn off auto-refresh as we init.
@ -246,7 +246,7 @@ STATIC bool _refresh_area(displayio_display_obj_t* self, const displayio_area_t*
uint16_t rows_per_buffer = displayio_area_height(&clipped);
uint8_t pixels_per_word = (sizeof(uint32_t) * 8) / self->core.colorspace.depth;
uint16_t pixels_per_buffer = displayio_area_size(&clipped);
uint16_t subrectangles = 1;
// for SH1107 and other boundary constrained controllers
// write one single row at a time
@ -299,8 +299,8 @@ STATIC bool _refresh_area(displayio_display_obj_t* self, const displayio_area_t*
}
remaining_rows -= rows_per_buffer;
displayio_display_core_set_region_to_update(&self->core, self->set_column_command,
self->set_row_command, NO_COMMAND, NO_COMMAND, self->data_as_commands, false,
displayio_display_core_set_region_to_update(&self->core, self->set_column_command,
self->set_row_command, NO_COMMAND, NO_COMMAND, self->data_as_commands, false,
&subrectangle, self->SH1107_addressing);
uint16_t subrectangle_size_bytes;

View File

@ -240,8 +240,8 @@ bool displayio_epaperdisplay_refresh_area(displayio_epaperdisplay_obj_t* self, c
// added false parameter at end for SH1107_addressing quirk
if (self->set_row_window_command != NO_COMMAND) {
displayio_display_core_set_region_to_update(&self->core, self->set_column_window_command,
self->set_row_window_command, self->set_current_column_command, self->set_current_row_command,
displayio_display_core_set_region_to_update(&self->core, self->set_column_window_command,
self->set_row_window_command, self->set_current_column_command, self->set_current_row_command,
false, self->chip_select, &clipped, false);
}

View File

@ -57,7 +57,7 @@ void displayio_display_core_construct(displayio_display_core_t* self,
self->colstart = colstart;
self->rowstart = rowstart;
self->last_refresh = 0;
// (framebufferdisplay already validated its 'bus' is a buffer-protocol object)
if (bus) {
if (MP_OBJ_IS_TYPE(bus, &displayio_parallelbus_type)) {
@ -208,9 +208,9 @@ void displayio_display_core_end_transaction(displayio_display_core_t* self) {
self->end_transaction(self->bus);
}
void displayio_display_core_set_region_to_update(displayio_display_core_t* self, uint8_t column_command,
uint8_t row_command, uint16_t set_current_column_command, uint16_t set_current_row_command,
bool data_as_commands, bool always_toggle_chip_select,
void displayio_display_core_set_region_to_update(displayio_display_core_t* self, uint8_t column_command,
uint8_t row_command, uint16_t set_current_column_command, uint16_t set_current_row_command,
bool data_as_commands, bool always_toggle_chip_select,
displayio_area_t* area, bool SH1107_addressing) {
uint16_t x1 = area->x1;
uint16_t x2 = area->x2;

View File

@ -74,9 +74,9 @@ bool displayio_display_core_bus_free(displayio_display_core_t *self);
bool displayio_display_core_begin_transaction(displayio_display_core_t* self);
void displayio_display_core_end_transaction(displayio_display_core_t* self);
void displayio_display_core_set_region_to_update(displayio_display_core_t* self, uint8_t column_command,
uint8_t row_command, uint16_t set_current_column_command, uint16_t set_current_row_command,
bool data_as_commands, bool always_toggle_chip_select,
void displayio_display_core_set_region_to_update(displayio_display_core_t* self, uint8_t column_command,
uint8_t row_command, uint16_t set_current_column_command, uint16_t set_current_row_command,
bool data_as_commands, bool always_toggle_chip_select,
displayio_area_t* area, bool SH1107_addressing);
void release_display_core(displayio_display_core_t* self);