Requested changes take 1

This commit is contained in:
Mark Roberts 2020-09-25 21:27:29 -04:00
parent 19dbff67f2
commit b921543571
18 changed files with 41 additions and 36 deletions

View File

@ -110,7 +110,8 @@ void board_init(void) {
false, // data_as_commands
true, // auto_refresh
60, // native_frames_per_second
true); // backlight_on_high
true, // backlight_on_high
false); // not SH1107
}
bool board_requests_safe_mode(void) {

View File

@ -91,7 +91,8 @@ void board_init(void) {
false, // data_as_commands
true, // auto_refresh
60, // native_frames_per_second
true); // backlight_on_high
true, // backlight_on_high
false); // not SH1107
}
bool board_requests_safe_mode(void) {

View File

@ -92,7 +92,8 @@ void board_init(void) {
false, // data_as_commands
true, // auto_refresh
60, // native_frames_per_second
true); // backlight_on_high
true, // backlight_on_high
false); // SH1107_addressing
}
bool board_requests_safe_mode(void) {

View File

@ -143,7 +143,8 @@ void board_init(void) {
false, // data_as_commands
false, // auto_refresh
20, // native_frames_per_second
true); // backlight_on_high
true, // backlight_on_high
false); // SH1107_addressing
}
bool board_requests_safe_mode(void) {

View File

@ -114,7 +114,8 @@ void board_init(void) {
false, // data_as_commands
true, // auto_refresh
60, // native_frames_per_second
true); // backlight_on_high
true, // backlight_on_high
false); // SH1107_addressing
}
bool board_requests_safe_mode(void) {

View File

@ -92,7 +92,8 @@ void board_init(void) {
false, // data_as_commands
true, // auto_refresh
60, // native_frames_per_second
true); // backlight_on_high
true, // backlight_on_high
false); // SH1107_addressing
}
bool board_requests_safe_mode(void) {

View File

@ -114,7 +114,8 @@ void board_init(void) {
false, // data_as_commands
true, // auto_refresh
60, // native_frames_per_second
true); // backlight_on_high
true, // backlight_on_high
false); // SH1107_addressing
}
bool board_requests_safe_mode(void) {

View File

@ -92,7 +92,8 @@ void board_init(void) {
false, // data_as_commands
true, // auto_refresh
60, // native_frames_per_second
true); // backlight_on_high
true, // backlight_on_high
false); // SH1107_addressing
}
bool board_requests_safe_mode(void) {

View File

@ -100,7 +100,8 @@ void board_init(void) {
false, // data_as_commands
true, // auto_refresh
60, // native_frames_per_second
true); // backlight_on_high
true, // backlight_on_high
false); // SH1107_addressing
}
bool board_requests_safe_mode(void) {

View File

@ -117,7 +117,8 @@ void board_init(void) {
false, // data_as_commands
true, // auto_refresh
60, // native_frames_per_second
true); // backlight_on_high
true, // backlight_on_high
false); // SH1107_addressing
}
bool board_requests_safe_mode(void) {

View File

@ -105,7 +105,8 @@ void board_init(void) {
false, // data_as_commands
true, // auto_refresh
60, // native_frames_per_second
true); // backlight_on_high
true, // backlight_on_high
false); // SH1107_addressing
}
bool board_requests_safe_mode(void) {

View File

@ -91,7 +91,8 @@ void board_init(void) {
false, // data_as_commands
true, // auto_refresh
60, // native_frames_per_second
true); // backlight_on_high
true, // backlight_on_high
false); // not SH1107
}
bool board_requests_safe_mode(void) {

View File

@ -92,7 +92,8 @@ void board_init(void) {
false, // data_as_commands
true, // auto_refresh
60, // native_frames_per_second
true); // backlight_on_high
true, // backlight_on_high
false); // SH1107_addressing
}
bool board_requests_safe_mode(void) {

View File

@ -92,7 +92,8 @@ void board_init(void) {
false, // data_as_commands
true, // auto_refresh
60, // native_frames_per_second
true); // backlight_on_high
true, // backlight_on_high
false); // SH1107_addressing
}
bool board_requests_safe_mode(void) {

View File

@ -91,7 +91,8 @@ void board_init(void) {
false, // data_as_commands
true, // auto_refresh
60, // native_frames_per_second
false); // backlight_on_high
false, // backlight_on_high
false); // SH1107_addressing
}
bool board_requests_safe_mode(void) {

View File

@ -111,7 +111,8 @@ void board_init(void) {
false, // data_as_commands
true, // auto_refresh
60, // native_frames_per_second
true); // backlight_on_high
true, // backlight_on_high
false); // SH1107_addressing
}
bool board_requests_safe_mode(void) {

View File

@ -252,14 +252,8 @@ STATIC bool _refresh_area(displayio_display_obj_t* self, const displayio_area_t*
// write one single row at a time
if (self->SH1107_addressing) {
subrectangles = rows_per_buffer; // vertical (column mode) write each separately (height times)
}
// Skip this recalculation of subrectangles if SH1107 (each subrectangle is a single row)
// [mdroberts1243] I am worried/confused about the pixels_in_byte_share_row calculation though
// since it makes sense to be on a byte boundary (actually a page boundary too)
// seems to work as is though.
if ((displayio_area_size(&clipped) > buffer_size * pixels_per_word)
&& (!self->SH1107_addressing)) {
rows_per_buffer = 1;
} else if (displayio_area_size(&clipped) > buffer_size * pixels_per_word) {
rows_per_buffer = buffer_size * pixels_per_word / displayio_area_width(&clipped);
if (rows_per_buffer == 0) {
rows_per_buffer = 1;
@ -297,18 +291,13 @@ STATIC bool _refresh_area(displayio_display_obj_t* self, const displayio_area_t*
.y2 = clipped.y1 + rows_per_buffer * (j + 1)
};
if (self->SH1107_addressing) {
// one row only for SH1107 in vertical (column) mode
subrectangle.y1 = clipped.y1 + j;
subrectangle.y2 = clipped.y1 + (j + 1);
};
if ((remaining_rows < rows_per_buffer) && (!self->SH1107_addressing)) {
// one row only for SH1107 in vertical (column) mode
subrectangle.y1 = clipped.y1 + j;
subrectangle.y2 = clipped.y1 + (j + 1);
} else if (remaining_rows < rows_per_buffer) {
subrectangle.y2 = subrectangle.y1 + remaining_rows;
}
if (self->SH1107_addressing) {
remaining_rows -= 1;
} else {
remaining_rows -= rows_per_buffer;
}
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,

View File

@ -41,7 +41,7 @@
#include <string.h>
#define DISPLAYIO_CORE_DEBUG(...) (void)0
//#define DISPLAYIO_CORE_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__)
// #define DISPLAYIO_CORE_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__)
void displayio_display_core_construct(displayio_display_core_t* self,
mp_obj_t bus, uint16_t width, uint16_t height, uint16_t ram_width, uint16_t ram_height, int16_t colstart, int16_t rowstart, uint16_t rotation,
@ -322,7 +322,7 @@ void displayio_display_core_start_refresh(displayio_display_core_t* self) {
void displayio_display_core_finish_refresh(displayio_display_core_t* self) {
if (self->current_group != NULL) {
// DISPLAYIO_CORE_DEBUG("displayiocore group_finish_refresh\n");
DISPLAYIO_CORE_DEBUG("displayiocore group_finish_refresh\n");
displayio_group_finish_refresh(self->current_group);
}
self->full_refresh = false;