Skip to content

Commit 3de1b9e

Browse files
committed
Merge remote-tracking branch 'upstream/master' into stm32-displayio
2 parents e6b4565 + 15886b1 commit 3de1b9e

File tree

48 files changed

+349
-195
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+349
-195
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ jobs:
169169
run: |
170170
sudo apt-get install -y gettext
171171
pip install requests sh click setuptools awscli
172-
wget https://s3.amazonaws.com/adafruit-circuit-python/gcc-arm-embedded_7-2018q2-1~xenial1_amd64.deb && sudo dpkg -i gcc-arm-embedded*_amd64.deb
172+
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/RC2.1/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2
173+
sudo tar -C /usr --strip-components=1 -xaf gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2
173174
- name: Versions
174175
run: |
175176
gcc --version

drivers/wiznet5k/internet/dns/dns.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252

5353
#include <string.h>
5454
#include <stdlib.h>
55-
#include "tick.h"
55+
#include "supervisor/shared/tick.h"
5656

5757
//#include "Ethernet/socket.h"
5858
//#include "Internet/DNS/dns.h"
@@ -125,7 +125,7 @@ uint16_t DNS_MSGID; // DNS message ID
125125

126126

127127
uint32_t HAL_GetTick(void) {
128-
return ticks_ms;
128+
return supervisor_ticks_ms32();
129129
}
130130

131131
uint32_t hal_sys_tick;

locale/zh_Latn_pinyin.po

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -673,11 +673,11 @@ msgstr "Shūrù/shūchū cuòwù"
673673

674674
#: ports/nrf/common-hal/_bleio/__init__.c
675675
msgid "Insufficient authentication"
676-
msgstr ""
676+
msgstr "Rènzhèng bùzú"
677677

678678
#: ports/nrf/common-hal/_bleio/__init__.c
679679
msgid "Insufficient encryption"
680-
msgstr ""
680+
msgstr "Jiāmì bùzú"
681681

682682
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
683683
#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c
@@ -2465,7 +2465,7 @@ msgstr "time.struct_time() xūyào 9 xùliè"
24652465

24662466
#: shared-bindings/busio/UART.c
24672467
msgid "timeout must be 0.0-100.0 seconds"
2468-
msgstr ""
2468+
msgstr "Chāo shí shíjiān bìxū wèi 0.0 Dào 100.0 Miǎo"
24692469

24702470
#: shared-bindings/_bleio/CharacteristicBuffer.c
24712471
msgid "timeout must be >= 0.0"

ports/atmel-samd/Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,16 @@ else
122122
ifdef CFLAGS_INLINE_LIMIT
123123
CFLAGS += -finline-limit=$(CFLAGS_INLINE_LIMIT)
124124
endif
125+
125126
CFLAGS += -flto -flto-partition=none
127+
128+
ifeq ($(CIRCUITPY_SMALL_BUILD),1)
129+
CFLAGS += --param inline-unit-growth=15 --param max-inline-insns-auto=20
130+
endif
131+
132+
ifdef CFLAGS_BOARD
133+
CFLAGS += $(CFLAGS_BOARD)
134+
endif
126135
endif
127136

128137
CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT)

ports/atmel-samd/background.c

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "audio_dma.h"
2929
#include "tick.h"
3030
#include "supervisor/filesystem.h"
31+
#include "supervisor/shared/tick.h"
3132
#include "supervisor/usb.h"
3233

3334
#include "py/runtime.h"
@@ -44,6 +45,23 @@ bool stack_ok_so_far = true;
4445

4546
static bool running_background_tasks = false;
4647

