X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=firmware%2Flib%2Fcommand.c;h=738fab6271e306385082da670b4a643e839fdaac;hp=c572a1dc7cfa27ceb6284b20eeb04247867f4ea3;hb=3e4369fde16445c994da1b1efb332704aad0716d;hpb=1f226af77a28d66cbe8eff845e4fee3370798ab8 diff --git a/firmware/lib/command.c b/firmware/lib/command.c index c572a1d..738fab6 100644 --- a/firmware/lib/command.c +++ b/firmware/lib/command.c @@ -1,3 +1,7 @@ +#include "command.h" +#include "platform.h" +#include + //! Different command handling functions. unsigned char cmddata[256]; @@ -27,8 +31,21 @@ void txdata(unsigned char app, } } +//Be very careful changing delay(). +//It was chosen poorly by trial and error. + //! Delay for a count. void delay(unsigned int count){ volatile unsigned int i=count; while(i--) asm("nop"); } +//! MSDelay +void msdelay(unsigned int ms){ + volatile unsigned int i,j; + i=100; + while(i--){ + j=ms; + while(j--) asm("nop"); + } + //Using TimerA might be cleaner. +}