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.
Diff: SDFileSystem-RTOS.lib
- Revision:
- 0:1a13ba7627ce
- Child:
- 1:bce8311b4547
diff -r 000000000000 -r 1a13ba7627ce SDFileSystem-RTOS.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SDFileSystem-RTOS.lib Thu Dec 26 15:02:29 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/Sissors/code/SDFileSystem-RTOS/#1a4ffe455d3c