How to use SPIFFS

rebel88
Posts: 13
Joined: Mon Mar 23, 2020 8:37 am

How to use SPIFFS

Postby rebel88 » Sun Apr 05, 2020 3:14 pm

Hi All.
It is a couple of weeks I'm playing with ESP32 DevKit V1.
Now I'm stduding how to save file on SPIFFS partition.
I can create the partition and save simple file using the example.
Now I want to create an advanced sketch where i have to save several structures on this kind of file.
I know i can use FILE* from stdio librarie, my question is : Can i use fstream library to write and read data?
I have written a class but when i load it on the ESP32 it goes in "Guru meditation"

Code: Select all

I (0) cpu_start: Starting scheduler on APP CPU.
Guru Meditation Error: Core  0 panic'ed (Unhandled debug exception)
Debug exception reason: BREAK instr 
Core 0 register dump:
PC      : 0x3ffb81e0  PS      : 0x00060220  A0      : 0x0a6d305b  A1      : 0x80058bc2
A2      : 0x3ffb5640  A3      : 0x3ffb6778  A4      : 0x3ffae920  A5      : 0x3ffb8228  
A6      : 0x00000000  A7      : 0x00000000  A8      : 0x00000000  A9      : 0x800fe3de  
A10     : 0x3ffb5660  A11     : 0x3ffb6778  A12     : 0x3f402a04  A13     : 0x0000001a  
A14     : 0x00000080  A15     : 0x0000001a  SAR     : 0x00000001  EXCCAUSE: 0x00000001  
EXCVADDR: 0x0a6d303b  LBEG    : 0x3ffb6778  LEND    : 0x3ffae920  LCOUNT  : 0xfffffffd  

ELF file SHA256: 6151d98a471f83575f4f2f8fdcd38cd7fa9000faa02e486e9ceb0468da88ca51

Backtrace: 0x3ffb81dd:0x80058bc2 |<-CORRUPTED

Rebooting...
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:6864
ho 0 tail 12 room 4
load:0x40078000,len:14076
load:0x40080400,len:4304
entry 0x400806e8
I (75) boot: Chip Revision: 1
I (75) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (41) boot: ESP-IDF v4.0-dirty 2nd stage bootloader
I (41) boot: compile time 16:47:40
I (41) boot: Enabling RNG early entropy source...
I (46) boot: SPI Speed      : 40MHz
I (51) boot: SPI Mode       : DIO
I (55) boot: SPI Flash Size : 4MB
I (59) boot: Partition Table:
I (62) boot: ## Label            Usage          Type ST Offset   Length
I (70) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (77) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (84) boot:  2 factory          factory app      00 00 00010000 00100000
I (92) boot:  3 storage          Unknown data     01 82 00110000 000f0000
I (99) boot: End of partition table
I (104) boot_comm: chip revision: 1, min. application chip revision: 0
I (111) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x174e8 ( 95464) map
I (154) esp_image: segment 1: paddr=0x00027510 vaddr=0x3ffb0000 size=0x0218c (  8588) load
I (158) esp_image: segment 2: paddr=0x000296a4 vaddr=0x40080000 size=0x00400 (  1024) load
0x40080000: _WindowOverflow4 at C:/Users/Admin/esp-idf/components/freertos/xtensa_vectors.S:1778

I (161) esp_image: segment 3: paddr=0x00029aac vaddr=0x40080400 size=0x06564 ( 25956) load
I (181) esp_image: segment 4: paddr=0x00030018 vaddr=0x400d0018 size=0x423dc (271324) map
0x400d0018: _stext at ??:?

I (278) esp_image: segment 5: paddr=0x000723fc vaddr=0x40086964 size=0x036c8 ( 14024) load
0x40086964: rtc_init at C:/Users/Admin/esp-idf/components/soc/esp32/rtc_init.c:70

I (290) boot: Loaded app from partition at offset 0x10000
I (291) boot: Disabling RNG early entropy source...
I (291) cpu_start: Pro cpu up.
I (295) cpu_start: Application information:
I (299) cpu_start: Project name:     template-app
I (305) cpu_start: App version:      1
I (309) cpu_start: Compile time:     Apr  5 2020 16:47:28
I (315) cpu_start: ELF file SHA256:  6151d98a471f8357...
I (321) cpu_start: ESP-IDF:          v4.0-dirty
I (327) cpu_start: Starting app cpu, entry point is 0x400811c8
0x400811c8: call_start_cpu1 at C:/Users/Admin/esp-idf/components/esp32/cpu_start.c:272

