Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RP2040: Support for WatchDog #4083

Merged
merged 3 commits into from
Feb 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,18 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(BASEOPTS)
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(BASEOPTS)

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
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
# Paths to exclude from TRANSLATE_SOURCES
# Each must be preceded by "-path"; if any wildcards, enclose in quotes.
# Separate by "-o" (Find's "or" operand)
TRANSLATE_SOURCES_EXC = -path "ports/*/build-*" \
-o -path "ports/*/build" \
-o -path ports/esp32s2/esp-idf \
-o -path ports/cxd56/spresense-exported-sdk \
-o -path ports/stm/st_driver \
-o -path ports/atmel-samd/asf4 \
-o -path ports/cxd56/spresense-exported-sdk \
-o -path ports/esp32s2/esp-idf \
-o -path ports/mimxrt10xx/sdk \
-o -path ports/raspberrypi/sdk \
-o -path ports/stm/st_driver \
-o -path lib/tinyusb \
-o -path lib/lwip \

Expand Down
152 changes: 147 additions & 5 deletions locale/circuitpython.pot
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,10 @@ msgstr ""
msgid "All event channels in use"
msgstr ""

#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
msgid "All state machines in use"
msgstr ""

#: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c
msgid "All sync event channels in use"
msgstr ""
Expand Down Expand Up @@ -387,6 +391,7 @@ msgstr ""
#: ports/cxd56/common-hal/analogio/AnalogOut.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c
#: ports/nrf/common-hal/analogio/AnalogOut.c
#: ports/raspberrypi/common-hal/analogio/AnalogOut.c
msgid "AnalogOut functionality not supported"
msgstr ""

Expand Down Expand Up @@ -586,6 +591,7 @@ msgstr ""
#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c
#: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c
#: ports/nrf/common-hal/digitalio/DigitalInOut.c
#: ports/raspberrypi/common-hal/digitalio/DigitalInOut.c
msgid "Cannot get pull while in output mode"
msgstr ""

Expand Down Expand Up @@ -863,7 +869,8 @@ msgstr ""
msgid "Error: Failure to bind"
msgstr ""

#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
#: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c
#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
Expand Down Expand Up @@ -1045,6 +1052,10 @@ msgstr ""
msgid "I2C Init Error"
msgstr ""

#: ports/raspberrypi/common-hal/busio/I2C.c
msgid "I2C peripheral in use"
msgstr ""

#: shared-bindings/audiobusio/I2SOut.c
msgid "I2SOut not available"
msgstr ""
Expand All @@ -1068,6 +1079,10 @@ msgstr ""
msgid "Incorrect buffer size"
msgstr ""

#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
msgid "Init program size invalid"
msgstr ""

#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "Initialization failed due to lack of memory"
msgstr ""
Expand All @@ -1080,6 +1095,31 @@ msgstr ""
msgid "Input/output error"
msgstr ""

#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
#, c-format
msgid "Instruction %d jumps on pin"
msgstr ""

#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
#, c-format
msgid "Instruction %d shifts in more bits than pin count"
msgstr ""

#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
#, c-format
msgid "Instruction %d shifts out more bits than pin count"
msgstr ""

#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
#, c-format
msgid "Instruction %d uses extra pin"
msgstr ""

#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
#, c-format
msgid "Instruction %d waits on input outside of count"
msgstr ""

#: ports/nrf/common-hal/_bleio/__init__.c
msgid "Insufficient authentication"
msgstr ""
Expand Down Expand Up @@ -1131,7 +1171,7 @@ msgstr ""

#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c
#: shared-bindings/pwmio/PWMOut.c
#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c
msgid "Invalid PWM frequency"
msgstr ""

Expand Down Expand Up @@ -1225,6 +1265,8 @@ msgstr ""
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
#: ports/raspberrypi/common-hal/busio/I2C.c
#: ports/raspberrypi/common-hal/busio/SPI.c
msgid "Invalid pins"
msgstr ""

Expand Down Expand Up @@ -1346,6 +1388,36 @@ msgstr ""
msgid "Missing MISO or MOSI Pin"
msgstr ""

#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
#, c-format
msgid "Missing first_in_pin. Instruction %d reads pin(s)"
msgstr ""

#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
#, c-format
msgid "Missing first_in_pin. Instruction %d shifts in from pin(s)"
msgstr ""

#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
#, c-format
msgid "Missing first_in_pin. Instruction %d waits based on pin"
msgstr ""

#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
#, c-format
msgid "Missing first_out_pin. Instruction %d shifts out to pin(s)"
msgstr ""

#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
#, c-format
msgid "Missing first_out_pin. Instruction %d writes pin(s)"
msgstr ""

#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
#, c-format
msgid "Missing first_set_pin. Instruction %d sets pin(s)"
msgstr ""

#: shared-bindings/displayio/Group.c
msgid "Must be a %q subclass."
msgstr ""
Expand Down Expand Up @@ -1399,14 +1471,14 @@ msgstr ""
#: ports/atmel-samd/common-hal/busio/UART.c
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
#: ports/stm/common-hal/busio/UART.c
#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
msgid "No RX pin"
msgstr ""

#: ports/atmel-samd/common-hal/busio/UART.c
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
#: ports/stm/common-hal/busio/UART.c
#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
msgid "No TX pin"
msgstr ""

Expand Down Expand Up @@ -1463,6 +1535,10 @@ msgstr ""
msgid "No network with that ssid"
msgstr ""

#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
msgid "No out in program"
msgstr ""

