LocalFileSystem : power-off immediatly after closing a file ?

17 Mar 2012

I have a project (Radio control transmitter) where the mbed controls his own power supply with a digital IO and a electronic switch.
When I stop the transmitter, I write some data to a local file, close the file and cut the power.
The question is : may I cut the power immediately ? Are the buffers really written ?

Robert

17 Mar 2012

It is going to take a finite amount of time to actually write data,

Not only directly into the chip, but also to instigation of committing.

Never mind how long it takes for the 'Magic' chip to do It's stuff.

You could test the size of the file, before, then write, then test length again.

But unless battery power is super critical, 100 - 500 mS will probably be more than enough, with some head room.

Hope this was useful,

Ceri.

18 Mar 2012

Thank you for your answer, but a clearer way to formulate the question is :
" are the buffers written before the close function returns ? "

Robert