connornishijima / SensoryBridge

OSHW Advanced LED Audio Visualizer based around a hacky Discrete Fourier Transform
GNU General Public License v3.0
78 stars 10 forks source link

LittleFS is not safe from interruptions #21

Open bradanlane opened 11 months ago

bradanlane commented 11 months ago

If the LittleFS operations are interrupted- for example by the LEDs processing thread - the file system will become corrupted.

One solution is to ...

  1. set the halt flag and then wait some number of milliseconds to insure the LEDs processing thread has finished and looped around again
  2. perform the necessary operations with LittleFS
  3. restore the halt flag to allow LEDs processing to continue