X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=firmware%2Fplatforms%2Fnhbadgeb.h;h=1b86e4fe744008cec43acfd8408244dccbf76323;hp=895df8a99a8b5077d124e51fdfefbc920e110c7a;hb=HEAD;hpb=d3411f7280aa79a5d83298c6843091c2bfa5b9c0 diff --git a/firmware/platforms/nhbadgeb.h b/firmware/platforms/nhbadgeb.h index 895df8a..1b86e4f 100644 --- a/firmware/platforms/nhbadgeb.h +++ b/firmware/platforms/nhbadgeb.h @@ -5,22 +5,28 @@ #ifdef MSP430 -#include +#include #endif +//This nonsense is deprecated. +//Remove as soon as is convenient. #define P5OUT P4OUT #define P5DIR P4DIR #define P5IN P4IN #define P5REN P4REN +#define SPIOUT P4OUT +#define SPIDIR P4DIR +#define SPIIN P4IN +#define SPIREN P4REN + + //LED on P1.0 #define PLEDOUT P1OUT #define PLEDDIR P1DIR #define PLEDPIN BIT0 - -//No longer works for Hope badge. #define SETSS P4OUT|=BIT4 #define CLRSS P4OUT&=~BIT4 #define DIRSS P4DIR|=BIT4; @@ -31,3 +37,14 @@ #define SETCE P4OUT|=BIT5 #define CLRCE P4OUT&=~BIT5 #define DIRCE P4DIR|=BIT5 + +// network byte order converters +#define htons(x) ((((uint16_t)(x) & 0xFF00) >> 8) | \ + (((uint16_t)(x) & 0x00FF) << 8)) +#define htonl(x) ((((uint32_t)(x) & 0xFF000000) >> 24) | \ + (((uint32_t)(x) & 0x00FF0000) >> 8) | \ + (((uint32_t)(x) & 0x0000FF00) << 8) | \ + (((uint32_t)(x) & 0x000000FF) << 24)) + +#define ntohs htons +#define ntohl htonl