@@ -49,7 +49,7 @@ void common_hal_displayio_epaperdisplay_construct(displayio_epaperdisplay_obj_t*
49
49
uint16_t set_column_window_command , uint16_t set_row_window_command ,
50
50
uint16_t set_current_column_command , uint16_t set_current_row_command ,
51
51
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 ) {
53
53
if (highlight_color != 0x000000 ) {
54
54
self -> core .colorspace .tricolor = true;
55
55
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*
71
71
self -> busy_state = busy_state ;
72
72
self -> refreshing = false;
73
73
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 ;
75
75
76
76
self -> start_sequence = start_sequence ;
77
77
self -> start_sequence_len = start_sequence_len ;
@@ -143,8 +143,8 @@ STATIC void send_command_sequence(displayio_epaperdisplay_obj_t* self, bool shou
143
143
data_size &= ~DELAY ;
144
144
uint8_t * data = cmd + 2 ;
145
145
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 );
148
148
displayio_display_core_end_transaction (& self -> core );
149
149
uint16_t delay_length_ms = 0 ;
150
150
if (delay ) {
@@ -185,7 +185,7 @@ uint32_t common_hal_displayio_epaperdisplay_get_time_to_refresh(displayio_epaper
185
185
void displayio_epaperdisplay_finish_refresh (displayio_epaperdisplay_obj_t * self ) {
186
186
// Actually refresh the display now that all pixel RAM has been updated.
187
187
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 );
189
189
displayio_display_core_end_transaction (& self -> core );
190
190
self -> refreshing = true;
191
191
@@ -238,15 +238,15 @@ bool displayio_epaperdisplay_refresh_area(displayio_epaperdisplay_obj_t* self, c
238
238
uint16_t remaining_rows = displayio_area_height (& clipped );
239
239
240
240
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 );
242
242
}
243
243
244
244
uint8_t write_command = self -> write_black_ram_command ;
245
245
if (pass == 1 ) {
246
246
write_command = self -> write_color_ram_command ;
247
247
}
248
248
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 );
250
250
displayio_display_core_end_transaction (& self -> core );
251
251
252
252
for (uint16_t j = 0 ; j < subrectangles ; j ++ ) {
@@ -264,8 +264,8 @@ bool displayio_epaperdisplay_refresh_area(displayio_epaperdisplay_obj_t* self, c
264
264
265
265
uint16_t subrectangle_size_bytes = displayio_area_size (& subrectangle ) / (8 / self -> core .colorspace .depth );
266
266
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 ] ));
269
269
270
270
self -> core .colorspace .grayscale = true;
271
271
if (pass == 1 ) {
@@ -285,7 +285,7 @@ bool displayio_epaperdisplay_refresh_area(displayio_epaperdisplay_obj_t* self, c
285
285
// Can't acquire display bus; skip the rest of the data. Try next display.
286
286
return false;
287
287
}
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 );
289
289
displayio_display_core_end_transaction (& self -> core );
290
290
291
291
// TODO(tannewt): Make refresh displays faster so we don't starve other
0 commit comments