summaryrefslogtreecommitdiff
path: root/ports/nrf/background.c
diff options
context:
space:
mode:
authorhathach <thach@tinyusb.org>2018-07-05 11:30:12 +0700
committerhathach <thach@tinyusb.org>2018-07-05 11:30:12 +0700
commit1745e20391a23bf65ff17a0515b803e97fa6970e (patch)
tree3181717bbe28b27bc3420d43f170a7474fc04f0c /ports/nrf/background.c
parentbe2ff20e429bf3cb38c4c94927b0affc0c3ab782 (diff)
replace jlink with native usb cdc for serial REPL
Diffstat (limited to 'ports/nrf/background.c')
-rw-r--r--ports/nrf/background.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/ports/nrf/background.c b/ports/nrf/background.c
new file mode 100644
index 000000000..fc8128ca8
--- /dev/null
+++ b/ports/nrf/background.c
@@ -0,0 +1,54 @@
+/**************************************************************************/
+/*!
+ @file background.c
+ @author hathach (tinyusb.org)
+
+ @section LICENSE
+
+ Software License Agreement (BSD License)
+
+ Copyright (c) 2018, Adafruit Industries (adafruit.com)
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the copyright holders nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/**************************************************************************/
+
+#include "tusb.h"
+
+/*------------------------------------------------------------------*/
+/* MACRO TYPEDEF CONSTANT ENUM
+ *------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+/* VARIABLE DECLARATION
+ *------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+/* FUNCTION DECLARATION
+ *------------------------------------------------------------------*/
+
+void run_background_tasks(void) {
+ tusb_task();
+ tud_cdc_flush();
+}