Skip to content

Commit 17cf03c

Browse files
authored
Merge pull request adafruit#4083 from microDev1/watchdog-rp
RP2040: Support for WatchDog
2 parents a52395a + 34fe152 commit 17cf03c

File tree

8 files changed

+292
-9
lines changed

8 files changed

+292
-9
lines changed

Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,18 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(BASEOPTS)
4040
# the i18n builder cannot share the environment and doctrees with the others
4141
I18NSPHINXOPTS = $(BASEOPTS)
4242

43-
TRANSLATE_SOURCES = extmod lib main.c ports/atmel-samd ports/cxd56 ports/esp32s2 ports/mimxrt10xx ports/nrf ports/stm py shared-bindings shared-module supervisor
43+
TRANSLATE_SOURCES = extmod lib main.c ports/atmel-samd ports/cxd56 ports/esp32s2 ports/mimxrt10xx ports/nrf ports/raspberrypi ports/stm py shared-bindings shared-module supervisor
4444
# Paths to exclude from TRANSLATE_SOURCES
4545
# Each must be preceded by "-path"; if any wildcards, enclose in quotes.
4646
# Separate by "-o" (Find's "or" operand)
4747
TRANSLATE_SOURCES_EXC = -path "ports/*/build-*" \
4848
-o -path "ports/*/build" \
49-
-o -path ports/esp32s2/esp-idf \
50-
-o -path ports/cxd56/spresense-exported-sdk \
51-
-o -path ports/stm/st_driver \
5249
-o -path ports/atmel-samd/asf4 \
50+
-o -path ports/cxd56/spresense-exported-sdk \
51+
-o -path ports/esp32s2/esp-idf \
5352
-o -path ports/mimxrt10xx/sdk \
53+
-o -path ports/raspberrypi/sdk \
54+
-o -path ports/stm/st_driver \
5455
-o -path lib/tinyusb \
5556
-o -path lib/lwip \
5657

locale/circuitpython.pot

Lines changed: 147 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,10 @@ msgstr ""
339339
msgid "All event channels in use"
340340
msgstr ""
341341

342+
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
343+
msgid "All state machines in use"
344+
msgstr ""
345+
342346
#: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c
343347
msgid "All sync event channels in use"
344348
msgstr ""
@@ -387,6 +391,7 @@ msgstr ""
387391
#: ports/cxd56/common-hal/analogio/AnalogOut.c
388392
#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c
389393
#: ports/nrf/common-hal/analogio/AnalogOut.c
394+
#: ports/raspberrypi/common-hal/analogio/AnalogOut.c
390395
msgid "AnalogOut functionality not supported"
391396
msgstr ""
392397

@@ -586,6 +591,7 @@ msgstr ""
586591
#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c
587592
#: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c
588593
#: ports/nrf/common-hal/digitalio/DigitalInOut.c
594+
#: ports/raspberrypi/common-hal/digitalio/DigitalInOut.c
589595
msgid "Cannot get pull while in output mode"
590596
msgstr ""
591597

@@ -863,7 +869,8 @@ msgstr ""
863869
msgid "Error: Failure to bind"
864870
msgstr ""
865871

866-
#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
872+
#: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c
873+
#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
867874
#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c
868875
#: shared-bindings/neopixel_write/__init__.c
869876
#: shared-bindings/terminalio/Terminal.c
@@ -1045,6 +1052,10 @@ msgstr ""
10451052
msgid "I2C Init Error"
10461053
msgstr ""
10471054

1055+
#: ports/raspberrypi/common-hal/busio/I2C.c
1056+
msgid "I2C peripheral in use"
1057+
msgstr ""
1058+
10481059
#: shared-bindings/audiobusio/I2SOut.c
10491060
msgid "I2SOut not available"
10501061
msgstr ""
@@ -1068,6 +1079,10 @@ msgstr ""
10681079
msgid "Incorrect buffer size"
10691080
msgstr ""
10701081

1082+
#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
1083+
msgid "Init program size invalid"
1084+
msgstr ""
1085+
10711086
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
10721087
msgid "Initialization failed due to lack of memory"
10731088
msgstr ""
@@ -1080,6 +1095,31 @@ msgstr ""
10801095
msgid "Input/output error"
10811096
msgstr ""
10821097

1098+
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
1099+
#, c-format
1100+
msgid "Instruction %d jumps on pin"
1101+
msgstr ""
1102+
1103+
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
1104+
#, c-format
1105+
msgid "Instruction %d shifts in more bits than pin count"
1106+
msgstr ""
1107+
1108+
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
1109+
#, c-format
1110+
msgid "Instruction %d shifts out more bits than pin count"
1111+
msgstr ""
1112+
1113+
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
1114+
#, c-format
1115+
msgid "Instruction %d uses extra pin"
1116+
msgstr ""
1117+
1118+
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
1119+
#, c-format
1120+
msgid "Instruction %d waits on input outside of count"
1121+
msgstr ""
1122+
10831123
#: ports/nrf/common-hal/_bleio/__init__.c
10841124
msgid "Insufficient authentication"
10851125
msgstr ""
@@ -1131,7 +1171,7 @@ msgstr ""
11311171

