Flag functions constexpr
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- c
- Domain
- embedded-iot
Research direction
Start by locating the SDK implementations and declarations of pwm_gpio_to_channel and pwm_gpio_to_slice_num, then identify other pure functions that could support compile-time evaluation. Verify that the shown constexpr and static_assert usage compiles, and that the selected functions provide the intended compile-time results.
Written by the indexing model from the issue text.
Description
There are many pure functions in the SDK that could be marked as constexpr to provide more compile time computation and verification. It'd also allow for compile time allocation of internal resources. One example being pwm_gpio_to_channel and pwm_gpio_to_slice_num. If they'd be marked constexpr then following code would be valid:
constexpr int pwm_gpio = xxx;
static_assert(pwm_gpio_to_channel(pwm_gpio) == 0); // because we DMA 2B only we need it to be lower half of the register
- Dominant language
- C
- Stars
- 5k
- Forks
- 1.3k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 17
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from raspberrypi/pico-sdk
-
hardware_pio
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
raspberrypi/pico-sdk#3193 ·
-
pioasm
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
raspberrypi/pico-sdk#3189 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
raspberrypi/pico-sdk#3183 ·
-
c++
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
raspberrypi/pico-sdk#3181 · 3 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
raspberrypi/pico-sdk#3167 ·
All issues in raspberrypi/pico-sdk
Similar issues
-
[adam] AdamNet network read doesn't cap to MAX_ADAM_PACKET_LEN, overflows client receive buffers Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
FujiNetWIFI/fujinet-firmware#1649 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HarbourMasters/Shipwright#7229 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
riscv-software-src/riscv-isa-sim#2435 · 1 comment ·
-
bug Self Built Image SNAPSHOT Supported Device target/ramips
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100