diff --git a/MODULE.bazel b/MODULE.bazel index 31d6105cc..111ed24cd 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,6 +1,6 @@ module( name = "pico-sdk", - version = "2.2.0", + version = "2.2.1-develop", ) bazel_dep(name = "platforms", version = "0.0.9") diff --git a/pico_sdk_version.cmake b/pico_sdk_version.cmake index 0a3525873..aca3c585e 100644 --- a/pico_sdk_version.cmake +++ b/pico_sdk_version.cmake @@ -7,10 +7,10 @@ if (NOT DEFINED PICO_SDK_VERSION_MAJOR) 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_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_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() # PICO_BUILD_DEFINE: PICO_SDK_VERSION_STRING, SDK version string, type=string, default=Current SDK version string, group=pico_base diff --git a/src/boards/include/boards/waveshare_pico_cam_a.h b/src/boards/include/boards/waveshare_pico_cam_a.h old mode 100755 new mode 100644 diff --git a/src/boards/include/boards/waveshare_rp2040_ble.h b/src/boards/include/boards/waveshare_rp2040_ble.h old mode 100755 new mode 100644 diff --git a/src/boards/include/boards/waveshare_rp2040_eth.h b/src/boards/include/boards/waveshare_rp2040_eth.h old mode 100755 new mode 100644 diff --git a/src/boards/include/boards/waveshare_rp2040_geek.h b/src/boards/include/boards/waveshare_rp2040_geek.h old mode 100755 new mode 100644 diff --git a/src/boards/include/boards/waveshare_rp2040_matrix.h b/src/boards/include/boards/waveshare_rp2040_matrix.h old mode 100755 new mode 100644 diff --git a/src/boards/include/boards/waveshare_rp2040_pizero.h b/src/boards/include/boards/waveshare_rp2040_pizero.h old mode 100755 new mode 100644 diff --git a/src/boards/include/boards/waveshare_rp2040_power_management_hat_b.h b/src/boards/include/boards/waveshare_rp2040_power_management_hat_b.h old mode 100755 new mode 100644 diff --git a/src/boards/include/boards/waveshare_rp2040_tiny.h b/src/boards/include/boards/waveshare_rp2040_tiny.h old mode 100755 new mode 100644 diff --git a/src/boards/include/boards/waveshare_rp2040_touch_lcd_1.28.h b/src/boards/include/boards/waveshare_rp2040_touch_lcd_1.28.h old mode 100755 new mode 100644 diff --git a/src/boards/include/boards/waveshare_rp2350_eth.h b/src/boards/include/boards/waveshare_rp2350_eth.h old mode 100755 new mode 100644 diff --git a/src/boards/include/boards/waveshare_rp2350_geek.h b/src/boards/include/boards/waveshare_rp2350_geek.h old mode 100755 new mode 100644 diff --git a/src/boards/include/boards/waveshare_rp2350_lcd_0.96.h b/src/boards/include/boards/waveshare_rp2350_lcd_0.96.h old mode 100755 new mode 100644 diff --git a/src/boards/include/boards/waveshare_rp2350_lcd_1.28.h b/src/boards/include/boards/waveshare_rp2350_lcd_1.28.h old mode 100755 new mode 100644 diff --git a/src/boards/include/boards/waveshare_rp2350_one.h b/src/boards/include/boards/waveshare_rp2350_one.h old mode 100755 new mode 100644 diff --git a/src/boards/include/boards/waveshare_rp2350_plus_16mb.h b/src/boards/include/boards/waveshare_rp2350_plus_16mb.h old mode 100755 new mode 100644 diff --git a/src/boards/include/boards/waveshare_rp2350_plus_4mb.h b/src/boards/include/boards/waveshare_rp2350_plus_4mb.h old mode 100755 new mode 100644 diff --git a/src/boards/include/boards/waveshare_rp2350_tiny.h b/src/boards/include/boards/waveshare_rp2350_tiny.h old mode 100755 new mode 100644 diff --git a/src/boards/include/boards/waveshare_rp2350_touch_lcd_1.28.h b/src/boards/include/boards/waveshare_rp2350_touch_lcd_1.28.h old mode 100755 new mode 100644 diff --git a/src/boards/include/boards/waveshare_rp2350_zero.h b/src/boards/include/boards/waveshare_rp2350_zero.h old mode 100755 new mode 100644 diff --git a/src/rp2350/README.md b/src/rp2350/README.md index 7a710171d..6dacfa85a 100644 --- a/src/rp2350/README.md +++ b/src/rp2350/README.md @@ -1,5 +1,5 @@ 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`, `PICO_PLATFORM=rp2350-arm-ns` or `PICO_PLATFORM=rp2350-riscv` `hardware_regs` contains low level hardware register #defines autogenerated from the RP2350 chip definition itself. diff --git a/src/rp2_common/hardware_dma/include/hardware/dma.h b/src/rp2_common/hardware_dma/include/hardware/dma.h index 2ae64d5fa..316c55842 100644 --- a/src/rp2_common/hardware_dma/include/hardware/dma.h +++ b/src/rp2_common/hardware_dma/include/hardware/dma.h @@ -578,8 +578,8 @@ static inline uint32_t dma_encode_endless_transfer_count(void) { #if PICO_RP2040 panic_unsupported(); #else - 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_VALUE_ENDLESS == 0xf, ""); + static_assert(DMA_CH0_TRANS_COUNT_MODE_LSB == 28, ""); return 0xffffffffu; #endif } diff --git a/src/rp2_common/hardware_gpio/gpio.c b/src/rp2_common/hardware_gpio/gpio.c index 292041a19..a5560bbb8 100644 --- a/src/rp2_common/hardware_gpio/gpio.c +++ b/src/rp2_common/hardware_gpio/gpio.c @@ -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) { - // first set callback, then enable the interrupt - gpio_set_irq_callback(callback); + // when enabling, first set callback, then enable the interrupt + // when disabling, first disable the interrupt, then clear callback + if (enabled) gpio_set_irq_callback(callback); gpio_set_irq_enabled(gpio, events, enabled); + if (!enabled) gpio_set_irq_callback(callback); if (enabled) irq_set_enabled(IO_IRQ_BANK0, true); } diff --git a/src/rp2_common/hardware_hazard3/include/hardware/hazard3/instructions.h b/src/rp2_common/hardware_hazard3/include/hardware/hazard3/instructions.h index 7abeb5ba6..f14b8c01c 100644 --- a/src/rp2_common/hardware_hazard3/include/hardware/hazard3/instructions.h +++ b/src/rp2_common/hardware_hazard3/include/hardware/hazard3/instructions.h @@ -128,7 +128,7 @@ extern "C" { __h3_bextmi_rd; \ }) #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 #ifdef __hazard3_extension_xh3power diff --git a/src/rp2_common/hardware_irq/irq.c b/src/rp2_common/hardware_irq/irq.c index fc3d6f12c..fdcbb00fb 100644 --- a/src/rp2_common/hardware_irq/irq.c +++ b/src/rp2_common/hardware_irq/irq.c @@ -128,6 +128,15 @@ void irq_set_pending(uint num) { #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 // limited by 8 bit relative links (and reality) 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); } -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 #define is_shared_irq_raw_handler(h) false bool irq_has_shared_handler(uint irq_num) { diff --git a/src/rp2_common/hardware_pio/include/hardware/pio_instructions.h b/src/rp2_common/hardware_pio/include/hardware/pio_instructions.h index e990a7284..85804f954 100644 --- a/src/rp2_common/hardware_pio/include/hardware/pio_instructions.h +++ b/src/rp2_common/hardware_pio/include/hardware/pio_instructions.h @@ -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 */ 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)); return 0x1000u | value << (12u - sideset_bit_count); } diff --git a/src/rp2_common/pico_mbedtls/include/sha256_alt.h b/src/rp2_common/pico_mbedtls/include/sha256_alt.h index b6658b2a7..78d9a9183 100644 --- a/src/rp2_common/pico_mbedtls/include/sha256_alt.h +++ b/src/rp2_common/pico_mbedtls/include/sha256_alt.h @@ -11,6 +11,6 @@ #include "pico/sha256.h" typedef struct pico_sha256_state mbedtls_sha256_context; -#endif // PICO_RP2350 +#endif // LIB_PICO_SHA256 #endif diff --git a/src/rp2_common/pico_status_led/CMakeLists.txt b/src/rp2_common/pico_status_led/CMakeLists.txt index c14e607bf..cdc30bdf0 100644 --- a/src/rp2_common/pico_status_led/CMakeLists.txt +++ b/src/rp2_common/pico_status_led/CMakeLists.txt @@ -18,5 +18,3 @@ if (PICO_CYW43_SUPPORTED) ) endif() pico_generate_pio_header(pico_status_led ${CMAKE_CURRENT_LIST_DIR}/ws2812.pio) - -get_target_property(OUT pico_status_led LINK_LIBRARIES) diff --git a/src/rp2_common/pico_status_led/include/pico/status_led.h b/src/rp2_common/pico_status_led/include/pico/status_led.h index be7c0bd49..4870bc9b6 100644 --- a/src/rp2_common/pico_status_led/include/pico/status_led.h +++ b/src/rp2_common/pico_status_led/include/pico/status_led.h @@ -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) * \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);