mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-10 04:43:33 +00:00
fatfs: enable long file names for fatfsparse.py
This commit is contained in:
@@ -38,6 +38,23 @@ class FAT:
|
||||
is_cluster_last_: bool = value_ == (1 << self.boot_sector_state.fatfs_type) - 1
|
||||
return is_cluster_last_
|
||||
|
||||
def chain_content(self, cluster_id_: int) -> bytearray:
|
||||
bin_im: bytearray = self.boot_sector_state.binary_image
|
||||
if self.is_cluster_last(cluster_id_):
|
||||
data_address_ = Cluster.compute_cluster_data_address(self.boot_sector_state, cluster_id_)
|
||||
content_: bytearray = bin_im[data_address_: data_address_ + self.boot_sector_state.sector_size]
|
||||
return content_
|
||||
fat_value_: int = self.get_cluster_value(cluster_id_)
|
||||
data_address_ = Cluster.compute_cluster_data_address(self.boot_sector_state, cluster_id_)
|
||||
content_ = bin_im[data_address_: data_address_ + self.boot_sector_state.sector_size]
|
||||
|
||||
while not self.is_cluster_last(cluster_id_):
|
||||
cluster_id_ = fat_value_
|
||||
fat_value_ = self.get_cluster_value(cluster_id_)
|
||||
data_address_ = Cluster.compute_cluster_data_address(self.boot_sector_state, cluster_id_)
|
||||
content_ += bin_im[data_address_: data_address_ + self.boot_sector_state.sector_size]
|
||||
return content_
|
||||
|
||||
def find_free_cluster(self) -> Cluster:
|
||||
# finds first empty cluster and allocates it
|
||||
for cluster in self.clusters:
|
||||
|
Reference in New Issue
Block a user