X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=firmware%2Flib%2Fcommand.c;h=6388c643b366a82b2f1384c2b0e6b1960098d944;hp=d984fca791feb33f357e38223acde6d73d0bd090;hb=HEAD;hpb=f4a6b415e762bcdc560f3ea655851d16f483ea5a diff --git a/firmware/lib/command.c b/firmware/lib/command.c index d984fca..6388c64 100644 --- a/firmware/lib/command.c +++ b/firmware/lib/command.c @@ -1,6 +1,6 @@ /*! \file command.c \author Travis Goodspeed - \brief These functions manage command interpretation. + \brief These functions manage command interpretation and timing. */ #include "command.h" @@ -30,13 +30,35 @@ void debugstr(const char *str){ txstring(0xFF,0xFF,str); } +//! brief Debug a hex word string. +void debughex(u16 v) { + debugbytes((void *)&v, 2); +} + +//! brief Debug a hex word string. +void debughex32(u32 v) { + debugbytes((void *)&v, 4); +} + +/*! \brief Transmit debug bytes. + + Transmits bytes for debugging. +*/ +void debugbytes(const char *bytes, unsigned int len){ + u16 i; + txhead(0xFF,0xFE,len); + for(i=0;i