mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
switch to using QSPI bus for external flash
This commit is contained in:
parent
c5180d4588
commit
bdfe9ad27b
8 changed files with 27 additions and 15 deletions
|
|
@ -1,7 +1,7 @@
|
|||
#include <Arduino.h>
|
||||
#include "DataStore.h"
|
||||
|
||||
#if defined(EXTRAFS) || defined(SPIFLASH)
|
||||
#if defined(EXTRAFS) || defined(QSPIFLASH)
|
||||
#define MAX_BLOBRECS 100
|
||||
#else
|
||||
#define MAX_BLOBRECS 20
|
||||
|
|
@ -49,7 +49,9 @@ void DataStore::begin() {
|
|||
#elif defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
|
||||
// #include <InternalFileSystem.h> // disabled for now, leaving here for dual fs branch
|
||||
#include <CustomLFS.h>
|
||||
#include <CustomLFS_SPIFlash.h>
|
||||
#if defined(QSPIFLASH)
|
||||
#include <CustomLFS_QSPIFlash.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
|
||||
|
|
|
|||
|
|
@ -14,11 +14,9 @@ static uint32_t _atoi(const char* sp) {
|
|||
|
||||
#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
|
||||
#include <InternalFileSystem.h>
|
||||
#if defined(SPIFLASH)
|
||||
#include <CustomLFS_SPIFlash.h>
|
||||
const int chipSelect = PIN_QSPI_CS;
|
||||
SPIClass SPI_2(NRF_SPIM2, PIN_QSPI_IO1, PIN_QSPI_SCK, PIN_QSPI_IO0);
|
||||
DataStore store(FlashFS, rtc_clock);
|
||||
#if defined(QSPIFLASH)
|
||||
#include <CustomLFS_QSPIFlash.h>
|
||||
DataStore store(QSPIFlash, rtc_clock);
|
||||
#else
|
||||
#if defined(EXTRAFS)
|
||||
#include <CustomLFS.h>
|
||||
|
|
@ -131,12 +129,12 @@ void setup() {
|
|||
fast_rng.begin(radio_get_rng_seed());
|
||||
|
||||
#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
|
||||
#if defined(SPIFLASH)
|
||||
if (!FlashFS.begin(chipSelect, SPI_2)) {
|
||||
#if defined(QSPIFLASH)
|
||||
if (!QSPIFlash.begin()) {
|
||||
// debug output might not be available at this point, might be too early. maybe should fall back to InternalFS here?
|
||||
MESH_DEBUG_PRINTLN("CustomLFS_SPIFlash: failed to initialize");
|
||||
MESH_DEBUG_PRINTLN("CustomLFS_QSPIFlash: failed to initialize");
|
||||
} else {
|
||||
MESH_DEBUG_PRINTLN("CustomLFS_SPIFlash: initialized successfully");
|
||||
MESH_DEBUG_PRINTLN("CustomLFS_QSPIFlash: initialized successfully");
|
||||
}
|
||||
#else
|
||||
InternalFS.begin();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue