From 3ee3c4a649545d1f132bca61cc7484f0d5c92638 Mon Sep 17 00:00:00 2001 From: henryk Date: Wed, 5 Mar 2008 01:59:58 +0000 Subject: Copy over the relevant changes from the sniffonly branch pending integration git-svn-id: https://svn.openpcd.org:2342/trunk@442 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- openpicc/application/usb_print.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'openpicc/application/usb_print.c') diff --git a/openpicc/application/usb_print.c b/openpicc/application/usb_print.c index 5ff42b8..5e4372b 100644 --- a/openpicc/application/usb_print.c +++ b/openpicc/application/usb_print.c @@ -29,7 +29,7 @@ static char ringbuffer[BUFLEN]; static int ringstart, ringstop; -static int default_flush = 1; +static int default_flush = 1, forced_silence = 0; static xSemaphoreHandle print_semaphore; void usb_print_buffer(const char* buffer, int start, int stop) { @@ -92,11 +92,20 @@ int usb_print_set_default_flush(int flush) return old_flush; } +int usb_print_set_force_silence(int silence) +{ + int old_silence = forced_silence; + forced_silence = silence; + return old_silence; +} + /* Must NOT be called from ISR context */ void usb_print_flush(void) { int oldstop, newstart; + if(forced_silence) return; + taskENTER_CRITICAL(); if(print_semaphore == NULL) usb_print_init(); -- cgit v1.2.3