Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-esp32
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-esp32
Commits
d5f71ce5
Commit
d5f71ce5
authored
Apr 09, 2019
by
lbernstone
Committed by
Me No Dev
Apr 09, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a parameter for max files in SD (#2563)
parent
7df50a97
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
libraries/SD/src/SD.cpp
libraries/SD/src/SD.cpp
+2
-2
libraries/SD/src/SD.h
libraries/SD/src/SD.h
+1
-1
libraries/SD/src/sd_diskio.cpp
libraries/SD/src/sd_diskio.cpp
+2
-2
libraries/SD/src/sd_diskio.h
libraries/SD/src/sd_diskio.h
+1
-1
No files found.
libraries/SD/src/SD.cpp
View file @
d5f71ce5
...
...
@@ -22,7 +22,7 @@ using namespace fs;
SDFS
::
SDFS
(
FSImplPtr
impl
)
:
FS
(
impl
),
_pdrv
(
0xFF
)
{}
bool
SDFS
::
begin
(
uint8_t
ssPin
,
SPIClass
&
spi
,
uint32_t
frequency
,
const
char
*
mountpoint
)
bool
SDFS
::
begin
(
uint8_t
ssPin
,
SPIClass
&
spi
,
uint32_t
frequency
,
const
char
*
mountpoint
,
uint8_t
max_files
)
{
if
(
_pdrv
!=
0xFF
)
{
return
true
;
...
...
@@ -35,7 +35,7 @@ bool SDFS::begin(uint8_t ssPin, SPIClass &spi, uint32_t frequency, const char *
return
false
;
}
if
(
!
sdcard_mount
(
_pdrv
,
mountpoint
)){
if
(
!
sdcard_mount
(
_pdrv
,
mountpoint
,
max_files
)){
sdcard_unmount
(
_pdrv
);
sdcard_uninit
(
_pdrv
);
_pdrv
=
0xFF
;
...
...
libraries/SD/src/SD.h
View file @
d5f71ce5
...
...
@@ -28,7 +28,7 @@ protected:
public:
SDFS
(
FSImplPtr
impl
);
bool
begin
(
uint8_t
ssPin
=
SS
,
SPIClass
&
spi
=
SPI
,
uint32_t
frequency
=
4000000
,
const
char
*
mountpoint
=
"/sd"
);
bool
begin
(
uint8_t
ssPin
=
SS
,
SPIClass
&
spi
=
SPI
,
uint32_t
frequency
=
4000000
,
const
char
*
mountpoint
=
"/sd"
,
uint8_t
max_files
=
5
);
void
end
();
sdcard_type_t
cardType
();
uint64_t
cardSize
();
...
...
libraries/SD/src/sd_diskio.cpp
View file @
d5f71ce5
...
...
@@ -711,7 +711,7 @@ uint8_t sdcard_unmount(uint8_t pdrv)
return
0
;
}
bool
sdcard_mount
(
uint8_t
pdrv
,
const
char
*
path
)
bool
sdcard_mount
(
uint8_t
pdrv
,
const
char
*
path
,
uint8_t
max_files
)
{
ardu_sdcard_t
*
card
=
s_cards
[
pdrv
];
if
(
pdrv
>=
FF_VOLUMES
||
card
==
NULL
){
...
...
@@ -725,7 +725,7 @@ bool sdcard_mount(uint8_t pdrv, const char* path)
FATFS
*
fs
;
char
drv
[
3
]
=
{(
char
)(
'0'
+
pdrv
),
':'
,
0
};
esp_err_t
err
=
esp_vfs_fat_register
(
path
,
drv
,
5
,
&
fs
);
esp_err_t
err
=
esp_vfs_fat_register
(
path
,
drv
,
max_files
,
&
fs
);
if
(
err
==
ESP_ERR_INVALID_STATE
)
{
log_e
(
"esp_vfs_fat_register failed 0x(%x): SD is registered."
,
err
);
return
false
;
...
...
libraries/SD/src/sd_diskio.h
View file @
d5f71ce5
...
...
@@ -21,7 +21,7 @@
uint8_t
sdcard_init
(
uint8_t
cs
,
SPIClass
*
spi
,
int
hz
);
uint8_t
sdcard_uninit
(
uint8_t
pdrv
);
bool
sdcard_mount
(
uint8_t
pdrv
,
const
char
*
path
);
bool
sdcard_mount
(
uint8_t
pdrv
,
const
char
*
path
,
uint8_t
max_files
);
uint8_t
sdcard_unmount
(
uint8_t
pdrv
);
sdcard_type_t
sdcard_type
(
uint8_t
pdrv
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment