From 4b2fa205e7de5510305e92b0aa1384e023194f25 Mon Sep 17 00:00:00 2001 From: Linar Yusupov Date: Mon, 26 Aug 2024 09:09:09 +0300 Subject: [PATCH] [RP2XXX] bump Pico Core up to 4.0.1 (it uses Pico SDK 2.0.0) --- .github/workflows/main.yml | 2 +- software/firmware/source/SkyView/Platform_RP2040.cpp | 7 +++++++ software/firmware/source/SkyView/Platform_RP2040.h | 3 +++ software/firmware/source/SkyWatch/Platform_RP2040.cpp | 7 +++++++ software/firmware/source/SkyWatch/Platform_RP2040.h | 3 +++ software/firmware/source/SoftRF/src/platform/RP2XXX.cpp | 5 +++++ software/firmware/source/SoftRF/src/platform/RP2XXX.h | 3 +++ 7 files changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 936bc7f0a..0b2b5efe0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -388,7 +388,7 @@ jobs: fi if [[ "$BOARD" =~ "rp2040:rp2040:" ]]; then arduino --pref "boardsmanager.additional.urls=https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json" --save-prefs ; - arduino --install-boards rp2040:rp2040:3.9.5 ; + arduino --install-boards rp2040:rp2040:4.0.1 ; arduino --board $BOARD --save-prefs ; if [[ "$BOARD" =~ "rp2040:rp2040:rpipicow" ]]; then arduino --pref "custom_freq=rpipicow_120" --save-prefs ; diff --git a/software/firmware/source/SkyView/Platform_RP2040.cpp b/software/firmware/source/SkyView/Platform_RP2040.cpp index b49912e23..27923c2f2 100644 --- a/software/firmware/source/SkyView/Platform_RP2040.cpp +++ b/software/firmware/source/SkyView/Platform_RP2040.cpp @@ -542,7 +542,9 @@ static void RP2040_fini() // back from dormant state rosc_enable(); +#if PICO_SDK_VERSION_MAJOR < 2 clocks_init(); +#endif /* PICO_SDK_VERSION_MAJOR */ rp2040.restart(); } @@ -667,8 +669,13 @@ static float RP2040_Battery_voltage() } #if SOC_GPIO_PIN_BATTERY != SOC_UNUSED_PIN +#if PICO_SDK_VERSION_MAJOR < 2 enum gpio_function pin25_func; enum gpio_function pin29_func; +#else + gpio_function_t pin25_func; + gpio_function_t pin29_func; +#endif /* PICO_SDK_VERSION_MAJOR */ uint pin25_dir; uint pin29_dir; diff --git a/software/firmware/source/SkyView/Platform_RP2040.h b/software/firmware/source/SkyView/Platform_RP2040.h index f38be849c..cb1af7fc6 100644 --- a/software/firmware/source/SkyView/Platform_RP2040.h +++ b/software/firmware/source/SkyView/Platform_RP2040.h @@ -27,6 +27,9 @@ #define Serial_setDebugOutput(x) ({}) #define WIFI_STA_TIMEOUT 20000 extern WebServer server; +#if PICO_SDK_VERSION_MAJOR == 2 +#define EXCLUDE_BLUETOOTH +#endif /* PICO_SDK_VERSION_MAJOR */ #else #include #define EXCLUDE_WIFI diff --git a/software/firmware/source/SkyWatch/Platform_RP2040.cpp b/software/firmware/source/SkyWatch/Platform_RP2040.cpp index 441abb3f1..ff9c01ae3 100644 --- a/software/firmware/source/SkyWatch/Platform_RP2040.cpp +++ b/software/firmware/source/SkyWatch/Platform_RP2040.cpp @@ -158,7 +158,9 @@ static void RP2040_fini() #if 0 /* TBD */ // back from dormant state rosc_enable(); +#if PICO_SDK_VERSION_MAJOR < 2 clocks_init(); +#endif /* PICO_SDK_VERSION_MAJOR */ rp2040.restart(); #endif @@ -341,8 +343,13 @@ static float RP2040_Battery_voltage() uint16_t mV = 0; #if SOC_GPIO_PIN_BATTERY != SOC_UNUSED_PIN +#if PICO_SDK_VERSION_MAJOR < 2 enum gpio_function pin25_func; enum gpio_function pin29_func; +#else + gpio_function_t pin25_func; + gpio_function_t pin29_func; +#endif /* PICO_SDK_VERSION_MAJOR */ uint pin25_dir; uint pin29_dir; diff --git a/software/firmware/source/SkyWatch/Platform_RP2040.h b/software/firmware/source/SkyWatch/Platform_RP2040.h index c3577a455..123d2137a 100644 --- a/software/firmware/source/SkyWatch/Platform_RP2040.h +++ b/software/firmware/source/SkyWatch/Platform_RP2040.h @@ -27,6 +27,9 @@ #define Serial_setDebugOutput(x) ({}) #define WIFI_STA_TIMEOUT 20000 extern WebServer server; +#if PICO_SDK_VERSION_MAJOR == 2 +#define EXCLUDE_BLUETOOTH +#endif /* PICO_SDK_VERSION_MAJOR */ #else #include #define EXCLUDE_WIFI diff --git a/software/firmware/source/SoftRF/src/platform/RP2XXX.cpp b/software/firmware/source/SoftRF/src/platform/RP2XXX.cpp index a583ae91c..da470ccb0 100644 --- a/software/firmware/source/SoftRF/src/platform/RP2XXX.cpp +++ b/software/firmware/source/SoftRF/src/platform/RP2XXX.cpp @@ -976,8 +976,13 @@ static float RP2xxx_Battery_param(uint8_t param) uint16_t mV = 0; #if SOC_GPIO_PIN_BATTERY != SOC_UNUSED_PIN +#if PICO_SDK_VERSION_MAJOR < 2 enum gpio_function pin25_func; enum gpio_function pin29_func; +#else + gpio_function_t pin25_func; + gpio_function_t pin29_func; +#endif /* PICO_SDK_VERSION_MAJOR */ uint pin25_dir; uint pin29_dir; diff --git a/software/firmware/source/SoftRF/src/platform/RP2XXX.h b/software/firmware/source/SoftRF/src/platform/RP2XXX.h index 231cd0336..39f67a0aa 100644 --- a/software/firmware/source/SoftRF/src/platform/RP2XXX.h +++ b/software/firmware/source/SoftRF/src/platform/RP2XXX.h @@ -236,6 +236,9 @@ struct rst_info { #define Serial_setDebugOutput(x) ({}) #define WIFI_STA_TIMEOUT 20000 #define NMEA_TCP_SERVICE +#if PICO_SDK_VERSION_MAJOR == 2 +#define EXCLUDE_BLUETOOTH +#endif /* PICO_SDK_VERSION_MAJOR */ /* Experimental */ //#define ENABLE_BT_VOICE #else