summaryrefslogtreecommitdiff
path: root/supervisor
diff options
context:
space:
mode:
authorScott Shawcroft <scott@tannewt.org>2020-04-14 17:14:44 -0700
committerScott Shawcroft <scott@tannewt.org>2020-04-14 17:14:44 -0700
commitb580b34cbf1c48ef3de1dbeb5f44ec3d06b704af (patch)
tree9ec02ce5a6e78fb0383058972d09938813f39db3 /supervisor
parent7dfcae6067ee07ad644278a66aaa114759b181a8 (diff)
parent7ed1483b89d24bb4dd44f9c4c8271c438303b9fe (diff)
Merge remote-tracking branch 'adafruit/master' into lower_power
Diffstat (limited to 'supervisor')
-rwxr-xr-xsupervisor/memory.h1
-rw-r--r--supervisor/shared/display.c22
-rwxr-xr-xsupervisor/shared/memory.c11
3 files changed, 28 insertions, 6 deletions
diff --git a/supervisor/memory.h b/supervisor/memory.h
index f557744ae..f4359ca46 100755
--- a/supervisor/memory.h
+++ b/supervisor/memory.h
@@ -43,6 +43,7 @@ typedef struct {
void memory_init(void);
void free_memory(supervisor_allocation* allocation);
+supervisor_allocation* allocation_from_ptr(void *ptr);
supervisor_allocation* allocate_remaining_memory(void);
// Allocate a piece of a given length in bytes. If high_address is true then it should be allocated
diff --git a/supervisor/shared/display.c b/supervisor/shared/display.c
index 855432d64..95926bc9c 100644
--- a/supervisor/shared/display.c
+++ b/supervisor/shared/display.c
@@ -34,6 +34,10 @@
#include "shared-bindings/displayio/TileGrid.h"
#include "supervisor/memory.h"
+#if CIRCUITPY_PROTOMATTER
+#include "shared-module/displayio/__init__.h"
+#endif
+
extern size_t blinka_bitmap_data[];
extern displayio_bitmap_t blinka_bitmap;
extern displayio_group_t circuitpython_splash;
@@ -112,6 +116,14 @@ void supervisor_display_move_memory(void) {
grid->inline_tiles = false;
}
MP_STATE_VM(terminal_tilegrid_tiles) = NULL;
+ #if CIRCUITPY_PROTOMATTER
+ for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) {
+ if (displays[i].protomatter.base.type == &protomatter_Protomatter_type) {
+ protomatter_protomatter_obj_t * pm = &displays[i].protomatter;
+ common_hal_protomatter_protomatter_reconstruct(pm, NULL);
+ }
+ }
+ #endif
#endif
}
@@ -157,28 +169,28 @@ _displayio_color_t blinka_colors[7] = {
},
{
.rgb888 = 0x8428bc,
- .rgb565 = 0x7889,
+ .rgb565 = 0x8978,
.luma = 0xff, // We cheat the luma here. It is actually 0x60
.hue = 184,
.chroma = 148
},
{
.rgb888 = 0xff89bc,
- .rgb565 = 0xB8FC,
+ .rgb565 = 0xFCB8,
.luma = 0xb5,
.hue = 222,
.chroma = 118
},
{
.rgb888 = 0x7beffe,
- .rgb565 = 0x9F86,
+ .rgb565 = 0x869F,
.luma = 0xe0,
.hue = 124,
.chroma = 131
},
{
.rgb888 = 0x51395f,
- .rgb565 = 0x0D5A,
+ .rgb565 = 0x5A0D,
.luma = 0x47,
.hue = 185,
.chroma = 38
@@ -191,7 +203,7 @@ _displayio_color_t blinka_colors[7] = {
},
{
.rgb888 = 0x0736a0,
- .rgb565 = 0xf501,
+ .rgb565 = 0x01f5,
.luma = 0x44,
.hue = 147,
.chroma = 153
diff --git a/supervisor/shared/memory.c b/supervisor/shared/memory.c
index 14c3b4979..d52334eb4 100755
--- a/supervisor/shared/memory.c
+++ b/supervisor/shared/memory.c
@@ -31,7 +31,7 @@
#include "supervisor/shared/display.h"
-#define CIRCUITPY_SUPERVISOR_ALLOC_COUNT 8
+#define CIRCUITPY_SUPERVISOR_ALLOC_COUNT (12)
static supervisor_allocation allocations[CIRCUITPY_SUPERVISOR_ALLOC_COUNT];
// We use uint32_t* to ensure word (4 byte) alignment.
@@ -82,6 +82,15 @@ void free_memory(supervisor_allocation* allocation) {
allocation->ptr = NULL;
}
+supervisor_allocation* allocation_from_ptr(void *ptr) {
+ for (size_t index = 0; index < CIRCUITPY_SUPERVISOR_ALLOC_COUNT; index++) {
+ if (allocations[index].ptr == ptr) {
+ return &allocations[index];
+ }
+ }
+ return NULL;
+}
+
supervisor_allocation* allocate_remaining_memory(void) {
if (low_address == high_address) {
return NULL;