11321172
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
11331173
#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c
1134-
#: shared-bindings/pwmio/PWMOut.c
1174+
#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c
11351175
msgid "Invalid PWM frequency"
11361176
msgstr ""
11371177

@@ -1225,6 +1265,8 @@ msgstr ""
12251265
#: ports/mimxrt10xx/common-hal/busio/I2C.c
12261266
#: ports/mimxrt10xx/common-hal/busio/SPI.c
12271267
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
1268+
#: ports/raspberrypi/common-hal/busio/I2C.c
1269+
#: ports/raspberrypi/common-hal/busio/SPI.c
12281270
msgid "Invalid pins"
12291271
msgstr ""
12301272

@@ -1346,6 +1388,36 @@ msgstr ""
13461388
msgid "Missing MISO or MOSI Pin"
13471389
msgstr ""
13481390

1391+
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
1392+
#, c-format
1393+
msgid "Missing first_in_pin. Instruction %d reads pin(s)"
1394+
msgstr ""
1395+
1396+
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
1397+
#, c-format
1398+
msgid "Missing first_in_pin. Instruction %d shifts in from pin(s)"
1399+
msgstr ""
1400+
1401+
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
1402+
#, c-format
1403+
msgid "Missing first_in_pin. Instruction %d waits based on pin"
1404+
msgstr ""
1405+
1406+
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
1407+
#, c-format
1408+
msgid "Missing first_out_pin. Instruction %d shifts out to pin(s)"
1409+
msgstr ""
1410+
1411+
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
1412+
#, c-format
1413+
msgid "Missing first_out_pin. Instruction %d writes pin(s)"
1414+
msgstr ""
1415+
1416+
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
1417+
#, c-format
1418+
msgid "Missing first_set_pin. Instruction %d sets pin(s)"
1419+
msgstr ""
1420+
13491421
#: shared-bindings/displayio/Group.c
13501422
msgid "Must be a %q subclass."
13511423
msgstr ""
@@ -1399,14 +1471,14 @@ msgstr ""
13991471
#: ports/atmel-samd/common-hal/busio/UART.c
14001472
#: ports/esp32s2/common-hal/busio/UART.c
14011473
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
1402-
#: ports/stm/common-hal/busio/UART.c
1474+
#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
14031475
msgid "No RX pin"
14041476
msgstr ""
14051477

14061478
#: ports/atmel-samd/common-hal/busio/UART.c
14071479
#: ports/esp32s2/common-hal/busio/UART.c
14081480
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
1409-
#: ports/stm/common-hal/busio/UART.c
1481+
#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
14101482
msgid "No TX pin"
14111483
msgstr ""
14121484

@@ -1463,6 +1535,10 @@ msgstr ""
14631535
msgid "No network with that ssid"
14641536
msgstr ""
14651537

1538+
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
1539+
msgid "No out in program"
1540+
msgstr ""
1541+
14661542
#: shared-module/touchio/TouchIn.c
14671543
msgid "No pulldown on pin; 1Mohm recommended"
14681544
msgstr ""
@@ -1518,6 +1594,10 @@ msgstr ""
15181594
msgid "Only 8 or 16 bit mono with "
15191595
msgstr ""
15201596

1597+
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
1598+
msgid "Only IN/OUT of up to 8 supported"
1599+
msgstr ""
1600+
15211601
#: ports/esp32s2/common-hal/wifi/__init__.c
15221602
msgid "Only IPv4 addresses supported"
15231603
msgstr ""
@@ -1590,6 +1670,7 @@ msgid ""
15901670
msgstr ""
15911671

15921672
#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c
1673+
#: ports/raspberrypi/common-hal/displayio/ParallelBus.c
15931674
#: ports/stm/common-hal/displayio/ParallelBus.c
15941675
msgid "ParallelBus not yet supported"
15951676
msgstr ""
@@ -1602,11 +1683,20 @@ msgstr ""
16021683
msgid "Permission denied"
16031684
msgstr ""
16041685

1686+
#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
1687+
msgid "Pin count must be at least 1"
1688+
msgstr ""
1689+
1690+
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
1691+
msgid "Pin count too large"
1692+
msgstr ""
1693+
16051694
#: ports/atmel-samd/common-hal/analogio/AnalogIn.c
16061695
#: ports/cxd56/common-hal/analogio/AnalogIn.c
16071696
#: ports/esp32s2/common-hal/analogio/AnalogIn.c
16081697
#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c
16091698
#: ports/nrf/common-hal/analogio/AnalogIn.c
1699+
#: ports/raspberrypi/common-hal/analogio/AnalogIn.c
16101700
#: ports/stm/common-hal/analogio/AnalogIn.c
16111701
msgid "Pin does not have ADC capabilities"
16121702
msgstr ""
@@ -1667,10 +1757,34 @@ msgstr ""
16671757
msgid "Pretending to deep sleep until alarm, CTRL-C or file write.\n"
16681758
msgstr ""
16691759

