Skip to content

Commit d609a09

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents a1c6105 + 4ecc51e commit d609a09

File tree

14 files changed

+387
-35
lines changed

14 files changed

+387
-35
lines changed

conf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,9 @@ def autoapi_prepare_jinja_env(jinja_env):
376376
latex_documents = [
377377
("docs/pdf", 'CircuitPython.tex', 'CircuitPython Documentation',
378378
'CircuitPython Contributors', 'manual'),
379-
("shared-bindings/support_matrix", 'SupportMatrix.tex', 'Board Support Matrix',
380-
'CircuitPython Contributors', 'manual'),
379+
# Uncomment this if you want to build a PDF of the board -> module support matrix.
380+
# ("shared-bindings/support_matrix", 'SupportMatrix.tex', 'Board Support Matrix',
381+
# 'CircuitPython Contributors', 'manual'),
381382
]
382383

383384
# The name of an image file (relative to this directory) to place at the top of

locale/circuitpython.pot

Lines changed: 44 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -175,19 +175,23 @@ msgstr ""
175175
msgid "%q length must be >= %d"
176176
msgstr ""
177177

178+
#: py/objmodule.c py/runtime.c
179+
msgid "%q moved from %q to %q"
180+
msgstr ""
181+
178182
#: py/argcheck.c
179183
msgid "%q must be %d"
180184
msgstr ""
181185

182-
#: py/argcheck.c shared-bindings/displayio/Bitmap.c
183-
#: shared-bindings/displayio/Display.c
186+
#: py/argcheck.c shared-bindings/busdisplay/BusDisplay.c
187+
#: shared-bindings/displayio/Bitmap.c
184188
#: shared-bindings/framebufferio/FramebufferDisplay.c
185189
#: shared-bindings/is31fl3741/FrameBuffer.c
186190
#: shared-bindings/rgbmatrix/RGBMatrix.c
187191
msgid "%q must be %d-%d"
188192
msgstr ""
189193

190-
#: shared-bindings/displayio/Display.c
194+
#: shared-bindings/busdisplay/BusDisplay.c
191195
msgid "%q must be 1 when %q is True"
192196
msgstr ""
193197

@@ -212,6 +216,10 @@ msgstr ""
212216
msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'"
213217
msgstr ""
214218

219+
#: shared-bindings/warnings/__init__.c
220+
msgid "%q must be a subclass of %q"
221+
msgstr ""
222+
215223
#: ports/espressif/common-hal/analogbufio/BufferedIn.c
216224
msgid "%q must be array of type 'H'"
217225
msgstr ""
@@ -247,6 +255,10 @@ msgstr ""
247255
msgid "%q out of range"
248256
msgstr ""
249257

258+
#: py/objmodule.c py/runtime.c
259+
msgid "%q renamed %q"
260+
msgstr ""
261+
250262
#: py/objrange.c py/objslice.c shared-bindings/random/__init__.c
251263
msgid "%q step cannot be zero"
252264
msgstr ""
@@ -434,8 +446,8 @@ msgstr ""
434446
msgid ", in %q\n"
435447
msgstr ""
436448

437-
#: shared-bindings/displayio/Display.c
438-
#: shared-bindings/displayio/EPaperDisplay.c
449+
#: shared-bindings/busdisplay/BusDisplay.c
450+
#: shared-bindings/epaperdisplay/EPaperDisplay.c
439451
#: shared-bindings/framebufferio/FramebufferDisplay.c
440452
msgid ".show(x) removed. Use .root_group = x"
441453
msgstr ""
@@ -625,7 +637,7 @@ msgstr ""
625637
msgid "Baudrate not supported by peripheral"
626638
msgstr ""
627639

628-
#: shared-module/displayio/Display.c
640+
#: shared-module/busdisplay/BusDisplay.c
629641
#: shared-module/framebufferio/FramebufferDisplay.c
630642
msgid "Below minimum frame rate"
631643
msgstr ""
@@ -658,7 +670,7 @@ msgstr ""
658670
msgid "Both pins must support hardware interrupts"
659671
msgstr ""
660672

