Skip to content

Commit bea77c6

Browse files
committed
Minor renames
1 parent 7324b70 commit bea77c6

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

shared-bindings/displayio/Display.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self,
5050
bool common_hal_displayio_display_show(displayio_display_obj_t* self,
5151
displayio_group_t* root_group);
5252

53-
// Times in ms.
5453
bool common_hal_displayio_display_refresh(displayio_display_obj_t* self, uint32_t target_ms_per_frame, uint32_t maximum_ms_per_real_frame);
5554

5655
bool common_hal_displayio_display_get_auto_refresh(displayio_display_obj_t* self);

shared-module/displayio/Display.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,8 @@ STATIC bool _refresh_area(displayio_display_obj_t* self, const displayio_area_t*
270270
subrectangle_size_bytes = displayio_area_size(&subrectangle) / (8 / self->core.colorspace.depth);
271271
}
272272

273-
memset(mask, 0, mask_length * sizeof(uint32_t));
274-
memset(buffer, 0, buffer_size * sizeof(uint32_t));
273+
memset(mask, 0, mask_length * sizeof(mask[0]));
274+
memset(buffer, 0, buffer_size * sizeof(buffer[0]));
275275

276276
displayio_display_core_fill_area(&self->core, &subrectangle, mask, buffer);
277277

shared-module/displayio/EPaperDisplay.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void common_hal_displayio_epaperdisplay_construct(displayio_epaperdisplay_obj_t*
4949
uint16_t set_column_window_command, uint16_t set_row_window_command,
5050
uint16_t set_current_column_command, uint16_t set_current_row_command,
5151
uint16_t write_black_ram_command, bool black_bits_inverted, uint16_t write_color_ram_command, bool color_bits_inverted, uint32_t highlight_color, uint16_t refresh_display_command, mp_float_t refresh_time,
52-
const mcu_pin_obj_t* busy_pin, bool busy_state, mp_float_t seconds_per_frame, bool always_toggle_chip_select) {
52+
const mcu_pin_obj_t* busy_pin, bool busy_state, mp_float_t seconds_per_frame, bool chip_select) {
5353
if (highlight_color != 0x000000) {
5454
self->core.colorspace.tricolor = true;
5555
self->core.colorspace.tricolor_hue = displayio_colorconverter_compute_hue(highlight_color);
@@ -71,7 +71,7 @@ void common_hal_displayio_epaperdisplay_construct(displayio_epaperdisplay_obj_t*
7171
self->busy_state = busy_state;
7272
self->refreshing = false;
7373
self->milliseconds_per_frame = seconds_per_frame * 1000;
74-
self->always_toggle_chip_select = always_toggle_chip_select ? CHIP_SELECT_TOGGLE_EVERY_BYTE : CHIP_SELECT_UNTOUCHED;
74+
self->chip_select = chip_select ? CHIP_SELECT_TOGGLE_EVERY_BYTE : CHIP_SELECT_UNTOUCHED;
7575

7676
self->start_sequence = start_sequence;
7777
self->start_sequence_len = start_sequence_len;
@@ -143,8 +143,8 @@ STATIC void send_command_sequence(displayio_epaperdisplay_obj_t* self, bool shou
143143
data_size &= ~DELAY;
144144
uint8_t *data = cmd + 2;
145145
displayio_display_core_begin_transaction(&self->core);
146-
self->core.send(self->core.bus, DISPLAY_COMMAND, self->always_toggle_chip_select, cmd, 1);
147-
self->core.send(self->core.bus, DISPLAY_DATA, self->always_toggle_chip_select, data, data_size);
146+
self->core.send(self->core.bus, DISPLAY_COMMAND, self->chip_select, cmd, 1);
147+
self->core.send(self->core.bus, DISPLAY_DATA, self->chip_select, data, data_size);
148148
displayio_display_core_end_transaction(&self->core);
149149
uint16_t delay_length_ms = 0;
150150
if (delay) {
@@ -185,7 +185,7 @@ uint32_t common_hal_displayio_epaperdisplay_get_time_to_refresh(displayio_epaper
185185
void displayio_epaperdisplay_finish_refresh(displayio_epaperdisplay_obj_t* self) {
186186
// Actually refresh the display now that all pixel RAM has been updated.
187187
displayio_display_core_begin_transaction(&self->core);
188-
self->core.send(self->core.bus, DISPLAY_COMMAND, self->always_toggle_chip_select, &self->refresh_display_command, 1);
188+
self->core.send(self->core.bus, DISPLAY_COMMAND, self->chip_select, &self->refresh_display_command, 1);
189189
displayio_display_core_end_transaction(&self->core);
190190
self->refreshing = true;
191191

@@ -238,15 +238,15 @@ bool displayio_epaperdisplay_refresh_area(displayio_epaperdisplay_obj_t* self, c
238238
uint16_t remaining_rows = displayio_area_height(&clipped);
239239

240240
if (self->set_row_window_command != NO_COMMAND) {
241-
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->always_toggle_chip_select, &clipped);
241+
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);
242242
}
243243

244244
uint8_t write_command = self->write_black_ram_command;
245245
if (pass == 1) {
246246
write_command = self->write_color_ram_command;
247247
}
248248
displayio_display_core_begin_transaction(&self->core);
249-
self->core.send(self->core.bus, DISPLAY_COMMAND, self->always_toggle_chip_select, &write_command, 1);
249+
self->core.send(self->core.bus, DISPLAY_COMMAND, self->chip_select, &write_command, 1);
250250
displayio_display_core_end_transaction(&self->core);
251251

252252
for (uint16_t j = 0; j < subrectangles; j++) {
@@ -264,8 +264,8 @@ bool displayio_epaperdisplay_refresh_area(displayio_epaperdisplay_obj_t* self, c
264264

265265
uint16_t subrectangle_size_bytes = displayio_area_size(&subrectangle) / (8 / self->core.colorspace.depth);
266266

267-
memset(mask, 0, mask_length * sizeof(uint32_t));
268-
memset(buffer, 0, buffer_size * sizeof(uint32_t));
267+
memset(mask, 0, mask_length * sizeof(mask[0]));
268+
memset(buffer, 0, buffer_size * sizeof(buffer[0]));
269269

270270
self->core.colorspace.grayscale = true;
271271
if (pass == 1) {
@@ -285,7 +285,7 @@ bool displayio_epaperdisplay_refresh_area(displayio_epaperdisplay_obj_t* self, c
285285
// Can't acquire display bus; skip the rest of the data. Try next display.
286286
return false;
287287
}
288-
self->core.send(self->core.bus, DISPLAY_DATA, self->always_toggle_chip_select, (uint8_t*) buffer, subrectangle_size_bytes);
288+
self->core.send(self->core.bus, DISPLAY_DATA, self->chip_select, (uint8_t*) buffer, subrectangle_size_bytes);
289289
displayio_display_core_end_transaction(&self->core);
290290

291291
// TODO(tannewt): Make refresh displays faster so we don't starve other

shared-module/displayio/EPaperDisplay.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ typedef struct {
5656
bool black_bits_inverted;
5757
bool color_bits_inverted;
5858
bool refreshing;
59-
display_chip_select_behavior_t always_toggle_chip_select;
59+
display_chip_select_behavior_t chip_select;
6060
} displayio_epaperdisplay_obj_t;
6161

6262
void displayio_epaperdisplay_background(displayio_epaperdisplay_obj_t* self);

0 commit comments

Comments
 (0)