I (313) cpu_start: App cpu up.
I (337) heap_init: Initializing. RAM available for dynamic allocation:
I (344) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (350) heap_init: At 3FFB47E8 len 0002B818 (174 KiB): DRAM
I (356) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (363) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (369) heap_init: At 4008A02C len 00015FD4 (87 KiB): IRAM
I (375) cpu_start: Pro cpu start user code
I (397) spi_flash: detected chip: generic
I (397) spi_flash: flash io: dio
I (397) cpu_start: Starting scheduler on PRO CPU.
I know that the class and the code are good because i have tried it on CodeBlocks but it is pure C++ compiler.
My first answer is I can't use fstream library to write and read data.
Could Someone help me understand what is appening?
Thankyou in advance.

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

Re: How to use SPIFFS

Postby ESP_Sprite » Sun Apr 05, 2020 7:46 pm

That's pretty much impossible to say from the coredump... can you show your code here?

rebel88
Posts: 13
Joined: Mon Mar 23, 2020 8:37 am

Re: How to use SPIFFS

Postby rebel88 » Mon Apr 06, 2020 6:40 am

This is my code,
Main.cpp:
it first main is to create a way to test the class :

Code: Select all

/* Hello World Example

   This example code is in the Public Domain (or CC0 licensed, at your option.)

   Unless required by applicable law or agreed to in writing, this
   software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
   CONDITIONS OF ANY KIND, either express or implied.
*/
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_system.h"
#include "esp_spi_flash.h"
#include "esp_spiffs.h"
#include "esp_log.h"
#include "PresetIO.h"

static const char *TAG = "example";

