Modifications

Sauter à la navigation Sauter à la recherche
197 octets ajoutés ,  8 mars 2022 à 00:19
Ligne 61 : Ligne 61 :     
So, even if LittleFS do have some minimal buffering, it is possible to force writing to the flah ( with {{fname|flush()}} ). So the user code can rely on better file-system stability and better control over forced writing operation.
 
So, even if LittleFS do have some minimal buffering, it is possible to force writing to the flah ( with {{fname|flush()}} ). So the user code can rely on better file-system stability and better control over forced writing operation.
 +
 +
The following example just {{fname|flush()}} writes at every line written to the file.
 +
 +
Power can be lost at every moment, the flushed writes are safely stored.
    
<syntaxhighlight lang="python">
 
<syntaxhighlight lang="python">
Ligne 73 : Ligne 77 :     
{{underline|Please note:}} abusing the {{fname|flush()}} operation will slow down the code and will degrade flash faster (Flash Memory cells do have a maximum write cycles).
 
{{underline|Please note:}} abusing the {{fname|flush()}} operation will slow down the code and will degrade flash faster (Flash Memory cells do have a maximum write cycles).
 +
 +
[[Fichier:LittleFS-flushed.png]]
    
{{ENG-CANSAT-PICO-TRAILER}}
 
{{ENG-CANSAT-PICO-TRAILER}}
29 917

modifications

Menu de navigation