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.
Diff: util.cpp
- Revision:
- 0:e0a44db7e925
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/util.cpp Thu Dec 23 15:03:51 2010 +0000
@@ -0,0 +1,21 @@
+#include "mbed.h"
+
+#include "util.h"
+
+#include "main.h"
+
+unsigned char rev_byte(unsigned char c)
+{
+ unsigned char r = 0, i;
+
+ for (i = 1; i != 0; i = i<<1) {
+ r = r << 1;
+ if (c & i)
+ r |= 1;
+ }
+
+ if (mode_config.numbits != 8)
+ r >>= (8 - mode_config.numbits);
+
+ return r;
+}