48+
#ifdef MONITOR_BACKGROUND_TASKS
49+
// PB03 is physical pin "SCL" on the Metro M4 express
50+
// so you can't use this code AND an i2c peripheral
51+
// at the same time unless you change this
52+
STATIC void start_background_task(void) {
53+
REG_PORT_DIRSET1 = (1<<3);
54+
REG_PORT_OUTSET1 = (1<<3);
55+
}
56+
57+
STATIC void finish_background_task(void) {
58+
REG_PORT_OUTCLR1 = (1<<3);
59+
}
60+
#else
61+
STATIC void start_background_task(void) {}
62+
STATIC void finish_background_task(void) {}
63+
#endif
64+
4765
void background_tasks_reset(void) {
4866
running_background_tasks = false;
4967
}
@@ -53,6 +71,9 @@ void run_background_tasks(void) {
5371
if (running_background_tasks) {
5472
return;
5573
}
74+
75+
start_background_task();
76+
5677
assert_heap_ok();
5778
running_background_tasks = true;
5879

@@ -71,9 +92,10 @@ void run_background_tasks(void) {
7192
running_background_tasks = false;
7293
assert_heap_ok();
7394

74-
last_finished_tick = ticks_ms;
95+
last_finished_tick = supervisor_ticks_ms64();
96+
finish_background_task();
7597
}
7698

7799
bool background_tasks_ok(void) {
78-
return ticks_ms - last_finished_tick < 1000;
100+
return supervisor_ticks_ms64() - last_finished_tick < 1000;
79101
}

ports/atmel-samd/boards/pewpew10/mpconfigboard.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ CIRCUITPY_USB_MIDI = 0
2323
SUPEROPT_GC = 0
2424

2525
FROZEN_MPY_DIRS += $(TOP)/frozen/pew-pewpew-standalone-10.x
26+
27+
CFLAGS_BOARD = --param max-inline-insns-auto=15

ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ SUPEROPT_GC = 0
2929
# FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DotStar
3030
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID
3131
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_IRRemote
32+
33+
CFLAGS_BOARD = --param max-inline-insns-auto=12

ports/atmel-samd/boards/pyruler/mpconfigboard.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ CIRCUITPY_SMALL_BUILD = 1
1313

1414
SUPEROPT_GC = 0
1515

16+
CFLAGS_BOARD = --param max-inline-insns-auto=15
1617
ifeq ($(TRANSLATION), zh_Latn_pinyin)
1718
CFLAGS_INLINE_LIMIT = 35
18-
endif
19+
endif

ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,9 @@ LONGINT_IMPL = NONE
1212
CIRCUITPY_SMALL_BUILD = 1
1313

1414
SUPEROPT_GC = 0
15+
16+
CFLAGS_BOARD = --param max-inline-insns-auto=15
17+
ifeq ($(TRANSLATION), zh_Latn_pinyin)
18+
CFLAGS_INLINE_LIMIT = 35
19+
endif
20+

ports/atmel-samd/common-hal/busio/UART.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434
#include "py/runtime.h"
3535
#include "py/stream.h"
3636
#include "supervisor/shared/translate.h"
37-
38-
#include "tick.h"
37+
#include "supervisor/shared/tick.h"
3938

4039
#include "hpl_sercom_config.h"
4140
#include "peripheral_clk_config.h"
@@ -272,10 +271,10 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t
272271
usart_async_get_io_descriptor(usart_desc_p, &io);
273272

274273
size_t total_read = 0;
275-
uint64_t start_ticks = ticks_ms;
274+
uint64_t start_ticks = supervisor_ticks_ms64();
276275

277276
// Busy-wait until timeout or until we've read enough chars.
278-
while (ticks_ms - start_ticks <= self->timeout_ms) {
277+
while (supervisor_ticks_ms64() - start_ticks <= self->timeout_ms) {
279278
// Read as many chars as we can right now, up to len.
280279
size_t num_read = io_read(io, data, len);
281280

@@ -289,7 +288,7 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t
289288
}
290289
if (num_read > 0) {
291290
// Reset the timeout on every character read.
292-
start_ticks = ticks_ms;
291+
start_ticks = supervisor_ticks_ms64();
293292
}
294293
RUN_BACKGROUND_TASKS;
295294
// Allow user to break out of a timeout with a KeyboardInterrupt.

0 commit comments

Comments
 (0)