diff options
| author | microDev <70126934+microDev1@users.noreply.github.com> | 2020-11-26 11:33:45 +0530 |
|---|---|---|
| committer | microDev <70126934+microDev1@users.noreply.github.com> | 2020-11-26 11:33:45 +0530 |
| commit | e90cb3ad866d418803768f3a58154e0039478e56 (patch) | |
| tree | 4b1d086fb43e11e1928a3c6cc9bd731c1d50407c /shared-module | |
| parent | 6af48bb24cc12a9547aef8d18d56acf8e0f5695d (diff) | |
| parent | e778fc1f876116fd8f07b95f9eb8439745988fba (diff) | |
Merge branch 'main' into fix-touch
Diffstat (limited to 'shared-module')
| -rw-r--r-- | shared-module/displayio/EPaperDisplay.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/shared-module/displayio/EPaperDisplay.c b/shared-module/displayio/EPaperDisplay.c index 1b285b4b1..3fb37ff21 100644 --- a/shared-module/displayio/EPaperDisplay.c +++ b/shared-module/displayio/EPaperDisplay.c @@ -198,6 +198,29 @@ mp_obj_t common_hal_displayio_epaperdisplay_get_bus(displayio_epaperdisplay_obj_ return self->core.bus; } +void common_hal_displayio_epaperdisplay_set_rotation(displayio_epaperdisplay_obj_t* self, int rotation){ + bool transposed = (self->core.rotation == 90 || self->core.rotation == 270); + bool will_transposed = (rotation == 90 || rotation == 270); + if(transposed != will_transposed) { + int tmp = self->core.width; + self->core.width = self->core.height; + self->core.height = tmp; + } + displayio_display_core_set_rotation(&self->core, rotation); + if (self == &displays[0].epaper_display) { + supervisor_stop_terminal(); + supervisor_start_terminal(self->core.width, self->core.height); + } + if (self->core.current_group != NULL) { + displayio_group_update_transform(self->core.current_group, &self->core.transform); + } +} + +uint16_t common_hal_displayio_epaperdisplay_get_rotation(displayio_epaperdisplay_obj_t* self){ + return self->core.rotation; +} + + bool displayio_epaperdisplay_refresh_area(displayio_epaperdisplay_obj_t* self, const displayio_area_t* area) { uint16_t buffer_size = 128; // In uint32_ts |
