Skip to content

Commit e2c833a

Browse files
committed
Merge branch 'main' of https://github.com/adafruit/circuitpython into main
2 parents e2b7fe3 + 2581d09 commit e2c833a

File tree

4 files changed

+23
-21
lines changed

4 files changed

+23
-21
lines changed

locale/es.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ msgstr ""
88
"Project-Id-Version: \n"
99
"Report-Msgid-Bugs-To: \n"
1010
"POT-Creation-Date: 2020-10-16 19:50-0500\n"
11-
"PO-Revision-Date: 2020-10-17 02:31+0000\n"
11+
"PO-Revision-Date: 2020-10-22 22:15+0000\n"
1212
"Last-Translator: Alvaro Figueroa <[email protected]>\n"
1313
"Language-Team: \n"
1414
"Language: es\n"
1515
"MIME-Version: 1.0\n"
1616
"Content-Type: text/plain; charset=UTF-8\n"
1717
"Content-Transfer-Encoding: 8bit\n"
1818
"Plural-Forms: nplurals=2; plural=n != 1;\n"
19-
"X-Generator: Weblate 4.3.1-dev\n"
19+
"X-Generator: Weblate 4.3.1\n"
2020

2121
#: main.c
2222
msgid ""
@@ -1434,7 +1434,7 @@ msgstr ""
14341434

14351435
#: shared-module/displayio/ColorConverter.c
14361436
msgid "Only one color can be transparent at a time"
1437-
msgstr ""
1437+
msgstr "Solo un color puede ser transparente a la vez"
14381438

14391439
#: shared-bindings/ipaddress/__init__.c
14401440
msgid "Only raw int supported for ip"
@@ -2175,7 +2175,7 @@ msgstr "buffer demasiado pequeño"
21752175

21762176
#: shared-bindings/socketpool/Socket.c
21772177
msgid "buffer too small for requested bytes"
2178-
msgstr ""
2178+
msgstr "búfer muy pequeño para los bytes solicitados"
21792179

21802180
#: shared-bindings/_pew/PewPew.c
21812181
msgid "buttons must be digitalio.DigitalInOut"

locale/fr.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ msgstr ""
88
"Project-Id-Version: 0.1\n"
99
"Report-Msgid-Bugs-To: \n"
1010
"POT-Creation-Date: 2020-10-16 19:50-0500\n"
11-
"PO-Revision-Date: 2020-10-17 15:35+0000\n"
11+
"PO-Revision-Date: 2020-10-22 20:48+0000\n"
1212
"Last-Translator: Antonin ENFRUN <[email protected]>\n"
1313
"Language: fr\n"
1414
"MIME-Version: 1.0\n"
1515
"Content-Type: text/plain; charset=utf-8\n"
1616
"Content-Transfer-Encoding: 8bit\n"
1717
"Plural-Forms: nplurals=2; plural=n > 1;\n"
18-
"X-Generator: Weblate 4.3.1-dev\n"
18+
"X-Generator: Weblate 4.3.1\n"
1919

2020
#: main.c
2121
msgid ""
@@ -1439,7 +1439,7 @@ msgstr ""
14391439

14401440
#: shared-module/displayio/ColorConverter.c
14411441
msgid "Only one color can be transparent at a time"
1442-
msgstr ""
1442+
msgstr "Une seule couleur peut être transparente à la fois"
14431443

14441444
#: shared-bindings/ipaddress/__init__.c
14451445
msgid "Only raw int supported for ip"
@@ -2185,7 +2185,7 @@ msgstr "tampon trop petit"
21852185

21862186
#: shared-bindings/socketpool/Socket.c
21872187
msgid "buffer too small for requested bytes"
2188-
msgstr ""
2188+
msgstr "tampon trop petit pour le nombre d'octets demandé"
21892189

21902190
#: shared-bindings/_pew/PewPew.c
21912191
msgid "buttons must be digitalio.DigitalInOut"

