X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=firmware%2Flib%2Fcommand.c;h=6388c643b366a82b2f1384c2b0e6b1960098d944;hb=3a1dba16a3f6c27250e1e9566171abe48537cc89;hp=282d98adafc47c9d092901a8d266ac88d0320392;hpb=f110fe63257686b9fcac78824d61ec429c2a5226;p=goodfet diff --git a/firmware/lib/command.c b/firmware/lib/command.c index 282d98a..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,6 +30,27 @@ 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