#: shared-module/touchio/TouchIn.c
msgid "No pulldown on pin; 1Mohm recommended"
msgstr ""
Expand Down Expand Up @@ -1518,6 +1594,10 @@ msgstr ""
msgid "Only 8 or 16 bit mono with "
msgstr ""

#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
msgid "Only IN/OUT of up to 8 supported"
msgstr ""

#: ports/esp32s2/common-hal/wifi/__init__.c
msgid "Only IPv4 addresses supported"
msgstr ""
Expand Down Expand Up @@ -1590,6 +1670,7 @@ msgid ""
msgstr ""

#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c
#: ports/raspberrypi/common-hal/displayio/ParallelBus.c
#: ports/stm/common-hal/displayio/ParallelBus.c
msgid "ParallelBus not yet supported"
msgstr ""
Expand All @@ -1602,11 +1683,20 @@ msgstr ""
msgid "Permission denied"
msgstr ""

#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
msgid "Pin count must be at least 1"
msgstr ""

#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
msgid "Pin count too large"
msgstr ""

#: ports/atmel-samd/common-hal/analogio/AnalogIn.c
#: ports/cxd56/common-hal/analogio/AnalogIn.c
#: ports/esp32s2/common-hal/analogio/AnalogIn.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c
#: ports/nrf/common-hal/analogio/AnalogIn.c
#: ports/raspberrypi/common-hal/analogio/AnalogIn.c
#: ports/stm/common-hal/analogio/AnalogIn.c
msgid "Pin does not have ADC capabilities"
msgstr ""
Expand Down Expand Up @@ -1667,10 +1757,34 @@ msgstr ""
msgid "Pretending to deep sleep until alarm, CTRL-C or file write.\n"
msgstr ""

#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
msgid "Program does IN without loading ISR"
msgstr ""

#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
msgid "Program does OUT without loading OSR"
msgstr ""

#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
msgid "Program must contain at least one 16-bit instruction."
msgstr ""

#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
msgid "Program size invalid"
msgstr ""

#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
msgid "Program too large"
msgstr ""

#: shared-bindings/digitalio/DigitalInOut.c
msgid "Pull not used when direction is output."
msgstr ""

#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
msgid "RAISE mode is not implemented"
msgstr ""

#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr ""
Expand Down Expand Up @@ -1753,6 +1867,7 @@ msgstr ""

#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
#: ports/raspberrypi/common-hal/busio/I2C.c
msgid "SDA or SCL needs a pull up"
msgstr ""

Expand All @@ -1774,6 +1889,10 @@ msgstr ""
msgid "SPI Re-initialization error"
msgstr ""

#: ports/raspberrypi/common-hal/busio/SPI.c
msgid "SPI peripheral in use"
msgstr ""

#: shared-bindings/audiomixer/Mixer.c
msgid "Sample rate must be positive"
msgstr ""
Expand Down Expand Up @@ -1804,6 +1923,14 @@ msgstr ""
msgid "Server side context cannot have hostname"
msgstr ""

#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
msgid "Set pin count must be between 1 and 5"
msgstr ""

#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
msgid "Side set pin count must be between 1 and 5"
msgstr ""

#: ports/cxd56/common-hal/camera/Camera.c
msgid "Size not supported"
msgstr ""
Expand Down Expand Up @@ -1968,6 +2095,10 @@ msgstr ""
msgid "UART Re-init error"
msgstr ""

#: ports/raspberrypi/common-hal/busio/UART.c
msgid "UART not yet supported"
msgstr ""

#: ports/stm/common-hal/busio/UART.c
msgid "UART write error"
msgstr ""
Expand Down Expand Up @@ -2072,7 +2203,8 @@ msgid ""
msgstr ""

#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c
#: ports/esp32s2/common-hal/busio/UART.c ports/stm/common-hal/busio/I2C.c
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c
msgid "Unsupported baudrate"
msgstr ""

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

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

Expand Down Expand Up @@ -3521,6 +3654,14 @@ msgstr ""
msgid "pressing both buttons at start up.\n"
msgstr ""

#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
msgid "pull_threshold must be between 1 and 32"
msgstr ""

#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
msgid "push_threshold must be between 1 and 32"
msgstr ""

#: extmod/modutimeq.c
msgid "queue overflow"
msgstr ""
Expand Down Expand Up @@ -3724,6 +3865,7 @@ msgstr ""

#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
#: ports/nrf/common-hal/watchdog/WatchDogTimer.c
#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
msgid "timeout duration exceeded the maximum supported value"
msgstr ""

Expand Down
11 changes: 11 additions & 0 deletions ports/raspberrypi/common-hal/microcontroller/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,17 @@ const nvm_bytearray_obj_t common_hal_mcu_nvm_obj = {
};
#endif

#if CIRCUITPY_WATCHDOG
// The singleton watchdog.WatchDogTimer object.
watchdog_watchdogtimer_obj_t common_hal_mcu_watchdogtimer_obj = {
.base = {
.type = &watchdog_watchdogtimer_type,
},
.timeout = 0.0f,
.mode = WATCHDOGMODE_NONE,
};
#endif

// This maps MCU pin names to pin objects.
const mp_rom_map_elem_t mcu_pin_global_dict_table[TOTAL_GPIO_COUNT] = {
{ MP_ROM_QSTR(MP_QSTR_GPIO0), MP_ROM_PTR(&pin_GPIO0) },
Expand Down
1 change: 1 addition & 0 deletions ports/raspberrypi/common-hal/watchdog/WatchDogMode.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// No watchdog module functions.
Loading