Skip to content

Commit

Permalink
Merge pull request #30 from soburi/disable_uart0_non_debug
Browse files Browse the repository at this point in the history
Omit controlling UART0 if DEBUG_UART0_ENABLE disabled.
  • Loading branch information
soburi authored Apr 10, 2017
2 parents 8db975a + 34d22d4 commit 4e7910d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion variants/jn516x/contiki-jn516x-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ static uint32_t sleep_start_ticks;
#else
#define PRINTF(...) do {} while(0)
#endif

#define UART0_DEBUG_ENABLE 0
/*---------------------------------------------------------------------------*/
/* Reads MAC from SoC
* Must be called before node_id_restore()
Expand Down Expand Up @@ -334,7 +336,9 @@ main(void)

process_init();
ctimer_init();
//uart0_init(UART_BAUD_RATE); /* Must come before first PRINTF */
#if UART0_DEBUG_ENABLE
uart0_init(UART_BAUD_RATE); /* Must come before first PRINTF */
#endif

#if NETSTACK_CONF_WITH_IPV4
slip_arch_init(UART_BAUD_RATE);
Expand Down Expand Up @@ -373,7 +377,9 @@ main(void)
PRINTF("%s %s %s\n", NETSTACK_LLSEC.name, NETSTACK_MAC.name, NETSTACK_RDC.name);

#ifndef UIP_FALLBACK_INTERFACE
#if UART0_DEBUG_ENABLE
uart0_set_input(serial_line_input_byte);
#endif
serial_line_init();
#endif /* UIP_FALLBACK_INTERFACE */

Expand Down Expand Up @@ -465,7 +471,10 @@ main_loop(void)
#endif /* DCOSYNCH_CONF_ENABLED */

/* flush standard output before sleeping */
#if UART0_DEBUG_ENABLE
uart_driver_flush(E_AHI_UART_0, TRUE, FALSE);
#endif


/* calculate the time to the next etimer and rtimer */
time_to_etimer = clock_arch_time_to_etimer();
Expand Down Expand Up @@ -544,7 +553,9 @@ AppWarmStart(void)

clock_arch_calibrate();
leds_init();
#if UART0_DEBUG_ENABLE
uart0_init(UART_BAUD_RATE); /* Must come before first PRINTF */
#endif
NETSTACK_RADIO.init();
watchdog_init();
watchdog_stop();
Expand Down

0 comments on commit 4e7910d

Please sign in to comment.