extern "C" void app_main(void)
{

    PresetIO PresetLoadSave;

    //----- CREATE EFFECT------
    singleEffect_t Effect1={1,10,20,30,40};
    singleEffect_t Effect2={1,50,60,70,80};
    singleEffect_t Effect3={0,90,100,110,120};
    singleEffect_t Effect4={0,130,140,150,160};
    singleEffect_t Effect5={1,170,180,190,200};
    singleEffect_t Effect6={0,210,220,230,240};
    //----- CREATE PRESET------
    MultiEffect_t Preset_1 ={Effect1,Effect2,Effect3,Effect4,Effect5,Effect6};
    MultiEffect_t Preset_2 ={Effect2,Effect2,Effect3,Effect4,Effect5,Effect6};
    MultiEffect_t Preset_3 ={Effect1,Effect1,Effect3,Effect6,Effect5,Effect6};
    MultiEffect_t ExtractPreset={};

    //---------- Initialize File partition 
    ESP_LOGI(TAG, "Initializing SPIFFS");
    
    esp_vfs_spiffs_conf_t conf = {
      .base_path = "/spiffs",
      .partition_label = NULL,
      .max_files = 5,
      .format_if_mount_failed = true
    };
        // Use settings defined above to initialize and mount SPIFFS filesystem.
    // Note: esp_vfs_spiffs_register is an all-in-one convenience function.
    esp_err_t ret = esp_vfs_spiffs_register(&conf);

    if (ret != ESP_OK) {
        if (ret == ESP_FAIL) {
            ESP_LOGE(TAG, "Failed to mount or format filesystem");
        } else if (ret == ESP_ERR_NOT_FOUND) {
            ESP_LOGE(TAG, "Failed to find SPIFFS partition");
        } else {
            ESP_LOGE(TAG, "Failed to initialize SPIFFS (%s)", esp_err_to_name(ret));
        }
        return;
    }
    
    size_t total = 0, used = 0;
    ret = esp_spiffs_info(NULL, &total, &used);
    if (ret != ESP_OK) {
        ESP_LOGE(TAG, "Failed to get SPIFFS partition information (%s)", esp_err_to_name(ret));
    } else {
        ESP_LOGI(TAG, "Partition size: total: %d, used: %d", total, used);
    }
    //---------- END Initialize File partition 
vTaskDelay(1000 / portTICK_PERIOD_MS);
    //----- Show PresetLoadSave banks we would use
    cout<<"Show Preset 1";
    PresetLoadSave.showPresetBank(1);
    cout<<"Show Preset 5";
    PresetLoadSave.showPresetBank(5);
    cout<<"Show Preset 99";
    PresetLoadSave.showPresetBank(99);

    //-----
    cout<<"\n---------------INSERT EFFECTS-----------------------\n";

    PresetLoadSave.insertMultiEffect(uint8_t(1),Preset_1);
    PresetLoadSave.insertMultiEffect(uint8_t(5),Preset_2);
    PresetLoadSave.insertMultiEffect(uint8_t(99),Preset_3);
        //----- Show PresetLoadSave banks we would use
    cout<<"\nShow Inserted Preset 1\n";
    PresetLoadSave.showPresetBank(1);
    cout<<"\nShow Inserted Preset 5\n";
    PresetLoadSave.showPresetBank(5);
    cout<<"\nShow Inserted Preset 99\n";
    PresetLoadSave.showPresetBank(99);

    //-----
    cout<<"\n---------------SAVE EFFECTS-----------------------\n";
    PresetLoadSave.savePresetBankFile();

    //-----
    cout<<"\n---------------EXTRACT EFFECTS-----------------------\n";
    PresetLoadSave.savePresetBankFile();
    ExtractPreset =PresetLoadSave.getMultiEffect(5);
    cout << "\nExtractPreset from position 5: ";
    for (uint8_t i=0; i<NUMB_PED; i++)
    {
        cout << "\nStatus: ";
        printf("%3d",ExtractPreset.Pedal[i].status);

        cout << "\tPot1 Value:  ";
        printf("%3d",ExtractPreset.Pedal[i].pot_1);

        cout << "\tPot2 Value:  ";
        printf("%3d",ExtractPreset.Pedal[i].pot_2);

        cout << "\tPot3 Value:  ";
        printf("%3d",ExtractPreset.Pedal[i].pot_3);

        cout << "\tPot4 Value:  ";
        printf("%3d",ExtractPreset.Pedal[i].pot_4);
    }
    //-----
    PresetLoadSave.insertMultiEffect(uint8_t(10),ExtractPreset);
    cout<<"\nShow Inserted Preset 10\n";
    PresetLoadSave.showPresetBank(10);

    //-----
    cout<<"\n---------------LOAD EFFECTS-----------------------\n";
    PresetLoadSave.loadPresetBankFile();
    vTaskDelay(1000 / portTICK_PERIOD_MS);
    //-----
    cout<<"\n---------------CHECK EFFECTS-----------------------\n";
    cout<<"\nPosition 10 should be empty after load\n";
    cout<<"\nShow Inserted Preset 1";
    PresetLoadSave.showPresetBank(1);
    cout<<"\nShow Inserted Preset 5";
    PresetLoadSave.showPresetBank(5);
    cout<<"\nShow Inserted Preset 99";
    PresetLoadSave.showPresetBank(99);
    cout<<"\nShow Inserted Preset 10";
    PresetLoadSave.showPresetBank(10);

}
The class PresetIO.cpp is used to manage structure and to save and load data from file using fstream:

Code: Select all

#include "PresetIO.h"

PresetIO::PresetIO()
{
    //ctor
}

PresetIO::~PresetIO()
{
    //dtor
}

void PresetIO::printPedal(singleEffect_t sp)
{
    cout << "\nStatus: ";
    printf("%3d",sp.status);

    cout << "\tPot1 Value:  ";
    printf("%3d",sp.pot_1);

    cout << "\tPot2 Value:  ";
    printf("%3d",sp.pot_2);

    cout << "\tPot3 Value:  ";
    printf("%3d",sp.pot_3);

    cout << "\tPot4 Value:  ";
    printf("%3d",sp.pot_4);
}
/*-----------------------------------------------*/

void PresetIO::printMultiEffect(MultiEffect_t me)
{
    for (uint8_t i=0; i<NUMB_PED; i++)
    {
        printPedal(me.Pedal[i]);
    }
}
/*-----------------------------------------------*/

