From c63871ac816955469c7178eed3467de52d4c05e7 Mon Sep 17 00:00:00 2001 From: henryk Date: Sun, 18 Nov 2007 00:04:42 +0000 Subject: Add (ring-)buffered print functions to enable debug output from IRQ handlers or similar situations git-svn-id: https://svn.openpcd.org:2342/trunk@330 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- openpicc/application/cmd.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'openpicc/application/cmd.c') diff --git a/openpicc/application/cmd.c b/openpicc/application/cmd.c index 0b5b8da..7390775 100644 --- a/openpicc/application/cmd.c +++ b/openpicc/application/cmd.c @@ -15,6 +15,7 @@ #include "tc_cdiv.h" #include "tc_cdiv_sync.h" #include "pio_irq.h" +#include "usb_print.h" xQueueHandle xCmdQueue; xTaskHandle xCmdTask; @@ -47,17 +48,13 @@ void DumpUIntToUSB(unsigned int data) } while(data); while(i--) - vUSBSendByte(*p++); + usb_print_char(*p++); } /**********************************************************************/ void DumpStringToUSB(char* text) { - unsigned char data; - - if(text) - while((data=*text++)!=0) - vUSBSendByte(data); + usb_print_string(text); } /**********************************************************************/ @@ -71,8 +68,8 @@ void DumpBufferToUSB(char* buffer, int len) int i; for(i=0; i> 4)); - vUSBSendByte(HexChar( *buffer++ & 0xf)); + usb_print_char(HexChar( *buffer >> 4)); + usb_print_char(HexChar( *buffer++ & 0xf)); } } /**********************************************************************/ -- cgit v1.2.3