661-
#: shared-bindings/displayio/Display.c
673+
#: shared-bindings/busdisplay/BusDisplay.c
662674
#: shared-bindings/framebufferio/FramebufferDisplay.c
663675
msgid "Brightness not adjustable"
664676
msgstr ""
@@ -695,7 +707,8 @@ msgstr ""
695707
msgid "Buffer too short by %d bytes"
696708
msgstr ""
697709

698-
#: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c
710+
#: ports/cxd56/common-hal/camera/Camera.c
711+
#: shared-bindings/busdisplay/BusDisplay.c
699712
#: shared-bindings/framebufferio/FramebufferDisplay.c
700713
#: shared-bindings/struct/__init__.c shared-module/struct/__init__.c
701714
msgid "Buffer too small"
@@ -705,10 +718,10 @@ msgstr ""
705718
msgid "Buffers must be same size"
706719
msgstr ""
707720

708-
#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c
709-
#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c
710-
#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c
711-
#: ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c
721+
#: ports/atmel-samd/common-hal/paralleldisplaybus/ParallelBus.c
722+
#: ports/espressif/common-hal/paralleldisplaybus/ParallelBus.c
723+
#: ports/nrf/common-hal/paralleldisplaybus/ParallelBus.c
724+
#: ports/raspberrypi/common-hal/paralleldisplaybus/ParallelBus.c
712725
#, c-format
713726
msgid "Bus pin %d is already in use"
714727
msgstr ""
@@ -893,8 +906,8 @@ msgstr ""
893906
msgid "DAC already in use"
894907
msgstr ""
895908

896-
#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c
897-
#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c
909+
#: ports/atmel-samd/common-hal/paralleldisplaybus/ParallelBus.c
910+
#: ports/nrf/common-hal/paralleldisplaybus/ParallelBus.c
898911
msgid "Data 0 pin must be byte aligned"
899912
msgstr ""
900913

@@ -924,13 +937,13 @@ msgstr ""
924937
msgid "Device in use"
925938
msgstr ""
926939

927-
#: shared-bindings/displayio/Display.c
940+
#: shared-bindings/busdisplay/BusDisplay.c
928941
#: shared-bindings/framebufferio/FramebufferDisplay.c
929942
msgid "Display must have a 16 bit colorspace."
930943
msgstr ""
931944

932-
#: shared-bindings/displayio/Display.c
933-
#: shared-bindings/displayio/EPaperDisplay.c
945+
#: shared-bindings/busdisplay/BusDisplay.c
946+
#: shared-bindings/epaperdisplay/EPaperDisplay.c
934947
#: shared-bindings/framebufferio/FramebufferDisplay.c
935948
msgid "Display rotation must be in 90 degree increments"
936949
msgstr ""
@@ -1104,7 +1117,7 @@ msgid "Generic Failure"
11041117
msgstr ""
11051118

11061119
#: shared-bindings/framebufferio/FramebufferDisplay.c
1107-
#: shared-module/displayio/Display.c
1120+
#: shared-module/busdisplay/BusDisplay.c
11081121
#: shared-module/framebufferio/FramebufferDisplay.c
11091122
msgid "Group already used"
11101123
msgstr ""
@@ -1202,7 +1215,7 @@ msgstr ""
12021215
msgid "Internal define error"
12031216
msgstr ""
12041217

1205-
#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c
1218+
#: ports/espressif/common-hal/paralleldisplaybus/ParallelBus.c
12061219
#: shared-module/os/getenv.c
12071220
msgid "Internal error"
12081221
msgstr ""
@@ -1225,7 +1238,7 @@ msgstr ""
12251238
#: ports/raspberrypi/bindings/picodvi/Framebuffer.c
12261239
#: ports/raspberrypi/common-hal/picodvi/Framebuffer.c py/argcheck.c
12271240
#: shared-bindings/digitalio/DigitalInOut.c
1228-
#: shared-bindings/displayio/EPaperDisplay.c
1241+
#: shared-bindings/epaperdisplay/EPaperDisplay.c
12291242
msgid "Invalid %q"
12301243
msgstr ""
12311244

