Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: CircularBuffer mbed
Revision 0:aad8c5c41dac, committed 2013-09-20
- Comitter:
- feb11
- Date:
- Fri Sep 20 10:47:53 2013 +0000
- Commit message:
- initial import
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CircularBuffer.lib Fri Sep 20 10:47:53 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/feb11/code/CircularBuffer/#e15dee1d59ee
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Fri Sep 20 10:47:53 2013 +0000
@@ -0,0 +1,19 @@
+#include "mbed.h"
+#include "CircularBuffer.h"
+
+int main()
+{
+ CircularBuffer<16> buffer;
+ uint32_t n = buffer.write((uint8_t*)"Hello World !", strlen("Hello World !"));
+ printf("wrote %d bytes\n", n);
+ char str[10];
+ n = buffer.read((uint8_t*)str, 5);
+ str[n] = '\0';
+ printf("str=%s\n", str); // prints:Hello
+ buffer.read((uint8_t*)str, 1); // discard space
+ n = buffer.read((uint8_t*)str, 7);
+ str[n] = '\0';
+ printf("str=%s\n", str); // prints:World !
+
+ return 0;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Sep 20 10:47:53 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/9c8f0e3462fb \ No newline at end of file