void PresetIO::insertMultiEffect(uint8_t id,MultiEffect_t me)
{
    PresetBanks[id] = me;
    printf("\nMulti Effect saved in %d location\n",id);
    printMultiEffect(PresetBanks[id]);
}

/*-----------------------------------------------*/

void PresetIO::showPresetBank(uint8_t id)
{
    printf("\nPrtint Effect saved in location %d",id);
    printMultiEffect(PresetBanks[id]);
    cout<<endl;
}

/*-----------------------------------------------*/

MultiEffect_t PresetIO::getMultiEffect(uint8_t id)
{
    return PresetBanks[id];
}

/*-----------------------------------------------*/

uint8_t PresetIO::savePresetBankFile()
{
    uint8_t result;
    ofstream output_file(SAVE_FILE_NAME, ios::binary);
    result=output_file.rdstate(); //check if file is correcyly opened
    if(!result)
    {
        output_file.write((char*)&PresetBanks, sizeof(PresetBanks));
        output_file.close();
        printf("\nFile Saved Correctly, tot %d KB",sizeof(PresetBanks)/1024);
    }else
    {
        cout<<"\nError While saving File";
    }
    return result;
}

/*-----------------------------------------------*/

uint8_t PresetIO::loadPresetBankFile()
{
    uint8_t result;
    ifstream input_file(SAVE_FILE_NAME, ios::binary);
    result=input_file.rdstate(); //check if file is correcyly opened
    if(!result)
    {
        input_file.read((char*)&PresetBanks, sizeof(PresetBanks));
        printf("\nFile Correctly Loaded,tot %d KB",sizeof(PresetBanks)/1024);
    }else
    {
        cout<<"Error While saving File";
    }
    return result;
}
and this is the PrestIO.h :

Code: Select all

#ifndef PRESETIO_H
#define PRESETIO_H

#include "sdv_t.h"
#include <iostream>
#include <fstream>
#include <string.h>

#define SAVE_FILE_NAME "/spiffs/effects.data"
using namespace std;
class PresetIO
{
    public:
        PresetIO();
        virtual ~PresetIO();

        /**
        * @brief    insertMultiEffect is used to insert a generic MultiEffect Variabile in defined position
        * @param id value from 0 to NUMB_PRESET-1 identify the position where store data
        * @param me Multieffect variable identify values of all 6 Effects
        */
        void insertMultiEffect(uint8_t id,MultiEffect_t me);
        /**
        * @brief    showPresetBank is used to print on screen what is written in specific PresetBanks position
        * @param id value from 0 to NUMB_PRESET-1 identify the position from where read data
        */
        void showPresetBank(uint8_t id);

        /**
        * @brief    getMultiEffect is used to extract a MultiEffect Structure from saved PresetBanks
        * @param id value from 0 to NUMB_PRESET-1 identify the position from where read data
        *
        * @return MultiEffect_t, the structure extracted from PresetBanks
        */
        MultiEffect_t getMultiEffect(uint8_t id);

        /**
        * @brief    savePresetBankFile is a function used to save PresetBanks on file
        *           the file name is SAVE_FILE_NAME, it uses ofstream output_file
        *
        * @return   returns the output_file.rdstate status, if 0 OK else there is a problem
        */
        uint8_t savePresetBankFile();

        /**
        * @brief    loadPresetBankFile is a function used to Load PresetBanks from file
        *           the file name is SAVE_FILE_NAME, it uses ifstream input_file
        *
        * @return   returns the input_file.rdstate status, if 0 OK else there is a problem
        */
        uint8_t loadPresetBankFile();

    protected:

    private:
        /**
        *@brief PresetBanks is an array of NUMB_PRESET(default 100) possible Preset
        *       used to save and load info from files
        *       PresetBank:
        *           o 99*Multi Effect
        *               o 6*single Effects
        */
        MultiEffect_t PresetBanks[NUMB_PRESET]={};

        /**
        * @brief    printPedal is used to print on screen what is inside one of MultiEffect Pedals
        * @param    sp is the singleEffect passed the the function
        */
        void printPedal(singleEffect_t sp);

        /**
        * @brief    printPedal is used to print on screen what is inside a MultiEffect
        * @param    me is the MultiEffect passed the the function
        */
        void printMultiEffect(MultiEffect_t me);

};

