On Fri, 15 Nov 2019 13:35:22 -0800 (PST), in
gmane.comp.hardware.beagleboard.user
The eMMC contains a /file system/ -- one does not access raw blocks.
Open a file in modify mode;
loop
write the set of encoder values;
flush the file;
seek(0)...
or maybe mmap with a backing file, as that would allow writing each encoder
as it is moved, rather than all encoders at once.
https://linux.die.net/man/2/mmap
https://linux.die.net/man/2/msync
Note that both (file/flush/seek and mmap/msync methods will invoke a
lot of flash memory write overhead as everytime you change a value the
flash has to allocate a new/erased block, copy unaffected data to it, write
changed data...
Also note that on unintended power-down, you risk corrupting the file
system with partial writes... With luck the journal will catch these and
allow reasonable recovery.
--
Dennis L Bieber