locale/zh_Latn_pinyin.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ msgstr ""
77
"Project-Id-Version: circuitpython-cn\n"
88
"Report-Msgid-Bugs-To: \n"
99
"POT-Creation-Date: 2020-10-16 19:50-0500\n"
10-
"PO-Revision-Date: 2020-10-17 02:31+0000\n"
10+
"PO-Revision-Date: 2020-10-22 20:48+0000\n"
1111
"Last-Translator: hexthat <[email protected]>\n"
1212
"Language-Team: Chinese Hanyu Pinyin\n"
1313
"Language: zh_Latn_pinyin\n"
1414
"MIME-Version: 1.0\n"
1515
"Content-Type: text/plain; charset=UTF-8\n"
1616
"Content-Transfer-Encoding: 8bit\n"
1717
"Plural-Forms: nplurals=1; plural=0;\n"
18-
"X-Generator: Weblate 4.3.1-dev\n"
18+
"X-Generator: Weblate 4.3.1\n"
1919

2020
#: main.c
2121
msgid ""
@@ -1423,7 +1423,7 @@ msgstr ""
14231423

14241424
#: shared-module/displayio/ColorConverter.c
14251425
msgid "Only one color can be transparent at a time"
1426-
msgstr ""
1426+
msgstr "Yīcì zhǐ néng yǒuyī zhǒng yánsè shì tòumíng de"
14271427

14281428
#: shared-bindings/ipaddress/__init__.c
14291429
msgid "Only raw int supported for ip"
@@ -2153,7 +2153,7 @@ msgstr "huǎnchōng qū tài xiǎo"
21532153

21542154
#: shared-bindings/socketpool/Socket.c
21552155
msgid "buffer too small for requested bytes"
2156-
msgstr ""
2156+
msgstr "huǎn chōng qū tài xiǎo, duì yú qǐng qiú de zì jié"
21572157

21582158
#: shared-bindings/_pew/PewPew.c
21592159
msgid "buttons must be digitalio.DigitalInOut"

shared-module/sharpdisplay/SharpMemoryFramebuffer.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,22 @@
3434
#include "shared-module/sharpdisplay/SharpMemoryFramebuffer.h"
3535

3636
#include "supervisor/memory.h"
37+
#include "supervisor/shared/safe_mode.h"
3738

3839
#define SHARPMEM_BIT_WRITECMD_LSB (0x80)
3940
#define SHARPMEM_BIT_VCOM_LSB (0x40)
4041

41-
static inline void *hybrid_alloc(size_t sz) {
42-
if (gc_alloc_possible()) {
43-
return m_malloc(sz + sizeof(void*), true);
44-
} else {
45-
supervisor_allocation *allocation = allocate_memory(align32_size(sz), false);
46-
if (!allocation) {
47-
return NULL;
48-
}
42+
static void *hybrid_alloc(size_t sz) {
43+
supervisor_allocation *allocation = allocate_memory(align32_size(sz), false);
44+
if (allocation) {
4945
memset(allocation->ptr, 0, sz);
5046
return allocation->ptr;
5147
}
48+
if (gc_alloc_possible()) {
49+
return m_malloc(sz, true);
50+
}
51+
reset_into_safe_mode(MEM_MANAGE);
52+
return NULL; // unreached
5253
}
5354

5455
static inline void hybrid_free(void *ptr_in) {
@@ -155,7 +156,8 @@ void common_hal_sharpdisplay_framebuffer_construct(sharpdisplay_framebuffer_obj_
155156

156157
int row_stride = common_hal_sharpdisplay_framebuffer_get_row_stride(self);
157158
self->bufinfo.len = row_stride * height + 2;
158-
self->bufinfo.buf = gc_alloc(self->bufinfo.len, false, true);
159+
// re-use a supervisor allocation if possible
160+
self->bufinfo.buf = hybrid_alloc(self->bufinfo.len);
159161

160162
uint8_t *data = self->bufinfo.buf;
161163
*data++ = SHARPMEM_BIT_WRITECMD_LSB;

0 commit comments

Comments
 (0)