diff --git a/README.md b/README.md index f01346f..99e9ab5 100755 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ The absence of real-time features necessary for creating professional-level embe - **AVR**: ATmega168/328, ATmega16u4/32u4, ATmega2560 - **ARM**: Teensy (all versions), STM32XX, Seeed Studio XIAO M0 - **ESP32**: All ESP32 family boards -- **RP2040**: Raspberry Pi Pico and compatible boards +- **RP2040/RP2350**: Raspberry Pico, Pico 2, and compatible boards ## Why uClock? diff --git a/examples/RP2040UsbUartMasterClock/RP2040UsbUartMasterClock.ino b/examples/RP2040UsbUartMasterClock/RP2040UsbUartMasterClock.ino index cf5b6eb..7faf971 100644 --- a/examples/RP2040UsbUartMasterClock/RP2040UsbUartMasterClock.ino +++ b/examples/RP2040UsbUartMasterClock/RP2040UsbUartMasterClock.ino @@ -54,7 +54,7 @@ void onClockStop() { } void setup() { -#if defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_ARCH_RP2040) +#if defined(ARDUINO_ARCH_MBED) && (defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_ARCH_RP2350)) // Manual begin() is required on core without built-in support for TinyUSB such as mbed rp2040 TinyUSB_Device_Init(0); #endif diff --git a/library.json b/library.json index ffe6d19..a0ec300 100644 --- a/library.json +++ b/library.json @@ -1,7 +1,7 @@ { "name": "uClock", "version": "2.3.0", - "description": "A Library to implement BPM clock tick calls using hardware interruption. Supported and tested on AVR boards(ATmega168/328, ATmega16u4/32u4 and ATmega2560) and ARM boards(Teensy, STM32XX, ESP32, Raspberry Pico, Seedstudio XIAO M0 and RP2040)", + "description": "A Library to implement BPM clock tick calls using hardware interruption. Supported and tested on AVR boards(ATmega168/328, ATmega16u4/32u4 and ATmega2560) and ARM boards(Teensy, STM32XX, ESP32, Raspberry Pico, Seedstudio XIAO M0 and RP2040/RP2350)", "keywords": "bpm, clock, timing, tick, music, generator", "repository": { "type": "git", diff --git a/library.properties b/library.properties index 86a95fc..32aa442 100755 --- a/library.properties +++ b/library.properties @@ -3,8 +3,8 @@ version=2.3.0 author=Romulo Silva maintainer=Romulo Silva sentence=BPM clock generator for Arduino platform. -paragraph=A Library to implement BPM clock tick calls using hardware interruption. Supported and tested on AVR boards(ATmega168/328, ATmega16u4/32u4 and ATmega2560) and ARM boards(Teensy, STM32XX, ESP32, Raspberry Pico, Seedstudio XIAO M0 and RP2040) +paragraph=A Library to implement BPM clock tick calls using hardware interruption. Supported and tested on AVR boards(ATmega168/328, ATmega16u4/32u4 and ATmega2560) and ARM boards(Teensy, STM32XX, ESP32, Raspberry Pico, Seedstudio XIAO M0 and RP2040/RP2350) category=Timing url=https://github.com/midilab/uClock -architectures=avr,arm,samd,stm32,esp32,rp2040 +architectures=avr,arm,samd,stm32,esp32,rp2040,rp2350 includes=uClock.h diff --git a/src/platforms/rp2040.h b/src/platforms/rp2040.h index eb918c2..e804f33 100644 --- a/src/platforms/rp2040.h +++ b/src/platforms/rp2040.h @@ -19,12 +19,10 @@ bool handlerISR(repeating_timer *timer) void initTimer(uint32_t init_clock) { // set up RPi interrupt timer - // todo: actually should be -init_clock so that timer is set to start init_clock us after last tick, instead of init_clock us after finished processing last tick! - add_repeating_timer_us(init_clock, &handlerISR, NULL, &timer); + add_repeating_timer_us(-static_cast(init_clock), &handlerISR, NULL, &timer); } void setTimer(uint32_t us_interval) { cancel_repeating_timer(&timer); - // todo: actually should be -us_interval so that timer is set to start init_clock us after last tick, instead of init_clock us after finished processing last tick! - add_repeating_timer_us(us_interval, &handlerISR, NULL, &timer); -} \ No newline at end of file + add_repeating_timer_us(-static_cast(us_interval), &handlerISR, NULL, &timer); +} diff --git a/src/uClock.cpp b/src/uClock.cpp index 73a3cf3..c3ff6c2 100755 --- a/src/uClock.cpp +++ b/src/uClock.cpp @@ -67,9 +67,9 @@ #define UCLOCK_PLATFORM_FOUND #endif // - // RP2040 (Raspberry Pico) family + // RP2040 and RP2350 (Raspberry Pico and Pico 2) family // - #if defined(ARDUINO_ARCH_RP2040) + #if defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_ARCH_RP2350) #include "platforms/rp2040.h" #define UCLOCK_PLATFORM_FOUND #endif