From 023bb1cae85723e0627ac9041dd72a6ef3fa0f9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Fiedler?= Date: Wed, 15 Jun 2022 07:50:10 +0200 Subject: [PATCH 1/4] ignore setting storage for RP2040 for now Fixes compiler errors for RP2040 by disabling the setting storage feature by now. Must be implemented later. --- src/hellodrum.cpp | 12 ++++++++++-- src/hellodrum.h | 5 ++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/hellodrum.cpp b/src/hellodrum.cpp index 9053555..dfd3e80 100644 --- a/src/hellodrum.cpp +++ b/src/hellodrum.cpp @@ -13,7 +13,10 @@ #include "hellodrum.h" #include "Arduino.h" -#ifdef ESP32 +#if defined(ARDUINO_ARCH_MBED_RP2040) || defined(ARDUINO_ARCH_RP2040) + // ignore for now + //ToDo: Implement EEPROM handler for RP2040, see https://arduino-pico.readthedocs.io/en/latest/eeprom.html#eeprom-examples +#elif defined(ESP32) #include "EEPROM_ESP.h" #else #include "EEPROM.h" @@ -1352,7 +1355,12 @@ void HelloDrum::hihatControlMUX() //////////////////////////// 6. EEPROM SETTING ////////////////////////////// -#ifdef ESP32 +#if defined(ARDUINO_ARCH_MBED_RP2040) || defined(ARDUINO_ARCH_RP2040) + + // ignore for now + //ToDo: Implement EEPROM handler for RP2040, see https://arduino-pico.readthedocs.io/en/latest/eeprom.html#eeprom-examples + +#elif defined(ESP32) void HelloDrum::settingEnable() { diff --git a/src/hellodrum.h b/src/hellodrum.h index 67dc811..3b93489 100644 --- a/src/hellodrum.h +++ b/src/hellodrum.h @@ -12,7 +12,10 @@ #include "Arduino.h" -#ifdef ESP32 +#if defined(ARDUINO_ARCH_MBED_RP2040) || defined(ARDUINO_ARCH_RP2040) + // ignore for now + //ToDo: Implement EEPROM handler for RP2040, see https://arduino-pico.readthedocs.io/en/latest/eeprom.html#eeprom-examples +#elif defined(ESP32) #include "EEPROM_ESP.h" #else #include "EEPROM.h" From 93abbf2547e865b8889ca7c7bdfdacbde4879d70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Fiedler?= Date: Wed, 15 Jun 2022 07:55:37 +0200 Subject: [PATCH 2/4] check for all RP2040 boards --- src/hellodrum.cpp | 4 ++-- src/hellodrum.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hellodrum.cpp b/src/hellodrum.cpp index dfd3e80..11786b1 100644 --- a/src/hellodrum.cpp +++ b/src/hellodrum.cpp @@ -13,7 +13,7 @@ #include "hellodrum.h" #include "Arduino.h" -#if defined(ARDUINO_ARCH_MBED_RP2040) || defined(ARDUINO_ARCH_RP2040) +#if ( defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_RASPBERRY_PI_PICO) || defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) || defined(ARDUINO_GENERIC_RP2040) ) // ignore for now //ToDo: Implement EEPROM handler for RP2040, see https://arduino-pico.readthedocs.io/en/latest/eeprom.html#eeprom-examples #elif defined(ESP32) @@ -1355,7 +1355,7 @@ void HelloDrum::hihatControlMUX() //////////////////////////// 6. EEPROM SETTING ////////////////////////////// -#if defined(ARDUINO_ARCH_MBED_RP2040) || defined(ARDUINO_ARCH_RP2040) +#if ( defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_RASPBERRY_PI_PICO) || defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) || defined(ARDUINO_GENERIC_RP2040) ) // ignore for now //ToDo: Implement EEPROM handler for RP2040, see https://arduino-pico.readthedocs.io/en/latest/eeprom.html#eeprom-examples diff --git a/src/hellodrum.h b/src/hellodrum.h index 3b93489..74c60f2 100644 --- a/src/hellodrum.h +++ b/src/hellodrum.h @@ -12,7 +12,7 @@ #include "Arduino.h" -#if defined(ARDUINO_ARCH_MBED_RP2040) || defined(ARDUINO_ARCH_RP2040) +#if ( defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_RASPBERRY_PI_PICO) || defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) || defined(ARDUINO_GENERIC_RP2040) ) // ignore for now //ToDo: Implement EEPROM handler for RP2040, see https://arduino-pico.readthedocs.io/en/latest/eeprom.html#eeprom-examples #elif defined(ESP32) From 5e597ac151e24d4924f0e48505231efc803fd68e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Fiedler?= Date: Wed, 15 Jun 2022 07:59:32 +0200 Subject: [PATCH 3/4] add missing def check --- src/hellodrum.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/hellodrum.cpp b/src/hellodrum.cpp index 11786b1..3fd61b8 100644 --- a/src/hellodrum.cpp +++ b/src/hellodrum.cpp @@ -1929,7 +1929,13 @@ void HelloDrum::settingName(const char *instrumentName) nameIndex++; } -#ifdef ESP32 + +#if ( defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_RASPBERRY_PI_PICO) || defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) || defined(ARDUINO_GENERIC_RP2040) ) + + // ignore for now + //ToDo: Implement EEPROM handler for RP2040, see https://arduino-pico.readthedocs.io/en/latest/eeprom.html#eeprom-examples + +#elif defined(ESP32) void HelloDrum::loadMemory() { From 8e1b0c6b2bb969db19c2aadce65c02613dfdab53 Mon Sep 17 00:00:00 2001 From: Denis Terekhov Date: Sat, 30 Jul 2022 16:05:27 +0300 Subject: [PATCH 4/4] Draft support for Arduino Nano 33 BLE (disable EEPROM) --- library.properties | 2 +- src/hellodrum.cpp | 6 +++--- src/hellodrum.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/library.properties b/library.properties index dd7cdbf..3632eb6 100644 --- a/library.properties +++ b/library.properties @@ -6,5 +6,5 @@ sentence=Arduino Library for piezo sensing paragraph=By combining with the MIDI library, you can easily create MIDI converters. By combining with Teensy audio, you can easily create synth drums. category=Sensors url=https://github.com/RyoKosaka/HelloDrum-arduino-Library -architectures=avr,teensy,esp32 +architectures=avr,teensy,esp32,mbed_nano includes=hellodrum.h \ No newline at end of file diff --git a/src/hellodrum.cpp b/src/hellodrum.cpp index 3fd61b8..d920f4a 100644 --- a/src/hellodrum.cpp +++ b/src/hellodrum.cpp @@ -13,7 +13,7 @@ #include "hellodrum.h" #include "Arduino.h" -#if ( defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_RASPBERRY_PI_PICO) || defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) || defined(ARDUINO_GENERIC_RP2040) ) +#if ( defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_RASPBERRY_PI_PICO) || defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) || defined(ARDUINO_GENERIC_RP2040) || defined(NRF52840_XXAA) ) // ignore for now //ToDo: Implement EEPROM handler for RP2040, see https://arduino-pico.readthedocs.io/en/latest/eeprom.html#eeprom-examples #elif defined(ESP32) @@ -1355,7 +1355,7 @@ void HelloDrum::hihatControlMUX() //////////////////////////// 6. EEPROM SETTING ////////////////////////////// -#if ( defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_RASPBERRY_PI_PICO) || defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) || defined(ARDUINO_GENERIC_RP2040) ) +#if ( defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_RASPBERRY_PI_PICO) || defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) || defined(ARDUINO_GENERIC_RP2040) || defined(NRF52840_XXAA) ) // ignore for now //ToDo: Implement EEPROM handler for RP2040, see https://arduino-pico.readthedocs.io/en/latest/eeprom.html#eeprom-examples @@ -1930,7 +1930,7 @@ void HelloDrum::settingName(const char *instrumentName) } -#if ( defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_RASPBERRY_PI_PICO) || defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) || defined(ARDUINO_GENERIC_RP2040) ) +#if ( defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_RASPBERRY_PI_PICO) || defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) || defined(ARDUINO_GENERIC_RP2040) || defined(NRF52840_XXAA) ) // ignore for now //ToDo: Implement EEPROM handler for RP2040, see https://arduino-pico.readthedocs.io/en/latest/eeprom.html#eeprom-examples diff --git a/src/hellodrum.h b/src/hellodrum.h index 74c60f2..0ebeb74 100644 --- a/src/hellodrum.h +++ b/src/hellodrum.h @@ -12,7 +12,7 @@ #include "Arduino.h" -#if ( defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_RASPBERRY_PI_PICO) || defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) || defined(ARDUINO_GENERIC_RP2040) ) +#if ( defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_RASPBERRY_PI_PICO) || defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) || defined(ARDUINO_GENERIC_RP2040) || defined(NRF52840_XXAA) ) // ignore for now //ToDo: Implement EEPROM handler for RP2040, see https://arduino-pico.readthedocs.io/en/latest/eeprom.html#eeprom-examples #elif defined(ESP32)