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
528c0712
Unverified
Commit
528c0712
authored
Mar 28, 2022
by
tobozo
Committed by
GitHub
Mar 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding sectorsize() and numSectors() to SD (#6457)
* Update SD.h * Added numSectors() and sectorSize()
parent
7b89b39e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
libraries/SD/src/SD.cpp
libraries/SD/src/SD.cpp
+16
-0
libraries/SD/src/SD.h
libraries/SD/src/SD.h
+2
-0
No files found.
libraries/SD/src/SD.cpp
View file @
528c0712
...
@@ -75,6 +75,22 @@ uint64_t SDFS::cardSize()
...
@@ -75,6 +75,22 @@ uint64_t SDFS::cardSize()
return
(
uint64_t
)
sectors
*
sectorSize
;
return
(
uint64_t
)
sectors
*
sectorSize
;
}
}
size_t
SDFS
::
numSectors
()
{
if
(
_pdrv
==
0xFF
)
{
return
0
;
}
return
sdcard_num_sectors
(
_pdrv
);
}
size_t
SDFS
::
sectorSize
()
{
if
(
_pdrv
==
0xFF
)
{
return
0
;
}
return
sdcard_sector_size
(
_pdrv
);
}
uint64_t
SDFS
::
totalBytes
()
uint64_t
SDFS
::
totalBytes
()
{
{
FATFS
*
fsinfo
;
FATFS
*
fsinfo
;
...
...
libraries/SD/src/SD.h
View file @
528c0712
...
@@ -32,6 +32,8 @@ public:
...
@@ -32,6 +32,8 @@ public:
void
end
();
void
end
();
sdcard_type_t
cardType
();
sdcard_type_t
cardType
();
uint64_t
cardSize
();
uint64_t
cardSize
();
size_t
numSectors
();
size_t
sectorSize
();
uint64_t
totalBytes
();
uint64_t
totalBytes
();
uint64_t
usedBytes
();
uint64_t
usedBytes
();
bool
readRAW
(
uint8_t
*
buffer
,
uint32_t
sector
);
bool
readRAW
(
uint8_t
*
buffer
,
uint32_t
sector
);
...
...
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