]> git.tnoah.ca Git - lora-radio.git/commitdiff
Make flash libraries inclusion exclusive to NRF52
authorjacob.eva <x00010@disroot.org>
Sat, 20 Jan 2024 10:46:38 +0000 (10:46 +0000)
committerjacob.eva <x00010@disroot.org>
Sat, 20 Jan 2024 10:46:38 +0000 (10:46 +0000)
Config.h
LoRa.cpp
Makefile
flash_cache.c
flash_cache.h
flash_nrf5x.c
flash_nrf5x.h

index 78808940fc3213ae6c8ae54c002fc166a12665a8..1e4ac8005cd311c1a1d7615b8a1e774b724e5093 100644 (file)
--- 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
index 72e9818b048e7f181abc16c17d69c82de3c09b17..5731587e45fe33b2f995f736f99964555cb53ef7 100644 (file)
--- 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
index 03957d660cbec9ca41abdd2db26db4e19a02dd02..ee697194a294b612c705b7d1becfaa7bfcba4b90 100644 (file)
--- 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
index d9ac5580f5c25a98d04d34b41592581ffcf73b9e..50d69f7f9870491e54ca28557bf53a2b29705890 100644 (file)
@@ -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 <string.h>
 #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
index efe87d2f65b863e7681a3619989ff7b966906628..ff585e5adba10d0b58450070dec8d3afa0cbf456 100644 (file)
@@ -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
index 8018f5eecad7ff56c921db07e16a42808d11dffd..0442a39880a7e5566558222e46e8c0f2d0aaf7c4 100644 (file)
@@ -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
index 668e73c868279a35413de587f10d36b03a10571e..138cf9cbc112451f91ed7067b8a43bd0ae53927d 100644 (file)
@@ -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