summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraskpatricw <4002194+askpatrickw@users.noreply.github.com>2020-10-22 21:59:54 -0700
committeraskpatricw <4002194+askpatrickw@users.noreply.github.com>2020-10-22 21:59:54 -0700
commite2c833adf468cd84f8dfcc03cf47de9da0c34b1f (patch)
tree272bbaac619885c9d3382045a5504bb06c38adb0
parente2b7fe3f0ecb0f3f49dcc9389bad1637fc7f901d (diff)
parent2581d099ca216e4979d812869e4e8ebf8adf7842 (diff)
Merge branch 'main' of https://github.com/adafruit/circuitpython into main
-rw-r--r--locale/es.po8
-rw-r--r--locale/fr.po8
-rw-r--r--locale/zh_Latn_pinyin.po8
-rw-r--r--shared-module/sharpdisplay/SharpMemoryFramebuffer.c20
4 files changed, 23 insertions, 21 deletions
diff --git a/locale/es.po b/locale/es.po
index 8cd5e6c22..b3a4333a8 100644
--- a/locale/es.po
+++ b/locale/es.po
@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-10-16 19:50-0500\n"
-"PO-Revision-Date: 2020-10-17 02:31+0000\n"
+"PO-Revision-Date: 2020-10-22 22:15+0000\n"
"Last-Translator: Alvaro Figueroa <alvaro@greencore.co.cr>\n"
"Language-Team: \n"
"Language: es\n"
@@ -16,7 +16,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 4.3.1-dev\n"
+"X-Generator: Weblate 4.3.1\n"
#: main.c
msgid ""
@@ -1434,7 +1434,7 @@ msgstr ""
#: shared-module/displayio/ColorConverter.c
msgid "Only one color can be transparent at a time"
-msgstr ""
+msgstr "Solo un color puede ser transparente a la vez"
#: shared-bindings/ipaddress/__init__.c
msgid "Only raw int supported for ip"
@@ -2175,7 +2175,7 @@ msgstr "buffer demasiado pequeño"
#: shared-bindings/socketpool/Socket.c
msgid "buffer too small for requested bytes"
-msgstr ""
+msgstr "búfer muy pequeño para los bytes solicitados"
#: shared-bindings/_pew/PewPew.c
msgid "buttons must be digitalio.DigitalInOut"
diff --git a/locale/fr.po b/locale/fr.po
index 9bfc14428..cf0ea4fc3 100644
--- a/locale/fr.po
+++ b/locale/fr.po
@@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: 0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-10-16 19:50-0500\n"
-"PO-Revision-Date: 2020-10-17 15:35+0000\n"
+"PO-Revision-Date: 2020-10-22 20:48+0000\n"
"Last-Translator: Antonin ENFRUN <antonin.e@me.com>\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
-"X-Generator: Weblate 4.3.1-dev\n"
+"X-Generator: Weblate 4.3.1\n"
#: main.c
msgid ""
@@ -1439,7 +1439,7 @@ msgstr ""
#: shared-module/displayio/ColorConverter.c
msgid "Only one color can be transparent at a time"
-msgstr ""
+msgstr "Une seule couleur peut être transparente à la fois"
#: shared-bindings/ipaddress/__init__.c
msgid "Only raw int supported for ip"
@@ -2185,7 +2185,7 @@ msgstr "tampon trop petit"
#: shared-bindings/socketpool/Socket.c
msgid "buffer too small for requested bytes"
-msgstr ""
+msgstr "tampon trop petit pour le nombre d'octets demandé"
#: shared-bindings/_pew/PewPew.c
msgid "buttons must be digitalio.DigitalInOut"
diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po
index 6ad1c722d..13d0dfa79 100644
--- a/locale/zh_Latn_pinyin.po
+++ b/locale/zh_Latn_pinyin.po
@@ -7,7 +7,7 @@ msgstr ""
"Project-Id-Version: circuitpython-cn\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-10-16 19:50-0500\n"
-"PO-Revision-Date: 2020-10-17 02:31+0000\n"
+"PO-Revision-Date: 2020-10-22 20:48+0000\n"
"Last-Translator: hexthat <hexthat@gmail.com>\n"
"Language-Team: Chinese Hanyu Pinyin\n"
"Language: zh_Latn_pinyin\n"
@@ -15,7 +15,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-"X-Generator: Weblate 4.3.1-dev\n"
+"X-Generator: Weblate 4.3.1\n"
#: main.c
msgid ""
@@ -1423,7 +1423,7 @@ msgstr ""
#: shared-module/displayio/ColorConverter.c
msgid "Only one color can be transparent at a time"
-msgstr ""
+msgstr "Yīcì zhǐ néng yǒuyī zhǒng yánsè shì tòumíng de"
#: shared-bindings/ipaddress/__init__.c
msgid "Only raw int supported for ip"
@@ -2153,7 +2153,7 @@ msgstr "huǎnchōng qū tài xiǎo"
#: shared-bindings/socketpool/Socket.c
msgid "buffer too small for requested bytes"
-msgstr ""
+msgstr "huǎn chōng qū tài xiǎo, duì yú qǐng qiú de zì jié"
#: shared-bindings/_pew/PewPew.c
msgid "buttons must be digitalio.DigitalInOut"
diff --git a/shared-module/sharpdisplay/SharpMemoryFramebuffer.c b/shared-module/sharpdisplay/SharpMemoryFramebuffer.c
index c23446828..b199e98d6 100644
--- a/shared-module/sharpdisplay/SharpMemoryFramebuffer.c
+++ b/shared-module/sharpdisplay/SharpMemoryFramebuffer.c
@@ -34,21 +34,22 @@
#include "shared-module/sharpdisplay/SharpMemoryFramebuffer.h"
#include "supervisor/memory.h"
+#include "supervisor/shared/safe_mode.h"
#define SHARPMEM_BIT_WRITECMD_LSB (0x80)
#define SHARPMEM_BIT_VCOM_LSB (0x40)
-static inline void *hybrid_alloc(size_t sz) {
- if (gc_alloc_possible()) {
- return m_malloc(sz + sizeof(void*), true);
- } else {
- supervisor_allocation *allocation = allocate_memory(align32_size(sz), false);
- if (!allocation) {
- return NULL;
- }
+static void *hybrid_alloc(size_t sz) {
+ supervisor_allocation *allocation = allocate_memory(align32_size(sz), false);
+ if (allocation) {
memset(allocation->ptr, 0, sz);
return allocation->ptr;
}
+ if (gc_alloc_possible()) {
+ return m_malloc(sz, true);
+ }
+ reset_into_safe_mode(MEM_MANAGE);
+ return NULL; // unreached
}
static inline void hybrid_free(void *ptr_in) {
@@ -155,7 +156,8 @@ void common_hal_sharpdisplay_framebuffer_construct(sharpdisplay_framebuffer_obj_
int row_stride = common_hal_sharpdisplay_framebuffer_get_row_stride(self);
self->bufinfo.len = row_stride * height + 2;
- self->bufinfo.buf = gc_alloc(self->bufinfo.len, false, true);
+ // re-use a supervisor allocation if possible
+ self->bufinfo.buf = hybrid_alloc(self->bufinfo.len);
uint8_t *data = self->bufinfo.buf;
*data++ = SHARPMEM_BIT_WRITECMD_LSB;