@@ -1428,9 +1441,10 @@ msgstr ""
14281441
#: ports/mimxrt10xx/common-hal/busio/SPI.c
14291442
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
14301443
#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/SPI.c
1431-
#: ports/stm/common-hal/busio/UART.c shared-bindings/displayio/FourWire.c
1432-
#: shared-bindings/displayio/I2CDisplay.c
1433-
#: shared-bindings/paralleldisplay/ParallelBus.c shared-module/bitbangio/SPI.c
1444+
#: ports/stm/common-hal/busio/UART.c shared-bindings/fourwire/FourWire.c
1445+
#: shared-bindings/i2cdisplaybus/I2CDisplayBus.c
1446+
#: shared-bindings/paralleldisplaybus/ParallelBus.c
1447+
#: shared-module/bitbangio/SPI.c
14341448
msgid "No %q pin"
14351449
msgstr ""
14361450

@@ -1562,7 +1576,7 @@ msgstr ""
15621576
msgid "Not playing"
15631577
msgstr ""
15641578

1565-
#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c
1579+
#: ports/espressif/common-hal/paralleldisplaybus/ParallelBus.c
15661580
#, c-format
15671581
msgid "Number of data_pins must be 8 or 16, not %d"
15681582
msgstr ""
@@ -1852,7 +1866,7 @@ msgstr ""
18521866
msgid "Reconnecting"
18531867
msgstr ""
18541868

1855-
#: shared-bindings/displayio/EPaperDisplay.c
1869+
#: shared-bindings/epaperdisplay/EPaperDisplay.c
18561870
msgid "Refresh too soon"
18571871
msgstr ""
18581872

@@ -1953,7 +1967,7 @@ msgstr ""
19531967
msgid "Source and destination buffers must be the same length"
19541968
msgstr ""
19551969

1956-
#: shared-bindings/paralleldisplay/ParallelBus.c
1970+
#: shared-bindings/paralleldisplaybus/ParallelBus.c
19571971
msgid "Specify exactly one of data0 or data_pins"
19581972
msgstr ""
19591973

@@ -2013,7 +2027,7 @@ msgstr ""
20132027
msgid "This microcontroller does not support continuous capture."
20142028
msgstr ""
20152029

2016-
#: shared-module/paralleldisplay/ParallelBus.c
2030+
#: shared-module/paralleldisplaybus/ParallelBus.c
20172031
msgid ""
20182032
"This microcontroller only supports data0=, not data_pins=, because it "
20192033
"requires contiguous pins."
@@ -2148,7 +2162,8 @@ msgstr ""
21482162
msgid "Unable to create lock"
21492163
msgstr ""
21502164

2151-
#: shared-module/displayio/I2CDisplay.c shared-module/is31fl3741/IS31FL3741.c
2165+
#: shared-module/i2cdisplaybus/I2CDisplayBus.c
2166+
#: shared-module/is31fl3741/IS31FL3741.c
21522167
#, c-format
21532168
msgid "Unable to find I2C Display at %x"
21542169
msgstr ""
@@ -2258,7 +2273,7 @@ msgstr ""
22582273
msgid "Unsupported colorspace"
22592274
msgstr ""
22602275

2261-
#: shared-module/displayio/display_core.c
2276+
#: shared-module/displayio/bus_core.c
22622277
msgid "Unsupported display bus type"
22632278
msgstr ""
22642279

py/circuitpy_defns.mk

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,9 @@ endif
395395
ifeq ($(CIRCUITPY_VIDEOCORE),1)
396396
SRC_PATTERNS += videocore/%
397397
endif
398+
ifeq ($(CIRCUITPY_WARNINGS),1)
399+
SRC_PATTERNS += warnings/%
400+
endif
398401
ifeq ($(CIRCUITPY_WATCHDOG),1)
399402
SRC_PATTERNS += watchdog/%
400403
endif
@@ -680,13 +683,14 @@ SRC_SHARED_MODULE_ALL = \
680683
usb/core/__init__.c \
681684
usb/core/Device.c \
682685
ustack/__init__.c \
683-
watchdog/__init__.c \
684-
zlib/__init__.c \
685686
vectorio/Circle.c \
686687
vectorio/Polygon.c \
687688
vectorio/Rectangle.c \
688689
vectorio/VectorShape.c \
689690
vectorio/__init__.c \
691+
warnings/__init__.c \
692+
watchdog/__init__.c \
693+
zlib/__init__.c \
690694