#endif // PRESETIO_H
this last file is an header" sdv_t.h"used to create structures types :

Code: Select all

#ifndef SDV_T_H_INCLUDED
#define SDV_T_H_INCLUDED

#include <iostream>

#define NUMB_PED      6  //NUMBER OF PEDAL USED
#define NUMB_PRESET 100  //NUMBER OF PRESET


/**
* singleEffect_t is a structure identify the single Pedal made of:
* Status (on/off)
* 4* Pot values
*/
struct singleEffect_t
{
    uint8_t status; //on off status of the pedal
    uint8_t pot_1;  //potentiometer 1 value
    uint8_t pot_2;  //potentiometer 2 value
    uint8_t pot_3;  //potentiometer 3 value
    uint8_t pot_4;  //potentiometer 4 value
};

/**
* MultiEffect_t is a structure identify the single preset of all NUMB_PED pedals
*/
struct MultiEffect_t
{
    singleEffect_t Pedal[NUMB_PED];
};

#endif // SDV_T_H_INCLUDED
and this last file is the SPIFFS partition table setup "partitions.csv" :

Code: Select all

# Name,   Type, SubType, Offset,  Size, Flags
# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap
nvs,      data, nvs,     0x9000,  0x6000,
phy_init, data, phy,     0xf000,  0x1000,
factory,  app,  factory, 0x10000, 1M,
storage,  data, spiffs,  ,        0xF0000, 
I have attached the entrire project I have written.
The only configuration to do is in menuconfig :
- Partition Table \ Custom Partition Table,
-select partitions.csv
-Offset 0x8000

I have already used the partition.csv and correctly set menuconfig to test spiffs before.
I think the wrong part is on fstream because is the only new thing i'm using in this sketch.
Thakyou for your help.
Attachments
15_SaveLoad_SPIFFS.rar
(9.37 KiB) Downloaded 419 times

rebel88
Posts: 13
Joined: Mon Mar 23, 2020 8:37 am

Re: How to use SPIFFS

Postby rebel88 » Mon Apr 06, 2020 7:01 am

HI ALL, I HAVE A BIG UPDATE.
I have solved my problem reading better the error log.
It was written that i have a "overflow of the heap"
So i have changed the declaration of my object using pointer, in this way the memory scope has changed.

PresetIO *PresetLoadSave = new PresetIO;

Now i can build and use my sketc, so the problem was in the memory occupation.
This is my new main code if you are interested :

Code: Select all


#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_system.h"
#include "esp_spi_flash.h"
#include "esp_spiffs.h"
#include "esp_log.h"
#include "PresetIO.h"

static const char *TAG = "example";

