summaryrefslogtreecommitdiff
path: root/openpicc/application/usb_print.c
diff options
context:
space:
mode:
authorhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2008-03-05 01:59:58 +0000
committerhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2008-03-05 01:59:58 +0000
commit3ee3c4a649545d1f132bca61cc7484f0d5c92638 (patch)
tree9dfc8a38819b7b4965ca4ba74e333eb72f365b53 /openpicc/application/usb_print.c
parentbac6c469cc2116b6a2917f75c979722e616ef904 (diff)
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
Diffstat (limited to 'openpicc/application/usb_print.c')
-rw-r--r--openpicc/application/usb_print.c11
1 files changed, 10 insertions, 1 deletions
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();
personal git repositories of Harald Welte. Your mileage may vary