From 477c6d0385ed3c278e1360271dac194065383c07 Mon Sep 17 00:00:00 2001 From: "jacob.eva" Date: Sat, 20 Jan 2024 10:46:38 +0000 Subject: [PATCH] Make flash libraries inclusion exclusive to NRF52 --- Config.h | 2 +- LoRa.cpp | 2 +- Makefile | 2 +- flash_cache.c | 4 ++-- flash_cache.h | 4 ++-- flash_nrf5x.c | 4 ++-- flash_nrf5x.h | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Config.h b/Config.h index 7880894..1e4ac80 100644 --- a/Config.h +++ b/Config.h @@ -77,7 +77,7 @@ #elif defined(ESP32) #define PLATFORM PLATFORM_ESP32 #define MCU_VARIANT MCU_ESP32 - #elif defined(nRF52) + #elif defined(NRF52840_XXAA) #define PLATFORM PLATFORM_NRF52 #define MCU_VARIANT MCU_NRF52 #else diff --git a/LoRa.cpp b/LoRa.cpp index 72e9818..5731587 100644 --- a/LoRa.cpp +++ b/LoRa.cpp @@ -20,7 +20,7 @@ #elif defined(ESP32) #define PLATFORM PLATFORM_ESP32 #define MCU_VARIANT MCU_ESP32 -#elif defined(nRF52) +#elif defined(NRF52840_XXAA) #define PLATFORM PLATFORM_NRF52 #define MCU_VARIANT MCU_NRF52 #endif diff --git a/Makefile b/Makefile index 03957d6..ee69719 100644 --- a/Makefile +++ b/Makefile @@ -92,7 +92,7 @@ firmware-genericesp32: arduino-cli compile --fqbn esp32:esp32:esp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x35\"" firmware-rak4630: - arduino-cli compile --fqbn rakwireless:nrf52:WisCoreRAK4631Board -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x51\" \"-DnRF52=true\" \"-DMODEM=0x03\"" + arduino-cli compile --fqbn rakwireless:nrf52:WisCoreRAK4631Board -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x51\" \"-DMODEM=0x03\"" upload: arduino-cli upload -p /dev/ttyUSB0 --fqbn unsignedio:avr:rnode diff --git a/flash_cache.c b/flash_cache.c index d9ac558..50d69f7 100644 --- a/flash_cache.c +++ b/flash_cache.c @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - +#ifdef NRF52840_XXAA #include #include "flash_cache.h" #include "common_func.h" @@ -201,4 +201,4 @@ int flash_cache_read (flash_cache_t* fc, void* dst, uint32_t addr, uint32_t coun return (int) count; } - +#endif diff --git a/flash_cache.h b/flash_cache.h index efe87d2..ff585e5 100644 --- a/flash_cache.h +++ b/flash_cache.h @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - +#ifdef NRF52840_XXAA #ifndef FLASH_CACHE_H_ #define FLASH_CACHE_H_ @@ -55,4 +55,4 @@ int flash_cache_read (flash_cache_t* fc, void* dst, uint32_t addr, uint32_t coun #endif #endif /* FLASH_CACHE_H_ */ - +#endif diff --git a/flash_nrf5x.c b/flash_nrf5x.c index 8018f5e..0442a39 100644 --- a/flash_nrf5x.c +++ b/flash_nrf5x.c @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - +#ifdef NRF52840_XXAA #include "flash_nrf5x.h" #include "flash_cache.h" #include "nrf_sdm.h" @@ -176,4 +176,4 @@ static bool fal_verify (uint32_t addr, void const * buf, uint32_t len) { return 0 == memcmp((void*) addr, buf, len); } - +#endif diff --git a/flash_nrf5x.h b/flash_nrf5x.h index 668e73c..138cf9c 100644 --- a/flash_nrf5x.h +++ b/flash_nrf5x.h @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - +#ifdef NRF52840_XXAA #ifndef FLASH_NRF52_H_ #define FLASH_NRF52_H_ @@ -86,4 +86,4 @@ static inline uint16_t flash_nrf5x_read32 (uint32_t src) #endif #endif /* FLASH_NRF52_H_ */ - +#endif