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.
util.cpp
- Committer:
- iamjay
- Date:
- 2010-12-23
- Revision:
- 0:e0a44db7e925
File content as of revision 0:e0a44db7e925:
#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;
}