extern "C" void app_main(void)
{

    PresetIO *PresetLoadSave = new PresetIO;

    //----- CREATE EFFECT------
    singleEffect_t Effect1={1,10,20,30,40};
    singleEffect_t Effect2={1,50,60,70,80};
    singleEffect_t Effect3={0,90,100,110,120};
    singleEffect_t Effect4={0,130,140,150,160};
    singleEffect_t Effect5={1,170,180,190,200};
    singleEffect_t Effect6={0,210,220,230,240};
    //----- CREATE PRESET------
    MultiEffect_t Preset_1 ={Effect1,Effect2,Effect3,Effect4,Effect5,Effect6};
    MultiEffect_t Preset_2 ={Effect2,Effect2,Effect3,Effect4,Effect5,Effect6};
    MultiEffect_t Preset_3 ={Effect1,Effect1,Effect3,Effect6,Effect5,Effect6};
    MultiEffect_t ExtractPreset={};

    //---------- Initialize File partition 
    ESP_LOGI(TAG, "Initializing SPIFFS");
    
    esp_vfs_spiffs_conf_t conf = {
      .base_path = "/spiffs",
      .partition_label = NULL,
      .max_files = 5,
      .format_if_mount_failed = true
    };
        // Use settings defined above to initialize and mount SPIFFS filesystem.
    // Note: esp_vfs_spiffs_register is an all-in-one convenience function.
    esp_err_t ret = esp_vfs_spiffs_register(&conf);

    if (ret != ESP_OK) {
        if (ret == ESP_FAIL) {
            ESP_LOGE(TAG, "Failed to mount or format filesystem");
        } else if (ret == ESP_ERR_NOT_FOUND) {
            ESP_LOGE(TAG, "Failed to find SPIFFS partition");
        } else {
            ESP_LOGE(TAG, "Failed to initialize SPIFFS (%s)", esp_err_to_name(ret));
        }
        return;
    }
    
    size_t total = 0, used = 0;
    ret = esp_spiffs_info(NULL, &total, &used);
    if (ret != ESP_OK) {
        ESP_LOGE(TAG, "Failed to get SPIFFS partition information (%s)", esp_err_to_name(ret));
    } else {
        ESP_LOGI(TAG, "Partition size: total: %d, used: %d", total, used);
    }
    //---------- END Initialize File partition 
vTaskDelay(1000 / portTICK_PERIOD_MS);
    //----- Show PresetLoadSave banks we would use
    cout<<"Show Preset 1";
    PresetLoadSave->showPresetBank(1);
    cout<<"Show Preset 5";
    PresetLoadSave->showPresetBank(5);
    cout<<"Show Preset 99";
    PresetLoadSave->showPresetBank(99);

    //-----
    cout<<"\n---------------INSERT EFFECTS-----------------------\n";

    PresetLoadSave->insertMultiEffect(uint8_t(1),Preset_1);
    PresetLoadSave->insertMultiEffect(uint8_t(5),Preset_2);
    PresetLoadSave->insertMultiEffect(uint8_t(99),Preset_3);
        //----- Show PresetLoadSave banks we would use
    cout<<"\nShow Inserted Preset 1\n";
    PresetLoadSave->showPresetBank(1);
    cout<<"\nShow Inserted Preset 5\n";
    PresetLoadSave->showPresetBank(5);
    cout<<"\nShow Inserted Preset 99\n";
    PresetLoadSave->showPresetBank(99);

    //-----
    cout<<"\n---------------SAVE EFFECTS-----------------------\n";
    PresetLoadSave->savePresetBankFile();

    //-----
    cout<<"\n---------------EXTRACT EFFECTS-----------------------\n";
    PresetLoadSave->savePresetBankFile();
    ExtractPreset =PresetLoadSave->getMultiEffect(5);
    cout << "\nExtractPreset from position 5: ";
    for (uint8_t i=0; i<NUMB_PED; i++)
    {
        cout << "\nStatus: ";
        printf("%3d",ExtractPreset.Pedal[i].status);

        cout << "\tPot1 Value:  ";
        printf("%3d",ExtractPreset.Pedal[i].pot_1);

        cout << "\tPot2 Value:  ";
        printf("%3d",ExtractPreset.Pedal[i].pot_2);

        cout << "\tPot3 Value:  ";
        printf("%3d",ExtractPreset.Pedal[i].pot_3);

        cout << "\tPot4 Value:  ";
        printf("%3d",ExtractPreset.Pedal[i].pot_4);
    }
    //-----
    PresetLoadSave->insertMultiEffect(uint8_t(10),ExtractPreset);
    cout<<"\nShow Inserted Preset 10\n";
    PresetLoadSave->showPresetBank(10);

    //-----
    cout<<"\n---------------LOAD EFFECTS-----------------------\n";
    PresetLoadSave->loadPresetBankFile();
    vTaskDelay(1000 / portTICK_PERIOD_MS);
    //-----
    cout<<"\n---------------CHECK EFFECTS-----------------------\n";
    cout<<"\nPosition 10 should be empty after load\n";
    cout<<"\nShow Inserted Preset 1";
    PresetLoadSave->showPresetBank(1);
    cout<<"\nShow Inserted Preset 5";
    PresetLoadSave->showPresetBank(5);
    cout<<"\nShow Inserted Preset 99";
    PresetLoadSave->showPresetBank(99);
    cout<<"\nShow Inserted Preset 10";
    PresetLoadSave->showPresetBank(10);

    while(1)
    {
        vTaskDelay(1000 / portTICK_PERIOD_MS);
    }
}
If you have suggestion I'm here to read you.
Thankyou.

Who is online

Users browsing this forum: No registered users and 256 guests