1760+
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
1761+
msgid "Program does IN without loading ISR"
1762+
msgstr ""
1763+
1764+
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
1765+
msgid "Program does OUT without loading OSR"
1766+
msgstr ""
1767+
1768+
#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
1769+
msgid "Program must contain at least one 16-bit instruction."
1770+
msgstr ""
1771+
1772+
#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
1773+
msgid "Program size invalid"
1774+
msgstr ""
1775+
1776+
#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
1777+
msgid "Program too large"
1778+
msgstr ""
1779+
16701780
#: shared-bindings/digitalio/DigitalInOut.c
16711781
msgid "Pull not used when direction is output."
16721782
msgstr ""
16731783

1784+
#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
1785+
msgid "RAISE mode is not implemented"
1786+
msgstr ""
1787+
16741788
#: ports/stm/common-hal/os/__init__.c
16751789
msgid "RNG DeInit Error"
16761790
msgstr ""
@@ -1753,6 +1867,7 @@ msgstr ""
17531867

17541868
#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c
17551869
#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
1870+
#: ports/raspberrypi/common-hal/busio/I2C.c
17561871
msgid "SDA or SCL needs a pull up"
17571872
msgstr ""
17581873

@@ -1774,6 +1889,10 @@ msgstr ""
17741889
msgid "SPI Re-initialization error"
17751890
msgstr ""
17761891

1892+
#: ports/raspberrypi/common-hal/busio/SPI.c
1893+
msgid "SPI peripheral in use"
1894+
msgstr ""
1895+
17771896
#: shared-bindings/audiomixer/Mixer.c
17781897
msgid "Sample rate must be positive"
17791898
msgstr ""
@@ -1804,6 +1923,14 @@ msgstr ""
18041923
msgid "Server side context cannot have hostname"
18051924
msgstr ""
18061925

1926+
#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
1927+
msgid "Set pin count must be between 1 and 5"
1928+
msgstr ""
1929+
1930+
#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
1931+
msgid "Side set pin count must be between 1 and 5"
1932+
msgstr ""
1933+
18071934
#: ports/cxd56/common-hal/camera/Camera.c
18081935
msgid "Size not supported"
18091936
msgstr ""
@@ -1968,6 +2095,10 @@ msgstr ""
19682095
msgid "UART Re-init error"
19692096
msgstr ""
19702097

2098+
#: ports/raspberrypi/common-hal/busio/UART.c
2099+
msgid "UART not yet supported"
2100+
msgstr ""
2101+
19712102
#: ports/stm/common-hal/busio/UART.c
19722103
msgid "UART write error"
19732104
msgstr ""
@@ -2072,7 +2203,8 @@ msgid ""
20722203
msgstr ""
20732204

20742205
#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c
2075-
#: ports/esp32s2/common-hal/busio/UART.c ports/stm/common-hal/busio/I2C.c
2206+
#: ports/esp32s2/common-hal/busio/UART.c
2207+
#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c
20762208
msgid "Unsupported baudrate"
20772209
msgstr ""
20782210

@@ -2123,6 +2255,7 @@ msgid "WARNING: Your code filename has two extensions\n"
21232255
msgstr ""
21242256

21252257
#: ports/nrf/common-hal/watchdog/WatchDogTimer.c
2258+
#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
21262259
msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET"
21272260
msgstr ""
21282261

@@ -3521,6 +3654,14 @@ msgstr ""
35213654
msgid "pressing both buttons at start up.\n"
35223655
msgstr ""
35233656

3657+
#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
3658+
msgid "pull_threshold must be between 1 and 32"
3659+
msgstr ""
3660+
3661+
#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
3662+
msgid "push_threshold must be between 1 and 32"
3663+
msgstr ""
3664+
35243665
#: extmod/modutimeq.c
35253666
msgid "queue overflow"
35263667
msgstr ""
@@ -3724,6 +3865,7 @@ msgstr ""
37243865

37253866
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
37263867
#: ports/nrf/common-hal/watchdog/WatchDogTimer.c
3868+
#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
37273869
msgid "timeout duration exceeded the maximum supported value"
37283870
msgstr ""
37293871

ports/raspberrypi/common-hal/microcontroller/__init__.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,17 @@ const nvm_bytearray_obj_t common_hal_mcu_nvm_obj = {
112112
};
113113
#endif
114114

115+
#if CIRCUITPY_WATCHDOG
116+
// The singleton watchdog.WatchDogTimer object.
117+
watchdog_watchdogtimer_obj_t common_hal_mcu_watchdogtimer_obj = {
118+
.base = {
119+
.type = &watchdog_watchdogtimer_type,
120+
},
121+
.timeout = 0.0f,
122+
.mode = WATCHDOGMODE_NONE,
123+
};
124+
#endif
125+
115126
// This maps MCU pin names to pin objects.
116127
const mp_rom_map_elem_t mcu_pin_global_dict_table[TOTAL_GPIO_COUNT] = {
117128
{ MP_ROM_QSTR(MP_QSTR_GPIO0), MP_ROM_PTR(&pin_GPIO0) },
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// No watchdog module functions.

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