Reincarnate the sensinode/cc2430 port
This commit is contained in:
parent
c78b5bad5c
commit
b7674c3636
114 changed files with 10044 additions and 3068 deletions
46
platform/sensinode/sensinode-debug.c
Normal file
46
platform/sensinode/sensinode-debug.c
Normal file
|
@ -0,0 +1,46 @@
|
|||
/**
|
||||
* \file
|
||||
*
|
||||
* Definition of some debugging functions for the sensinode port.
|
||||
*
|
||||
* This file is bankable.
|
||||
*
|
||||
* putstring() and puthex() are from msp430/watchdog.c
|
||||
*
|
||||
* \author
|
||||
* George Oikonomou - <oikonomou@users.sourceforge.net>
|
||||
*/
|
||||
|
||||
#include "cc2430_sfr.h"
|
||||
#include "8051def.h"
|
||||
#include "sensinode-debug.h"
|
||||
|
||||
static const char hexconv[] = "0123456789abcdef";
|
||||
static const char binconv[] = "01";
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
putstring(char *s)
|
||||
{
|
||||
while(*s) {
|
||||
putchar(*s++);
|
||||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
puthex(uint8_t c)
|
||||
{
|
||||
putchar(hexconv[c >> 4]);
|
||||
putchar(hexconv[c & 0x0f]);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
putbin(uint8_t c)
|
||||
{
|
||||
unsigned char i = 0x80;
|
||||
while(i) {
|
||||
putchar(binconv[(c & i) != 0]);
|
||||
i >>= 1;
|
||||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
Loading…
Add table
Add a link
Reference in a new issue