Compare commits

...

17 commits

Author SHA1 Message Date
Romain
db41039714
Merge 7668ad17e4 into a76f2416ba 2025-12-09 16:13:02 +05:30
armandomontanez
a76f2416ba
Add fallback URLs for Bazel gcc toolchains (#2752)
Some checks failed
Bazel presubmit checks / bazel-build-check (macos-latest) (push) Has been cancelled
Bazel presubmit checks / bazel-build-check (ubuntu-latest) (push) Has been cancelled
Bazel presubmit checks / other-bazel-checks (push) Has been cancelled
Check Configs / check-configs (push) Has been cancelled
CMake / build (push) Has been cancelled
Build on macOS / build (push) Has been cancelled
Build on Windows / build (push) Has been cancelled
Fixes #2747
2025-12-08 11:21:27 +00:00
armandomontanez
8fcd44a171
Forward declare __sev(), __wfe(), __wfi() (#2658)
Some checks failed
Bazel presubmit checks / bazel-build-check (macos-latest) (push) Has been cancelled
Bazel presubmit checks / bazel-build-check (ubuntu-latest) (push) Has been cancelled
Bazel presubmit checks / other-bazel-checks (push) Has been cancelled
Check Configs / check-configs (push) Has been cancelled
CMake / build (push) Has been cancelled
Build on macOS / build (push) Has been cancelled
Build on Windows / build (push) Has been cancelled
If the compiler in use offers __sev(), __wfe(), or __wfi(), forward
declare them to be sure they're available for use.
2025-09-15 13:14:08 -05:00
Andrew Scheller
6b395cce04
Fix pico_status_led to change the color of an already-on colored LED (#2632)
Partially fixes #2630, as it doesn't take care of the required delay between setting the LED
2025-09-15 13:09:21 -05:00
armandomontanez
87c9c013fe
More robust clobbering of ARM builtins on host (#2657)
Since ARM hosts have builtins listed in hardware/sync.h, these builtins
should be clobbered. Newer versions of LLVM/Clang emit an error when
clobbering these builtins, so this switches the overrides to use the
same patterns as pico_atomic to clobber the builtins.
2025-09-15 13:04:09 -05:00
Martin Budden
17b914418d
Fix unused parameter warning. (#2663) 2025-09-15 12:53:06 -05:00
Andrew Scheller
db75b67533
Fix Multicoore typo (#2661) 2025-09-15 12:23:26 -05:00
Earle F. Philhower, III
ad2f4143eb
Fix always-true comparison warning in pio_insn (#2608)
Some checks failed
Bazel presubmit checks / bazel-build-check (macos-latest) (push) Has been cancelled
Bazel presubmit checks / bazel-build-check (ubuntu-latest) (push) Has been cancelled
Bazel presubmit checks / other-bazel-checks (push) Has been cancelled
Check Configs / check-configs (push) Has been cancelled
CMake / build (push) Has been cancelled
Build on macOS / build (push) Has been cancelled
Build on Windows / build (push) Has been cancelled
The sideset_bit_count in pio_encode_sideset_opt is unsigned, so any comparison
"sideset_bit_count >= 0" will always be true.  GCC with pedantic warnings
will complain when this happens.

Remove the unneeded >=0 portion of the parameter validity check.

Fixes #2607
2025-09-10 10:18:22 -05:00
Rainer Keller
4e1371f5fa
Update instructions.h (#2647)
Fix copy-paste-error. With RP2350's Hazard3 should never show up, but anyway.
2025-09-10 10:17:10 -05:00
Rainer Keller
d581553414
Correct two typos (#2648)
* Update sha256_alt.h

Fix trivial copy-paste error in comment

* Update README.md

Another small typo in documentation
2025-09-10 10:16:54 -05:00
will-v-pi
486b78e245
Fix race in gpio_set_irq_enabled_with_callback (#2635)
The order depends on whether you're enabling or disabling
2025-09-10 10:15:58 -05:00
josch
36f1df6d72
src/boards/include/boards/*.h: remove executable bit (#2652)
Some checks failed
Bazel presubmit checks / bazel-build-check (macos-latest) (push) Has been cancelled
Bazel presubmit checks / bazel-build-check (ubuntu-latest) (push) Has been cancelled
Bazel presubmit checks / other-bazel-checks (push) Has been cancelled
Check Board Headers / check-board-headers (push) Has been cancelled
Check Configs / check-configs (push) Has been cancelled
CMake / build (push) Has been cancelled
Build on macOS / build (push) Has been cancelled
Build on Windows / build (push) Has been cancelled
find src -type f -perm /a+x -name '*.h' -print0 | xargs --null chmod -x
2025-09-08 13:13:35 -05:00
graham sanderson
299fb7db10 fix compiler warning
Some checks failed
Bazel presubmit checks / bazel-build-check (macos-latest) (push) Has been cancelled
Bazel presubmit checks / bazel-build-check (ubuntu-latest) (push) Has been cancelled
Bazel presubmit checks / other-bazel-checks (push) Has been cancelled
Check Configs / check-configs (push) Has been cancelled
CMake / build (push) Has been cancelled
Build on macOS / build (push) Has been cancelled
Build on Windows / build (push) Has been cancelled
2025-08-27 16:48:57 -05:00
Graham Sanderson
6a3da02ada
remove spurious cmake code, which seems to break some versions of cmake (#2637) 2025-08-27 11:16:43 -05:00
Andrew Scheller
adcf8be22f
pico_status_led doxygen typo (#2636)
Some checks are pending
Bazel presubmit checks / bazel-build-check (macos-latest) (push) Waiting to run
Bazel presubmit checks / bazel-build-check (ubuntu-latest) (push) Waiting to run
Bazel presubmit checks / other-bazel-checks (push) Waiting to run
Check Configs / check-configs (push) Waiting to run
CMake / build (push) Waiting to run
Build on macOS / build (push) Waiting to run
Build on Windows / build (push) Waiting to run
2025-08-26 17:36:40 +01:00
Graham Sanderson
b30caca4fd
fix regression caused by moving set_raw_irq_handler_and_unlock() (#2631)
Some checks failed
Bazel presubmit checks / bazel-build-check (macos-latest) (push) Has been cancelled
Bazel presubmit checks / bazel-build-check (ubuntu-latest) (push) Has been cancelled
Bazel presubmit checks / other-bazel-checks (push) Has been cancelled
Check Configs / check-configs (push) Has been cancelled
CMake / build (push) Has been cancelled
Build on macOS / build (push) Has been cancelled
Build on Windows / build (push) Has been cancelled
2025-08-19 08:37:01 -05:00
graham sanderson
1ca77d6afd start 2.2.1-develop
Some checks failed
Bazel presubmit checks / bazel-build-check (macos-latest) (push) Has been cancelled
Bazel presubmit checks / bazel-build-check (ubuntu-latest) (push) Has been cancelled
Bazel presubmit checks / other-bazel-checks (push) Has been cancelled
Check Configs / check-configs (push) Has been cancelled
CMake / build (push) Has been cancelled
Build on macOS / build (push) Has been cancelled
Build on Windows / build (push) Has been cancelled
2025-07-29 07:01:55 -05:00
35 changed files with 84 additions and 37 deletions

View file

@ -1,6 +1,6 @@
module( module(
name = "pico-sdk", name = "pico-sdk",
version = "2.2.0", version = "2.2.1-develop",
) )
bazel_dep(name = "platforms", version = "0.0.9") bazel_dep(name = "platforms", version = "0.0.9")
@ -16,7 +16,10 @@ http_archive(
build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD", build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
sha256 = "8fd8b4a0a8d44ab2e195ccfbeef42223dfb3ede29d80f14dcf2183c34b8d199a", sha256 = "8fd8b4a0a8d44ab2e195ccfbeef42223dfb3ede29d80f14dcf2183c34b8d199a",
strip_prefix = "arm-gnu-toolchain-13.2.Rel1-aarch64-arm-none-eabi", strip_prefix = "arm-gnu-toolchain-13.2.Rel1-aarch64-arm-none-eabi",
url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-aarch64-arm-none-eabi.tar.xz", urls = [
"https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-aarch64-arm-none-eabi.tar.xz",
"https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-aarch64-arm-none-eabi.tar.xz",
],
) )
http_archive( http_archive(
@ -24,7 +27,10 @@ http_archive(
build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD", build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
sha256 = "6cd1bbc1d9ae57312bcd169ae283153a9572bd6a8e4eeae2fedfbc33b115fdbb", sha256 = "6cd1bbc1d9ae57312bcd169ae283153a9572bd6a8e4eeae2fedfbc33b115fdbb",
strip_prefix = "arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi", strip_prefix = "arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi",
url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz", urls = [
"https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz",
"https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz",
],
) )
http_archive( http_archive(
@ -32,7 +38,10 @@ http_archive(
build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD", build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
sha256 = "51d933f00578aa28016c5e3c84f94403274ea7915539f8e56c13e2196437d18f", sha256 = "51d933f00578aa28016c5e3c84f94403274ea7915539f8e56c13e2196437d18f",
strip_prefix = "arm-gnu-toolchain-13.2.Rel1-mingw-w64-i686-arm-none-eabi", strip_prefix = "arm-gnu-toolchain-13.2.Rel1-mingw-w64-i686-arm-none-eabi",
url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi.zip", urls = [
"https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi.zip",
"https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi.zip",
],
) )
http_archive( http_archive(
@ -40,7 +49,10 @@ http_archive(
build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD", build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
sha256 = "075faa4f3e8eb45e59144858202351a28706f54a6ec17eedd88c9fb9412372cc", sha256 = "075faa4f3e8eb45e59144858202351a28706f54a6ec17eedd88c9fb9412372cc",
strip_prefix = "arm-gnu-toolchain-13.2.Rel1-darwin-x86_64-arm-none-eabi", strip_prefix = "arm-gnu-toolchain-13.2.Rel1-darwin-x86_64-arm-none-eabi",
url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-x86_64-arm-none-eabi.tar.xz", urls = [
"https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-x86_64-arm-none-eabi.tar.xz",
"https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-x86_64-arm-none-eabi.tar.xz",
],
) )
http_archive( http_archive(
@ -48,7 +60,10 @@ http_archive(
build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD", build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
sha256 = "39c44f8af42695b7b871df42e346c09fee670ea8dfc11f17083e296ea2b0d279", sha256 = "39c44f8af42695b7b871df42e346c09fee670ea8dfc11f17083e296ea2b0d279",
strip_prefix = "arm-gnu-toolchain-13.2.Rel1-darwin-arm64-arm-none-eabi", strip_prefix = "arm-gnu-toolchain-13.2.Rel1-darwin-arm64-arm-none-eabi",
url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-arm64-arm-none-eabi.tar.xz", urls = [
"https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-arm64-arm-none-eabi.tar.xz",
"https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-arm64-arm-none-eabi.tar.xz",
],
) )
http_archive( http_archive(

View file

@ -7,10 +7,10 @@ if (NOT DEFINED PICO_SDK_VERSION_MAJOR)
set(PICO_SDK_VERSION_MINOR 2) set(PICO_SDK_VERSION_MINOR 2)
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_REVISION, SDK version revision, type=int, default=Current SDK revision, group=pico_base # PICO_BUILD_DEFINE: PICO_SDK_VERSION_REVISION, SDK version revision, type=int, default=Current SDK revision, group=pico_base
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_REVISION, SDK version revision, type=int, default=Current SDK revision, group=pico_base # PICO_CMAKE_CONFIG: PICO_SDK_VERSION_REVISION, SDK version revision, type=int, default=Current SDK revision, group=pico_base
set(PICO_SDK_VERSION_REVISION 0) set(PICO_SDK_VERSION_REVISION 1)
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_PRE_RELEASE_ID, Optional SDK pre-release version identifier, default=Current SDK pre-release identifier, type=string, group=pico_base # PICO_BUILD_DEFINE: PICO_SDK_VERSION_PRE_RELEASE_ID, Optional SDK pre-release version identifier, default=Current SDK pre-release identifier, type=string, group=pico_base
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_PRE_RELEASE_ID, Optional SDK pre-release version identifier, default=Current SDK pre-release identifier, type=string, group=pico_base # PICO_CMAKE_CONFIG: PICO_SDK_VERSION_PRE_RELEASE_ID, Optional SDK pre-release version identifier, default=Current SDK pre-release identifier, type=string, group=pico_base
#set(PICO_SDK_VERSION_PRE_RELEASE_ID develop) set(PICO_SDK_VERSION_PRE_RELEASE_ID develop)
endif() endif()
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_STRING, SDK version string, type=string, default=Current SDK version string, group=pico_base # PICO_BUILD_DEFINE: PICO_SDK_VERSION_STRING, SDK version string, type=string, default=Current SDK version string, group=pico_base

0
src/boards/include/boards/waveshare_pico_cam_a.h Executable file → Normal file
View file

0
src/boards/include/boards/waveshare_rp2040_ble.h Executable file → Normal file
View file

0
src/boards/include/boards/waveshare_rp2040_eth.h Executable file → Normal file
View file

0
src/boards/include/boards/waveshare_rp2040_geek.h Executable file → Normal file
View file

0
src/boards/include/boards/waveshare_rp2040_matrix.h Executable file → Normal file
View file

0
src/boards/include/boards/waveshare_rp2040_pizero.h Executable file → Normal file
View file

View file

0
src/boards/include/boards/waveshare_rp2040_tiny.h Executable file → Normal file
View file

View file

0
src/boards/include/boards/waveshare_rp2350_eth.h Executable file → Normal file
View file

0
src/boards/include/boards/waveshare_rp2350_geek.h Executable file → Normal file
View file

0
src/boards/include/boards/waveshare_rp2350_lcd_0.96.h Executable file → Normal file
View file

0
src/boards/include/boards/waveshare_rp2350_lcd_1.28.h Executable file → Normal file
View file

0
src/boards/include/boards/waveshare_rp2350_one.h Executable file → Normal file
View file

0
src/boards/include/boards/waveshare_rp2350_plus_16mb.h Executable file → Normal file
View file

0
src/boards/include/boards/waveshare_rp2350_plus_4mb.h Executable file → Normal file
View file

0
src/boards/include/boards/waveshare_rp2350_tiny.h Executable file → Normal file
View file

View file

0
src/boards/include/boards/waveshare_rp2350_zero.h Executable file → Normal file
View file

View file

@ -109,8 +109,6 @@ extern "C" {
void __sev(); void __sev();
void __wev();
void __wfi(); void __wfi();
void __wfe(); void __wfe();

View file

@ -93,23 +93,44 @@ void PICO_WEAK_FUNCTION_IMPL_NAME(spin_unlock)(spin_lock_t *lock, uint32_t saved
spin_unlock_unsafe(lock); spin_unlock_unsafe(lock);
} }
PICO_WEAK_FUNCTION_DEF(__sev) // These are defined on ARM hosts, but don't do what we want for the host
// since this is a simulated build.
#if PICO_C_COMPILER_IS_GNU || !__has_builtin(__sev)
#define __sev_c __sev
#else
#pragma redefine_extname __sev_c __sev
#endif
#if PICO_C_COMPILER_IS_GNU || !__has_builtin(__wfi)
#define __wfi_c __wfi
#else
#pragma redefine_extname __wfi_c __wfi
#endif
#if PICO_C_COMPILER_IS_GNU || !__has_builtin(__wfe)
#define __wfe_c __wfe
#else
#pragma redefine_extname __wfe_c __wfe
#endif
PICO_WEAK_FUNCTION_DEF(__sev_c)
volatile bool event_fired; volatile bool event_fired;
void PICO_WEAK_FUNCTION_IMPL_NAME(__sev)() { void PICO_WEAK_FUNCTION_IMPL_NAME(__sev_c)() {
event_fired = true; event_fired = true;
} }
PICO_WEAK_FUNCTION_DEF(__wfi) PICO_WEAK_FUNCTION_DEF(__wfi_c)
void PICO_WEAK_FUNCTION_IMPL_NAME(__wfi)() { void PICO_WEAK_FUNCTION_IMPL_NAME(__wfi_c)() {
panic("Can't wait on irq for host core0 only implementation"); panic("Can't wait on irq for host core0 only implementation");
} }
PICO_WEAK_FUNCTION_DEF(__wfe) PICO_WEAK_FUNCTION_DEF(__wfe_c)
void PICO_WEAK_FUNCTION_IMPL_NAME(__wfe)() { void PICO_WEAK_FUNCTION_IMPL_NAME(__wfe_c)() {
while (!event_fired) tight_loop_contents(); while (!event_fired) tight_loop_contents();
} }

View file

@ -1,5 +1,5 @@
This directory contains files specific to the RP2350 hardware. It is only used when building for RP2350 platforms, i.e. This directory contains files specific to the RP2350 hardware. It is only used when building for RP2350 platforms, i.e.
`PICO_PLATFORM=rp2350-arm-s` or `PICO_PLATFORM=rp235-riscv` `PICO_PLATFORM=rp2350-arm-s` or `PICO_PLATFORM=rp2350-riscv`
`hardware_regs` contains low level hardware register #defines autogenerated from the RP2350 chip definition itself. `hardware_regs` contains low level hardware register #defines autogenerated from the RP2350 chip definition itself.

View file

@ -556,6 +556,7 @@ static inline uint32_t dma_encode_transfer_count(uint transfer_count) {
*/ */
static inline uint32_t dma_encode_transfer_count_with_self_trigger(uint transfer_count) { static inline uint32_t dma_encode_transfer_count_with_self_trigger(uint transfer_count) {
#if PICO_RP2040 #if PICO_RP2040
(void)transfer_count;
panic_unsupported(); panic_unsupported();
#else #else
return dma_encode_transfer_count(transfer_count) | (DMA_CH0_TRANS_COUNT_MODE_VALUE_TRIGGER_SELF << DMA_CH0_TRANS_COUNT_MODE_LSB); return dma_encode_transfer_count(transfer_count) | (DMA_CH0_TRANS_COUNT_MODE_VALUE_TRIGGER_SELF << DMA_CH0_TRANS_COUNT_MODE_LSB);
@ -578,8 +579,8 @@ static inline uint32_t dma_encode_endless_transfer_count(void) {
#if PICO_RP2040 #if PICO_RP2040
panic_unsupported(); panic_unsupported();
#else #else
static_assert(DMA_CH0_TRANS_COUNT_MODE_VALUE_ENDLESS == 0xf); static_assert(DMA_CH0_TRANS_COUNT_MODE_VALUE_ENDLESS == 0xf, "");
static_assert(DMA_CH0_TRANS_COUNT_MODE_LSB == 28); static_assert(DMA_CH0_TRANS_COUNT_MODE_LSB == 28, "");
return 0xffffffffu; return 0xffffffffu;
#endif #endif
} }

View file

@ -196,9 +196,11 @@ void gpio_set_irq_enabled(uint gpio, uint32_t events, bool enabled) {
} }
void gpio_set_irq_enabled_with_callback(uint gpio, uint32_t events, bool enabled, gpio_irq_callback_t callback) { void gpio_set_irq_enabled_with_callback(uint gpio, uint32_t events, bool enabled, gpio_irq_callback_t callback) {
// first set callback, then enable the interrupt // when enabling, first set callback, then enable the interrupt
gpio_set_irq_callback(callback); // when disabling, first disable the interrupt, then clear callback
if (enabled) gpio_set_irq_callback(callback);
gpio_set_irq_enabled(gpio, events, enabled); gpio_set_irq_enabled(gpio, events, enabled);
if (!enabled) gpio_set_irq_callback(callback);
if (enabled) irq_set_enabled(IO_IRQ_BANK0, true); if (enabled) irq_set_enabled(IO_IRQ_BANK0, true);
} }

View file

@ -128,7 +128,7 @@ extern "C" {
__h3_bextmi_rd; \ __h3_bextmi_rd; \
}) })
#else #else
#define __hazard3_bextm(nbits, rs1, rs2) (((rs1) >> ((shamt) & 0x1f)) & (0xffu >> (7 - (((nbits) - 1) & 0x7)))) #define __hazard3_bextmi(nbits, rs1, rs2) (((rs1) >> ((shamt) & 0x1f)) & (0xffu >> (7 - (((nbits) - 1) & 0x7))))
#endif #endif
#ifdef __hazard3_extension_xh3power #ifdef __hazard3_extension_xh3power

View file

@ -128,6 +128,15 @@ void irq_set_pending(uint num) {
#endif #endif
} }
#if !PICO_NO_RAM_VECTOR_TABLE
static void set_raw_irq_handler_and_unlock(uint num, irq_handler_t handler, uint32_t save) {
// update vtable (vtable_handler may be same or updated depending on cases, but we do it anyway for compactness)
get_vtable()[VTABLE_FIRST_IRQ + num] = handler;
__dmb();
spin_unlock(spin_lock_instance(PICO_SPINLOCK_ID_IRQ), save);
}
#endif
#if !PICO_DISABLE_SHARED_IRQ_HANDLERS && !PICO_NO_RAM_VECTOR_TABLE #if !PICO_DISABLE_SHARED_IRQ_HANDLERS && !PICO_NO_RAM_VECTOR_TABLE
// limited by 8 bit relative links (and reality) // limited by 8 bit relative links (and reality)
static_assert(PICO_MAX_SHARED_IRQ_HANDLERS >= 1 && PICO_MAX_SHARED_IRQ_HANDLERS < 0x7f, ""); static_assert(PICO_MAX_SHARED_IRQ_HANDLERS >= 1 && PICO_MAX_SHARED_IRQ_HANDLERS < 0x7f, "");
@ -202,13 +211,6 @@ bool irq_has_shared_handler(uint irq_num) {
return is_shared_irq_raw_handler(handler); return is_shared_irq_raw_handler(handler);
} }
static void set_raw_irq_handler_and_unlock(uint num, irq_handler_t handler, uint32_t save) {
// update vtable (vtable_handler may be same or updated depending on cases, but we do it anyway for compactness)
get_vtable()[VTABLE_FIRST_IRQ + num] = handler;
__dmb();
spin_unlock(spin_lock_instance(PICO_SPINLOCK_ID_IRQ), save);
}
#else // PICO_DISABLE_SHARED_IRQ_HANDLERS && PICO_NO_RAM_VECTOR_TABLE #else // PICO_DISABLE_SHARED_IRQ_HANDLERS && PICO_NO_RAM_VECTOR_TABLE
#define is_shared_irq_raw_handler(h) false #define is_shared_irq_raw_handler(h) false
bool irq_has_shared_handler(uint irq_num) { bool irq_has_shared_handler(uint irq_num) {

View file

@ -148,7 +148,7 @@ static inline uint pio_encode_sideset(uint sideset_bit_count, uint value) {
* \return the side set bits to be ORed with an instruction encoding * \return the side set bits to be ORed with an instruction encoding
*/ */
static inline uint pio_encode_sideset_opt(uint sideset_bit_count, uint value) { static inline uint pio_encode_sideset_opt(uint sideset_bit_count, uint value) {
valid_params_if(PIO_INSTRUCTIONS, sideset_bit_count >= 0 && sideset_bit_count <= 4); valid_params_if(PIO_INSTRUCTIONS, sideset_bit_count <= 4);
valid_params_if(PIO_INSTRUCTIONS, value <= ((1u << sideset_bit_count) - 1)); valid_params_if(PIO_INSTRUCTIONS, value <= ((1u << sideset_bit_count) - 1));
return 0x1000u | value << (12u - sideset_bit_count); return 0x1000u | value << (12u - sideset_bit_count);
} }

View file

@ -94,6 +94,9 @@ __force_inline static void __sev(void) {
pico_default_asm_volatile ("sev"); pico_default_asm_volatile ("sev");
#endif #endif
} }
#else
// Forward declare so we don't have to #include <arm_acle.h>.
void __sev(void);
#endif #endif
/*! \brief Insert a WFE instruction in to the code path. /*! \brief Insert a WFE instruction in to the code path.
@ -110,6 +113,9 @@ __force_inline static void __wfe(void) {
pico_default_asm_volatile ("wfe"); pico_default_asm_volatile ("wfe");
#endif #endif
} }
#else
// Forward declare so we don't have to #include <arm_acle.h>.
void __wfe(void);
#endif #endif
/*! \brief Insert a WFI instruction in to the code path. /*! \brief Insert a WFI instruction in to the code path.
@ -121,6 +127,9 @@ __force_inline static void __wfe(void) {
__force_inline static void __wfi(void) { __force_inline static void __wfi(void) {
pico_default_asm_volatile("wfi"); pico_default_asm_volatile("wfi");
} }
#else
// Forward declare so we don't have to #include <arm_acle.h>.
void __wfi(void);
#endif #endif
/*! \brief Insert a DMB instruction in to the code path. /*! \brief Insert a DMB instruction in to the code path.

View file

@ -11,6 +11,6 @@
#include "pico/sha256.h" #include "pico/sha256.h"
typedef struct pico_sha256_state mbedtls_sha256_context; typedef struct pico_sha256_state mbedtls_sha256_context;
#endif // PICO_RP2350 #endif // LIB_PICO_SHA256
#endif #endif

View file

@ -370,7 +370,7 @@ static bool multicore_doorbell_claim_under_lock(uint doorbell_num, uint core_mas
(is_bit_claimed(doorbell_claimed[1], doorbell_num + 1u) << 1)); (is_bit_claimed(doorbell_claimed[1], doorbell_num + 1u) << 1));
if (claimed_cores_for_doorbell & core_mask) { if (claimed_cores_for_doorbell & core_mask) {
if (required) { if (required) {
panic( "Multicoore doorbell %d already claimed on core mask 0x%x; requested core mask 0x%x\n", panic( "Multicore doorbell %d already claimed on core mask 0x%x; requested core mask 0x%x\n",
claimed_cores_for_doorbell, core_mask); claimed_cores_for_doorbell, core_mask);
} }
return false; return false;

View file

@ -18,5 +18,3 @@ if (PICO_CYW43_SUPPORTED)
) )
endif() endif()
pico_generate_pio_header(pico_status_led ${CMAKE_CURRENT_LIST_DIR}/ws2812.pio) pico_generate_pio_header(pico_status_led ${CMAKE_CURRENT_LIST_DIR}/ws2812.pio)
get_target_property(OUT pico_status_led LINK_LIBRARIES)

View file

@ -109,7 +109,7 @@ bool status_led_init(void);
* *
* \param context An \ref async_context used to communicate with the status LED (e.g. on Pico W or Pico 2 W) * \param context An \ref async_context used to communicate with the status LED (e.g. on Pico W or Pico 2 W)
* \return Returns true if the LED was initialized successfully, otherwise false on failure * \return Returns true if the LED was initialized successfully, otherwise false on failure
* \sa status_led_init_with_context * \sa status_led_init
*/ */
bool status_led_init_with_context(struct async_context *context); bool status_led_init_with_context(struct async_context *context);

View file

@ -80,7 +80,8 @@ bool colored_status_led_set_state(bool led_on) {
if (colored_status_led_supported()) { if (colored_status_led_supported()) {
#if COLORED_STATUS_LED_USING_WS2812_PIO #if COLORED_STATUS_LED_USING_WS2812_PIO
success = true; success = true;
if (led_on && !colored_status_led_on) { if (led_on) {
// Turn the LED "on" even if it was already on, as the color might have changed
success = set_ws2812(colored_status_led_on_color); success = set_ws2812(colored_status_led_on_color);
} else if (!led_on && colored_status_led_on) { } else if (!led_on && colored_status_led_on) {
success = set_ws2812(0); success = set_ws2812(0);