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
1049be7d
Unverified
Commit
1049be7d
authored
Oct 14, 2021
by
Pedro Minatel
Committed by
GitHub
Oct 14, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into docs/troubleshooting_python_not_found
parents
49f525c9
2fb2ef54
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
cores/esp32/FirmwareMSC.cpp
cores/esp32/FirmwareMSC.cpp
+1
-0
cores/esp32/firmware_msc_fat.c
cores/esp32/firmware_msc_fat.c
+3
-3
No files found.
cores/esp32/FirmwareMSC.cpp
View file @
1049be7d
...
...
@@ -113,6 +113,7 @@ static size_t msc_update_get_required_disk_sectors(){
log_d
(
"USING FAT12"
);
mcs_is_fat16
=
false
;
}
log_d
(
"FAT sector size: %u"
,
DISK_SECTOR_SIZE
);
log_d
(
"FAT data sectors: %u"
,
data_sectors
);
log_d
(
"FAT table sectors: %u"
,
msc_table_sectors
);
log_d
(
"FAT total sectors: %u (%uKB)"
,
total_sectors
,
(
total_sectors
*
DISK_SECTOR_SIZE
)
/
1024
);
...
...
cores/esp32/firmware_msc_fat.c
View file @
1049be7d
...
...
@@ -39,7 +39,7 @@ static const char * FAT12_FILE_SYSTEM_TYPE = "FAT12";
static
uint16_t
fat12_sectors_per_alloc_table
(
uint32_t
sector_num
){
uint32_t
required_bytes
=
(((
sector_num
*
3
)
+
1
)
/
2
);
return
(
required_bytes
/
DISK_SECTOR_SIZE
)
+
((
required_bytes
&
DISK_SECTOR_SIZE
)
?
1
:
0
);
return
(
required_bytes
/
DISK_SECTOR_SIZE
)
+
((
required_bytes
&
(
DISK_SECTOR_SIZE
-
1
)
)
?
1
:
0
);
}
static
uint8_t
*
fat12_add_table
(
uint8_t
*
dst
,
fat_boot_sector_t
*
boot
){
...
...
@@ -68,7 +68,7 @@ static const char * FAT16_FILE_SYSTEM_TYPE = "FAT16";
static
uint16_t
fat16_sectors_per_alloc_table
(
uint32_t
sector_num
){
uint32_t
required_bytes
=
sector_num
*
2
;
return
(
required_bytes
/
DISK_SECTOR_SIZE
)
+
((
required_bytes
&
DISK_SECTOR_SIZE
)
?
1
:
0
);
return
(
required_bytes
/
DISK_SECTOR_SIZE
)
+
((
required_bytes
&
(
DISK_SECTOR_SIZE
-
1
)
)
?
1
:
0
);
}
static
uint8_t
*
fat16_add_table
(
uint8_t
*
dst
,
fat_boot_sector_t
*
boot
){
...
...
@@ -129,7 +129,7 @@ fat_boot_sector_t * fat_add_boot_sector(uint8_t * dst, uint16_t sector_num, uint
boot
->
num_heads
=
1
;
boot
->
hidden_sectors_count
=
0
;
boot
->
total_sectors_32
=
0
;
boot
->
physical_drive_number
=
0x
0
0
;
boot
->
physical_drive_number
=
0x
8
0
;
boot
->
reserved0
=
0x00
;
boot
->
extended_boot_signature
=
0x29
;
boot
->
serial_number
=
serial_number
;
...
...
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