1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

fix(fs): remove Arduino SD initialization (#6725)

This commit is contained in:
Liam 2024-08-23 02:16:52 -04:00 committed by GitHub
parent f874ab3e9a
commit 69d440335f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 1 additions and 42 deletions

View File

@ -1210,14 +1210,6 @@ menu "LVGL configuration"
int "Set an upper cased letter on which the drive will accessible (e.g. 65 for 'A')"
default 0
depends on LV_USE_FS_ARDUINO_SD
config LV_FS_ARDUINO_SD_CS_PIN
int "Set the pin connected to the chip select line of the SD card"
default 0
depends on LV_USE_FS_ARDUINO_SD
config LV_FS_ARDUINO_SD_FREQUENCY
int "Set the frequency used by the chip of the SD CARD"
default 40000000
depends on LV_USE_FS_ARDUINO_SD
config LV_USE_LODEPNG
bool "PNG decoder library"

View File

@ -17,8 +17,7 @@ Usage
-----
Enable :c:macro:`LV_USE_FS_ARDUINO_SD` and define a :c:macro:`LV_FS_ARDUINO_SD_LETTER` in ``lv_conf.h``.
You probably need to configure the :c:macro:`LV_FS_ARDUINO_SD_CS_PIN` and :c:macro:`LV_FS_ARDUINO_SD_FREQUENCY` that
corresponds to the pin connected and the frequency used by the chip of the SD CARD.
You will need to initialize the SD card before LVGL can use it (i.e. :cpp:expr:`SD.begin(0, SPI, 40000000)`).
API

View File

@ -669,8 +669,6 @@
/*API for Arduino Sd. */
#if LV_USE_FS_ARDUINO_SD
#define LV_FS_ARDUINO_SD_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#define LV_FS_ARDUINO_SD_CS_PIN 0 /*Set the pin connected to the chip select line of the SD card */
#define LV_FS_ARDUINO_SD_FREQUENCY 40000000 /*Set the frequency used by the chip of the SD CARD */
#endif
/*GIF decoder library*/

View File

@ -741,8 +741,6 @@
#define LV_USE_FS_ARDUINO_SD 0
#if LV_USE_FS_ARDUINO_SD
#define LV_FS_ARDUINO_SD_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#define LV_FS_ARDUINO_SD_CS_PIN 0 /*Set the pin connected to the chip select line of the SD card */
#define LV_FS_ARDUINO_SD_FREQUENCY 40000000 /*Set the frequency used by the chip of the SD CARD */
#endif
/*LODEPNG decoder library*/

View File

@ -25,7 +25,6 @@ typedef struct SdFile {
/**********************
* STATIC PROTOTYPES
**********************/
static void fs_init(void);
static void * fs_open(lv_fs_drv_t * drv, const char * path, lv_fs_mode_t mode);
static lv_fs_res_t fs_close(lv_fs_drv_t * drv, void * file_p);
static lv_fs_res_t fs_read(lv_fs_drv_t * drv, void * file_p, void * buf, uint32_t btr, uint32_t * br);
@ -38,8 +37,6 @@ static lv_fs_res_t fs_tell(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p);
*/
extern "C" void lv_fs_arduino_sd_init(void)
{
fs_init();
lv_fs_drv_t * fs_drv = &(LV_GLOBAL_DEFAULT()->arduino_sd_fs_drv);
lv_fs_drv_init(fs_drv);
@ -62,17 +59,6 @@ extern "C" void lv_fs_arduino_sd_init(void)
* STATIC FUNCTIONS
**********************/
/*Initialize your Storage device and File system.*/
static void fs_init(void)
{
if(!SD.begin(LV_FS_ARDUINO_SD_CS_PIN, SPI, LV_FS_ARDUINO_SD_FREQUENCY)) {
LV_LOG_WARN("Driver Arduino SD Card not mounted");
return;
}
LV_LOG_WARN("Driver Arduino SD Card mounted");
}
/**
* Open a file
* @param drv pointer to a driver where this function belongs

View File

@ -2484,20 +2484,6 @@
#define LV_FS_ARDUINO_SD_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#endif
#endif
#ifndef LV_FS_ARDUINO_SD_CS_PIN
#ifdef CONFIG_LV_FS_ARDUINO_SD_CS_PIN
#define LV_FS_ARDUINO_SD_CS_PIN CONFIG_LV_FS_ARDUINO_SD_CS_PIN
#else
#define LV_FS_ARDUINO_SD_CS_PIN 0 /*Set the pin connected to the chip select line of the SD card */
#endif
#endif
#ifndef LV_FS_ARDUINO_SD_FREQUENCY
#ifdef CONFIG_LV_FS_ARDUINO_SD_FREQUENCY
#define LV_FS_ARDUINO_SD_FREQUENCY CONFIG_LV_FS_ARDUINO_SD_FREQUENCY
#else
#define LV_FS_ARDUINO_SD_FREQUENCY 40000000 /*Set the frequency used by the chip of the SD CARD */
#endif
#endif
#endif
/*LODEPNG decoder library*/