forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add support for RP2040 GPIN/GPOUT (clkio) #9009
Open
tinylabs
wants to merge
11
commits into
adafruit:main
Choose a base branch
from
tinylabs:rp2-clkio-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d2b1b74
Add support for RP2040 GPIN/GPOUT (clkio)
tinylabs 3b1a31a
Run make translate, remove whitespace
tinylabs 2f31860
Fix code formatting
tinylabs 128b8c4
Rename clkio to rp2clock
tinylabs c60fa3d
Update class names
tinylabs a5dd74c
Update formatting
tinylabs ee36308
Rebuild translations
tinylabs bb6a09e
Move to enum macro, make requested changes
tinylabs 670df5c
Fix docs
tinylabs d35cda7
Update docs
tinylabs 852814b
Fix doc formatting
tinylabs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,101 @@ | ||||||||||||||||||||||
/* | ||||||||||||||||||||||
* This file is part of the Micro Python project, http://micropython.org/ | ||||||||||||||||||||||
* | ||||||||||||||||||||||
* The MIT License (MIT) | ||||||||||||||||||||||
* | ||||||||||||||||||||||
* Copyright (c) 2024 Elliot Buller | ||||||||||||||||||||||
* | ||||||||||||||||||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||||||||||||||||||||||
* of this software and associated documentation files (the "Software"), to deal | ||||||||||||||||||||||
* in the Software without restriction, including without limitation the rights | ||||||||||||||||||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||||||||||||||||||||||
* copies of the Software, and to permit persons to whom the Software is | ||||||||||||||||||||||
* furnished to do so, subject to the following conditions: | ||||||||||||||||||||||
* | ||||||||||||||||||||||
* The above copyright notice and this permission notice shall be included in | ||||||||||||||||||||||
* all copies or substantial portions of the Software. | ||||||||||||||||||||||
* | ||||||||||||||||||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||||||||||||||||||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||||||||||||||||||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||||||||||||||||||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||||||||||||||||||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||||||||||||||||||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||||||||||||||||||||||
* THE SOFTWARE. | ||||||||||||||||||||||
*/ | ||||||||||||||||||||||
|
||||||||||||||||||||||
#include "py/runtime.h" | ||||||||||||||||||||||
#include "py/enum.h" | ||||||||||||||||||||||
#include "bindings/rp2clock/AuxSrc.h" | ||||||||||||||||||||||
|
||||||||||||||||||||||
//| class AuxSrc: | ||||||||||||||||||||||
//| """Defines the input clock for GPOUT on RP2040. | ||||||||||||||||||||||
//| Used with rp2clock.OutputPin instantiation. | ||||||||||||||||||||||
//| """ | ||||||||||||||||||||||
//| | ||||||||||||||||||||||
//| def __init__(self) -> AuxSrc: | ||||||||||||||||||||||
//| """Enum-like class to define the clock src.""" | ||||||||||||||||||||||
//| PLL_SYS: "AuxSrc Clock" | ||||||||||||||||||||||
//| """Undivided PLL used to derive SYS clock.""" | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||
//| | ||||||||||||||||||||||
//| GPIN0: "AuxSrc Clock" | ||||||||||||||||||||||
//| """Input clock on GP20.""" | ||||||||||||||||||||||
//| | ||||||||||||||||||||||
//| GPIN1: "AuxSrc Clock" | ||||||||||||||||||||||
//| """Input clock on GP22.""" | ||||||||||||||||||||||
//| | ||||||||||||||||||||||
//| PLL_USB: "AuxSrc Clock" | ||||||||||||||||||||||
//| """Generates 48MHz USB reference clock.""" | ||||||||||||||||||||||
//| | ||||||||||||||||||||||
//| PLL_ROSC: "AuxSrc Clock" | ||||||||||||||||||||||
//| """Ring oscillator clock. 1.8-12MHz on boot depending on PVT.""" | ||||||||||||||||||||||
//| | ||||||||||||||||||||||
//| PLL_XOSC: "AuxSrc Clock" | ||||||||||||||||||||||
//| """External oscillator clock.""" | ||||||||||||||||||||||
//| | ||||||||||||||||||||||
//| SYS: "AuxSrc Clock" | ||||||||||||||||||||||
//| """Derived system clock after SYS_PLL divider.""" | ||||||||||||||||||||||
//| | ||||||||||||||||||||||
//| USB: "AuxSrc Clock" | ||||||||||||||||||||||
//| """Derived USB clock after PLL_USB divider, 48MHz.""" | ||||||||||||||||||||||
//| | ||||||||||||||||||||||
//| ADC: "AuxSrc Clock" | ||||||||||||||||||||||
//| """Current ADC selected clock, 48MHz.""" | ||||||||||||||||||||||
//| | ||||||||||||||||||||||
//| RTC: "AuxSrc Clock" | ||||||||||||||||||||||
//| """Current RTC selected clock.""" | ||||||||||||||||||||||
//| | ||||||||||||||||||||||
//| REF: "AuxSrc Clock" | ||||||||||||||||||||||
//| """Current reference clock for watchdog and timers.""" | ||||||||||||||||||||||
//| | ||||||||||||||||||||||
const mp_obj_type_t rp2clock_auxsrc_type; | ||||||||||||||||||||||
|
||||||||||||||||||||||
MAKE_ENUM_VALUE(rp2clock_auxsrc_type, rp2clock_auxsrc, PLL_SYS, AUXSRC_PLL_SYS); | ||||||||||||||||||||||
MAKE_ENUM_VALUE(rp2clock_auxsrc_type, rp2clock_auxsrc, GPIN0, AUXSRC_GPIN0); | ||||||||||||||||||||||
MAKE_ENUM_VALUE(rp2clock_auxsrc_type, rp2clock_auxsrc, GPIN1, AUXSRC_GPIN1); | ||||||||||||||||||||||
MAKE_ENUM_VALUE(rp2clock_auxsrc_type, rp2clock_auxsrc, PLL_USB, AUXSRC_PLL_USB); | ||||||||||||||||||||||
MAKE_ENUM_VALUE(rp2clock_auxsrc_type, rp2clock_auxsrc, PLL_ROSC, AUXSRC_PLL_ROSC); | ||||||||||||||||||||||
MAKE_ENUM_VALUE(rp2clock_auxsrc_type, rp2clock_auxsrc, PLL_XOSC, AUXSRC_PLL_XOSC); | ||||||||||||||||||||||
MAKE_ENUM_VALUE(rp2clock_auxsrc_type, rp2clock_auxsrc, SYS, AUXSRC_SYS); | ||||||||||||||||||||||
MAKE_ENUM_VALUE(rp2clock_auxsrc_type, rp2clock_auxsrc, USB, AUXSRC_USB); | ||||||||||||||||||||||
MAKE_ENUM_VALUE(rp2clock_auxsrc_type, rp2clock_auxsrc, ADC, AUXSRC_ADC); | ||||||||||||||||||||||
MAKE_ENUM_VALUE(rp2clock_auxsrc_type, rp2clock_auxsrc, RTC, AUXSRC_RTC); | ||||||||||||||||||||||
MAKE_ENUM_VALUE(rp2clock_auxsrc_type, rp2clock_auxsrc, REF, AUXSRC_REF); | ||||||||||||||||||||||
|
||||||||||||||||||||||
MAKE_ENUM_MAP(rp2clock_auxsrc) { | ||||||||||||||||||||||
MAKE_ENUM_MAP_ENTRY(rp2clock_auxsrc, PLL_SYS), | ||||||||||||||||||||||
MAKE_ENUM_MAP_ENTRY(rp2clock_auxsrc, GPIN0), | ||||||||||||||||||||||
MAKE_ENUM_MAP_ENTRY(rp2clock_auxsrc, GPIN1), | ||||||||||||||||||||||
MAKE_ENUM_MAP_ENTRY(rp2clock_auxsrc, PLL_USB), | ||||||||||||||||||||||
MAKE_ENUM_MAP_ENTRY(rp2clock_auxsrc, PLL_ROSC), | ||||||||||||||||||||||
MAKE_ENUM_MAP_ENTRY(rp2clock_auxsrc, PLL_XOSC), | ||||||||||||||||||||||
MAKE_ENUM_MAP_ENTRY(rp2clock_auxsrc, SYS), | ||||||||||||||||||||||
MAKE_ENUM_MAP_ENTRY(rp2clock_auxsrc, USB), | ||||||||||||||||||||||
MAKE_ENUM_MAP_ENTRY(rp2clock_auxsrc, ADC), | ||||||||||||||||||||||
MAKE_ENUM_MAP_ENTRY(rp2clock_auxsrc, RTC), | ||||||||||||||||||||||
MAKE_ENUM_MAP_ENTRY(rp2clock_auxsrc, REF), | ||||||||||||||||||||||
}; | ||||||||||||||||||||||
|
||||||||||||||||||||||
STATIC MP_DEFINE_CONST_DICT(rp2clock_auxsrc_locals_dict, rp2clock_auxsrc_locals_table); | ||||||||||||||||||||||
MAKE_PRINTER(rp2clock, rp2clock_auxsrc); | ||||||||||||||||||||||
MAKE_ENUM_TYPE(rp2clock, AuxSrc, rp2clock_auxsrc); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* This file is part of the Micro Python project, http://micropython.org/ | ||
* | ||
* The MIT License (MIT) | ||
* | ||
* Copyright (c) 2024 Elliot Buller | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "py/obj.h" | ||
#include "hardware/regs/clocks.h" | ||
|
||
// Output sources | ||
typedef enum { | ||
AUXSRC_PLL_SYS = CLOCKS_CLK_GPOUT0_CTRL_AUXSRC_VALUE_CLKSRC_PLL_SYS, | ||
AUXSRC_GPIN0 = CLOCKS_CLK_GPOUT0_CTRL_AUXSRC_VALUE_CLKSRC_GPIN0, | ||
AUXSRC_GPIN1 = CLOCKS_CLK_GPOUT0_CTRL_AUXSRC_VALUE_CLKSRC_GPIN1, | ||
AUXSRC_PLL_USB = CLOCKS_CLK_GPOUT0_CTRL_AUXSRC_VALUE_CLKSRC_PLL_USB, | ||
AUXSRC_PLL_ROSC = CLOCKS_CLK_GPOUT0_CTRL_AUXSRC_VALUE_ROSC_CLKSRC, | ||
AUXSRC_PLL_XOSC = CLOCKS_CLK_GPOUT0_CTRL_AUXSRC_VALUE_XOSC_CLKSRC, | ||
AUXSRC_SYS = CLOCKS_CLK_GPOUT0_CTRL_AUXSRC_VALUE_CLK_SYS, | ||
AUXSRC_USB = CLOCKS_CLK_GPOUT0_CTRL_AUXSRC_VALUE_CLK_USB, | ||
AUXSRC_ADC = CLOCKS_CLK_GPOUT0_CTRL_AUXSRC_VALUE_CLK_ADC, | ||
AUXSRC_RTC = CLOCKS_CLK_GPOUT0_CTRL_AUXSRC_VALUE_CLK_RTC, | ||
AUXSRC_REF = CLOCKS_CLK_GPOUT0_CTRL_AUXSRC_VALUE_CLK_REF, | ||
} rp2clock_auxsrc_t; | ||
|
||
extern const mp_obj_type_t rp2clock_auxsrc_type; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/* | ||
* This file is part of the Micro Python project, http://micropython.org/ | ||
* | ||
* The MIT License (MIT) | ||
* | ||
* Copyright (c) 2024 Elliot Buller | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
|
||
#include "py/runtime.h" | ||
#include "py/enum.h" | ||
#include "bindings/rp2clock/Index.h" | ||
|
||
//| class Index: | ||
//| """Defines the internal clock driven from GPIN external pin. | ||
//| Used with rp2clock.InputPin instantiation. | ||
//| """ | ||
//| | ||
//| def __init__(self) -> Index: | ||
//| """Enum-like class to define the internal clock index.""" | ||
//| GPOUT0: "Index Clock." | ||
//| """Clock routed to GPOUT0 (GP21)""" | ||
//| | ||
//| GPOUT1: "Index Clock." | ||
//| """Clock routed to GPOUT1 (GP23)""" | ||
//| | ||
//| GPOUT2: "Index Clock." | ||
//| """Clock routed to GPOUT2 (GP24)""" | ||
//| | ||
//| GPOUT3: "Index Clock." | ||
//| """Clock routed to GPOUT3 (GP25)""" | ||
//| | ||
//| REF: "Index Clock." | ||
//| """Reference clock for watchdog and timers.""" | ||
//| | ||
//| SYS: "Index Clock." | ||
//| """Main system clock for processors.""" | ||
//| | ||
//| PERI: "Index Clock." | ||
//| """Peripheral clock: UART, SPI, etc. 12-125MHz""" | ||
//| | ||
//| USB: "Index Clock." | ||
//| """USB clock: Must be 48MHz.""" | ||
//| | ||
//| ADC: "Index Clock." | ||
//| """ADC clock: Must be 48MHz.""" | ||
//| | ||
//| RTC: "Index Clock." | ||
//| """RTC clock: Nominally 46875 for 1 second ticks.""" | ||
//| | ||
const mp_obj_type_t rp2clock_index_type; | ||
|
||
MAKE_ENUM_VALUE(rp2clock_index_type, rp2clock_index, GPOUT0, INDEX_GPOUT0); | ||
MAKE_ENUM_VALUE(rp2clock_index_type, rp2clock_index, GPOUT1, INDEX_GPOUT1); | ||
MAKE_ENUM_VALUE(rp2clock_index_type, rp2clock_index, GPOUT2, INDEX_GPOUT2); | ||
MAKE_ENUM_VALUE(rp2clock_index_type, rp2clock_index, GPOUT3, INDEX_GPOUT3); | ||
MAKE_ENUM_VALUE(rp2clock_index_type, rp2clock_index, REF, INDEX_REF); | ||
MAKE_ENUM_VALUE(rp2clock_index_type, rp2clock_index, SYS, INDEX_SYS); | ||
MAKE_ENUM_VALUE(rp2clock_index_type, rp2clock_index, PERI, INDEX_PERI); | ||
MAKE_ENUM_VALUE(rp2clock_index_type, rp2clock_index, USB, INDEX_USB); | ||
MAKE_ENUM_VALUE(rp2clock_index_type, rp2clock_index, ADC, INDEX_ADC); | ||
MAKE_ENUM_VALUE(rp2clock_index_type, rp2clock_index, RTC, INDEX_RTC); | ||
|
||
MAKE_ENUM_MAP(rp2clock_index) { | ||
MAKE_ENUM_MAP_ENTRY(rp2clock_index, GPOUT0), | ||
MAKE_ENUM_MAP_ENTRY(rp2clock_index, GPOUT1), | ||
MAKE_ENUM_MAP_ENTRY(rp2clock_index, GPOUT2), | ||
MAKE_ENUM_MAP_ENTRY(rp2clock_index, GPOUT3), | ||
MAKE_ENUM_MAP_ENTRY(rp2clock_index, REF), | ||
MAKE_ENUM_MAP_ENTRY(rp2clock_index, SYS), | ||
MAKE_ENUM_MAP_ENTRY(rp2clock_index, PERI), | ||
MAKE_ENUM_MAP_ENTRY(rp2clock_index, USB), | ||
MAKE_ENUM_MAP_ENTRY(rp2clock_index, ADC), | ||
MAKE_ENUM_MAP_ENTRY(rp2clock_index, RTC), | ||
}; | ||
|
||
STATIC MP_DEFINE_CONST_DICT(rp2clock_index_locals_dict, rp2clock_index_locals_table); | ||
MAKE_PRINTER(rp2clock, rp2clock_index); | ||
MAKE_ENUM_TYPE(rp2clock, Index, rp2clock_index); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* This file is part of the Micro Python project, http://micropython.org/ | ||
* | ||
* The MIT License (MIT) | ||
* | ||
* Copyright (c) 2024 Elliot Buller | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "py/obj.h" | ||
#include "hardware/clocks.h" | ||
|
||
// Input sources | ||
typedef enum { | ||
INDEX_GPOUT0 = clk_gpout0, | ||
INDEX_GPOUT1 = clk_gpout1, | ||
INDEX_GPOUT2 = clk_gpout2, | ||
INDEX_GPOUT3 = clk_gpout3, | ||
INDEX_REF = clk_ref, | ||
INDEX_SYS = clk_sys, | ||
INDEX_PERI = clk_peri, | ||
INDEX_USB = clk_usb, | ||
INDEX_ADC = clk_adc, | ||
INDEX_RTC = clk_rtc, | ||
} rp2clock_index_t; | ||
|
||
extern const mp_obj_type_t rp2clock_index_type; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please try to reuse messages in this file instead of adding new ones. That way there is less to translate and less to store in the firmware.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried my best to combine them on latest commits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, do all translations end up in every build regardless of the modules compiled in? I just assumed that these would only be pulled in when CIRCUITPY_RP2CLOCK=1. I can make the messages more generic to reuse them but we'd lose some information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only translations for enabled modules are included. I assume we'll have RP2CLOCK enabled for all RP2040 boards where it'll fit. Striking the generic vs specific balance can be tricky.