Simple helloworld program to show reduced overhead of SDFileSystem-RTOS
Dependencies: SDFileSystem-RTOS mbed-rtos mbed
Hello-world program for RTOS SDFileSystem
One thread stores time values in two buffers, the other thread saves it on the SD card. Since the time thread has low priority the SD thread will take what it needs. This then shows the reduced overhead of the RTOS SDFileSystem compared to regular.
To test it yourself, delete SDFileSystem-RTOS, import the regular one.
The pinouts are for the Wi-Go2 board, but you can easily change it.
After writing the first buffer it stores it on the SD card, and as soon as possible starts filling the second buffer with new timer values. The timer values around this storage point for the RTOS version of SDFileSystem:
183 185 187 189 191 1900 1902 1904 1906 1908 1910
So it stopped the timer thread for 1.7ms.
With regular SD card it is:
183 185 187 189 191 426240 426242 426244 426246 426248 426250
So that is alot worse. Of course you still need to give it enough time to write everything, and later on there will also be short hickups when it has to start writing a new block.