691695
# All possible sources are listed here, and are filtered by SRC_PATTERNS.
692696
SRC_SHARED_MODULE = $(filter $(SRC_PATTERNS), $(SRC_SHARED_MODULE_ALL))

py/circuitpy_mpconfig.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,9 @@ CIRCUITPY_ULAB_OPTIMIZE_SIZE ?= 0
589589
CIRCUITPY_VIDEOCORE ?= 0
590590
CFLAGS += -DCIRCUITPY_VIDEOCORE=$(CIRCUITPY_VIDEOCORE)
591591

592+
CIRCUITPY_WARNINGS ?= $(CIRCUITPY_FULL_BUILD)
593+
CFLAGS += -DCIRCUITPY_WARNINGS=$(CIRCUITPY_WARNINGS)
594+
592595
# watchdog hardware support
593596
CIRCUITPY_WATCHDOG ?= 0
594597
CFLAGS += -DCIRCUITPY_WATCHDOG=$(CIRCUITPY_WATCHDOG)

py/modbuiltins.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,10 @@ STATIC const mp_rom_map_elem_t mp_module_builtins_globals_table[] = {
785785
{ MP_ROM_QSTR(MP_QSTR_ViperTypeError), MP_ROM_PTR(&mp_type_ViperTypeError) },
786786
#endif
787787
{ MP_ROM_QSTR(MP_QSTR_ZeroDivisionError), MP_ROM_PTR(&mp_type_ZeroDivisionError) },
788+
#if CIRCUITPY_WARNINGS
789+
{ MP_ROM_QSTR(MP_QSTR_Warning), MP_ROM_PTR(&mp_type_Warning) },
790+
{ MP_ROM_QSTR(MP_QSTR_FutureWarning), MP_ROM_PTR(&mp_type_FutureWarning) },
791+
#endif
788792

789793
// Extra builtins as defined by a port
790794
MICROPY_PORT_BUILTINS

py/mpstate.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
#include "py/objlist.h"
3737
#include "py/objexcept.h"
3838

39+
#if CIRCUITPY_WARNINGS
40+
#include "shared-bindings/warnings/__init__.h"
41+
#endif
42+
3943
// #if CIRCUITPY
4044
// #error CIRCUITPY is TRUE in mpstate.h.
4145
// #else
@@ -311,6 +315,10 @@ typedef struct _mp_state_thread_t {
311315
bool prof_callback_is_executing;
312316
struct _mp_code_state_t *current_code_state;
313317
#endif
318+
319+
#if CIRCUITPY_WARNINGS
320+
warnings_action_t warnings_action;
321+
#endif
314322
} mp_state_thread_t;
315323

316324
// This structure combines the above 3 structures.

py/obj.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,10 @@ extern const mp_obj_type_t mp_type_ZeroDivisionError;
916916
#if CIRCUITPY_ALARM
917917
extern const mp_obj_type_t mp_type_DeepSleepRequest;
918918
#endif
919+
#if CIRCUITPY_WARNINGS
920+
extern const mp_obj_type_t mp_type_Warning;
921+
extern const mp_obj_type_t mp_type_FutureWarning;
922+
#endif
919923

920924

921925
// Constant objects, globally accessible: None, False, True

py/objexcept.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,14 +452,16 @@ MP_DEFINE_EXCEPTION(Exception, BaseException)
452452
#if CIRCUITPY_ALARM
453453
MP_DEFINE_EXCEPTION(DeepSleepRequest, BaseException)
454454
#endif
455-
/*
455+
#if CIRCUITPY_WARNINGS
456456
MP_DEFINE_EXCEPTION(Warning, Exception)
457+
MP_DEFINE_EXCEPTION(FutureWarning, Warning)
458+
#endif
459+
/*
457460
MP_DEFINE_EXCEPTION(DeprecationWarning, Warning)
458461
MP_DEFINE_EXCEPTION(PendingDeprecationWarning, Warning)
459462
MP_DEFINE_EXCEPTION(RuntimeWarning, Warning)
460463
MP_DEFINE_EXCEPTION(SyntaxWarning, Warning)
461464
MP_DEFINE_EXCEPTION(UserWarning, Warning)
462-
MP_DEFINE_EXCEPTION(FutureWarning, Warning)
463465
MP_DEFINE_EXCEPTION(ImportWarning, Warning)
464466
MP_DEFINE_EXCEPTION(UnicodeWarning, Warning)
465467
MP_DEFINE_EXCEPTION(BytesWarning, Warning)

py/objmodule.c

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
#include "py/runtime.h"
3535
#include "py/builtin.h"
3636

37+
#if CIRCUITPY_WARNINGS
38+
#include "shared-module/warnings/__init__.h"
39+
#endif
40+
3741
STATIC void module_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
3842
(void)kind;
3943
mp_obj_module_t *self = MP_OBJ_TO_PTR(self_in);
@@ -62,6 +66,32 @@ STATIC void module_attr_try_delegation(mp_obj_t self_in, qstr attr, mp_obj_t *de
6266
STATIC void module_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
6367
mp_obj_module_t *self = MP_OBJ_TO_PTR(self_in);
6468
if (dest[0] == MP_OBJ_NULL) {
69+
#if CIRCUITPY_DISPLAYIO && CIRCUITPY_WARNINGS
70+
if (self == &displayio_module) {
71+
#if CIRCUITPY_BUSDISPLAY
72+
if (attr == MP_QSTR_Display) {
73+
warnings_warn(&mp_type_FutureWarning, translate("%q moved from %q to %q"), MP_QSTR_Display, MP_QSTR_displayio, MP_QSTR_busdisplay);
74+
warnings_warn(&mp_type_FutureWarning, translate("%q renamed %q"), MP_QSTR_Display, MP_QSTR_BusDisplay);
75+
}
76+
#endif
77+
#if CIRCUITPY_EPAPERDISPLAY
78+
if (attr == MP_QSTR_EPaperDisplay) {
79+
warnings_warn(&mp_type_FutureWarning, translate("%q moved from %q to %q"), MP_QSTR_EPaperDisplay, MP_QSTR_displayio, MP_QSTR_epaperdisplay);
80+
}
81+
#endif
82+
#if CIRCUITPY_FOURWIRE
83+
if (attr == MP_QSTR_FourWire) {
84+
warnings_warn(&mp_type_FutureWarning, translate("%q moved from %q to %q"), MP_QSTR_FourWire, MP_QSTR_displayio, MP_QSTR_fourwire);
85+
}
86+
#endif
87+
#if CIRCUITPY_I2CDISPLAYBUS
88+
if (attr == MP_QSTR_I2CDisplay) {
89+
warnings_warn(&mp_type_FutureWarning, translate("%q moved from %q to %q"), MP_QSTR_I2CDisplay, MP_QSTR_displayio, MP_QSTR_i2cdisplaybus);
90+
warnings_warn(&mp_type_FutureWarning, translate("%q renamed %q"), MP_QSTR_I2CDisplay, MP_QSTR_I2CDisplayBus);
91+
}
92+
#endif
93+
}
94+
#endif
6595
// load attribute
6696
mp_map_elem_t *elem = mp_map_lookup(&self->globals->map, MP_OBJ_NEW_QSTR(attr), MP_MAP_LOOKUP);
6797
if (elem != NULL) {
@@ -173,6 +203,11 @@ STATIC const mp_module_delegation_entry_t mp_builtin_module_delegation_table[] =
173203
// Attempts to find (and initialise) a built-in, otherwise returns
174204
// MP_OBJ_NULL.
175205
mp_obj_t mp_module_get_builtin(qstr module_name, bool extensible) {
206+
#if CIRCUITPY_PARALLELDISPLAYBUS && CIRCUITPY_WARNINGS
207+
if (module_name == MP_QSTR_paralleldisplay) {
208+
warnings_warn(&mp_type_FutureWarning, translate("%q renamed %q"), MP_QSTR_paralleldisplay, MP_QSTR_paralleldisplaybus);
209+
}
210+
#endif
176211
mp_map_elem_t *elem = mp_map_lookup((mp_map_t *)(extensible ? &mp_builtin_extensible_module_map : &mp_builtin_module_map), MP_OBJ_NEW_QSTR(module_name), MP_MAP_LOOKUP);
177212
if (!elem) {
178213
#if MICROPY_PY_SYS

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy