summaryrefslogtreecommitdiff
path: root/supervisor
diff options
context:
space:
mode:
authorScott Shawcroft <scott@tannewt.org>2019-01-29 15:04:07 -0800
committerScott Shawcroft <scott@tannewt.org>2019-01-31 11:42:14 -0800
commit601a910f4eb83cf1ae7516a25c011b469ac76b8b (patch)
tree54b8921c1f6efb0826fe9c011956d79dbfb292f5 /supervisor
parent6145f08cc89946d138737b149d390265def67077 (diff)
More improvements to Terminal:
* Fix Hallowing. * Fix builds without displayio. * Fix y bounds that appears as untrollable row of pixels. * Add scrolling to TileGrid. * Remove Sprite to save space. TileGrid is a drop in replacement.
Diffstat (limited to 'supervisor')
-rw-r--r--supervisor/shared/display.c21
-rw-r--r--supervisor/shared/serial.c4
2 files changed, 20 insertions, 5 deletions
diff --git a/supervisor/shared/display.c b/supervisor/shared/display.c
index 18693266f..bef9247c0 100644
--- a/supervisor/shared/display.c
+++ b/supervisor/shared/display.c
@@ -87,6 +87,7 @@ void supervisor_stop_terminal(void) {
}
void supervisor_display_move_memory(void) {
+ #if CIRCUITPY_DISPLAYIO
displayio_tilegrid_t* grid = &supervisor_terminal_text_grid;
if (MP_STATE_VM(terminal_tilegrid_tiles) == NULL || grid->tiles != MP_STATE_VM(terminal_tilegrid_tiles)) {
return;
@@ -102,6 +103,7 @@ void supervisor_display_move_memory(void) {
grid->inline_tiles = false;
}
MP_STATE_VM(terminal_tilegrid_tiles) = NULL;
+ #endif
}
uint32_t blinka_bitmap_data[32] = {
@@ -149,15 +151,24 @@ displayio_palette_t blinka_palette = {
.needs_refresh = false
};
-displayio_sprite_t blinka_sprite = {
- .base = {.type = &displayio_sprite_type },
+displayio_tilegrid_t blinka_sprite = {
+ .base = {.type = &displayio_tilegrid_type },
.bitmap = &blinka_bitmap,
.pixel_shader = &blinka_palette,
.x = 0,
.y = 0,
- .width = 16,
- .height = 16,
- .needs_refresh = false
+ .bitmap_width_in_tiles = 1,
+ .width_in_tiles = 1,
+ .height_in_tiles = 1,
+ .total_width = 16,
+ .total_height = 16,
+ .tile_width = 16,
+ .tile_height = 16,
+ .top_left_x = 16,
+ .top_left_y = 16,
+ .tiles = 0,
+ .needs_refresh = false,
+ .inline_tiles = true
};
mp_obj_t splash_children[2] = {
diff --git a/supervisor/shared/serial.c b/supervisor/shared/serial.c
index ac5239a84..ed210416f 100644
--- a/supervisor/shared/serial.c
+++ b/supervisor/shared/serial.c
@@ -26,6 +26,8 @@
#include <string.h>
+#include "py/mpconfig.h"
+
#include "supervisor/shared/display.h"
#include "shared-bindings/terminalio/Terminal.h"
#include "supervisor/serial.h"
@@ -50,8 +52,10 @@ bool serial_bytes_available(void) {
}
void serial_write_substring(const char* text, uint32_t length) {
+ #if CIRCUITPY_DISPLAYIO
int errcode;
common_hal_terminalio_terminal_write(&supervisor_terminal, (const uint8_t*) text, length, &errcode);
+ #endif
if (!tud_cdc_connected()) {
return;
}