diff --git a/platform/jn516x/contiki-jn516x-main.c b/platform/jn516x/contiki-jn516x-main.c index deda71b11..d7b463b12 100644 --- a/platform/jn516x/contiki-jn516x-main.c +++ b/platform/jn516x/contiki-jn516x-main.c @@ -232,13 +232,13 @@ set_linkaddr(void) { int i; linkaddr_t addr; - memset(&addr, 0, sizeof(linkaddr_t)); + memset(&addr, 0, LINKADDR_SIZE); #if NETSTACK_CONF_WITH_IPV6 memcpy(addr.u8, node_mac, sizeof(addr.u8)); #else if(node_id == 0) { - for(i = 0; i < sizeof(linkaddr_t); ++i) { - addr.u8[i] = node_mac[7 - i]; + for(i = 0; i < LINKADDR_SIZE; ++i) { + addr.u8[i] = node_mac[LINKADDR_SIZE - 1 - i]; } } else { addr.u8[0] = node_id & 0xff; diff --git a/platform/jn516x/dev/exceptions.c b/platform/jn516x/dev/exceptions.c index def4e2a73..10a3bf11b 100644 --- a/platform/jn516x/dev/exceptions.c +++ b/platform/jn516x/dev/exceptions.c @@ -66,7 +66,6 @@ #endif /* JENNIC_CHIP_FAMILY */ #if (defined EXCEPTION_VECTORS_LOCATION_RAM) -#pragma "EXCEPTION_VECTORS_LOCATION_RAM" /* RAM exception vectors are set up at run time */ /* Addresses of exception vectors in RAM */ #define BUS_ERROR *((volatile uint32 *)(0x4000000)) @@ -79,7 +78,6 @@ #define GENERIC *((volatile uint32 *)(0x400001c)) #define STACK_OVERFLOW *((volatile uint32 *)(0x4000020)) #elif (defined EXCEPTION_VECTORS_LOCATION_FLASH) -#pragma "EXCEPTION_VECTORS_LOCATION_FLASH" /* Flash exception vectors are set up at compile time */ #else #error Unknown exception vector location diff --git a/platform/jn516x/dev/micromac-radio.c b/platform/jn516x/dev/micromac-radio.c index 3d9d4026a..97e481eab 100644 --- a/platform/jn516x/dev/micromac-radio.c +++ b/platform/jn516x/dev/micromac-radio.c @@ -57,6 +57,8 @@ #include "JPT.h" #include "PeripheralRegs.h" +void vMMAC_SetChannelAndPower(uint8 u8Channel, int8 i8power); + /* This driver configures the radio in PHY mode and does address decoding * and acknowledging in software. */ @@ -864,8 +866,6 @@ set_send_on_cca(uint8_t enable) static radio_result_t get_value(radio_param_t param, radio_value_t *value) { - int i, v; - if(!value) { return RADIO_RESULT_INVALID_VALUE; } @@ -926,8 +926,6 @@ get_value(radio_param_t param, radio_value_t *value) static radio_result_t set_value(radio_param_t param, radio_value_t value) { - int i; - switch(param) { case RADIO_PARAM_POWER_MODE: if(value == RADIO_POWER_MODE_ON) { diff --git a/platform/jn516x/dev/rtimer-arch.c b/platform/jn516x/dev/rtimer-arch.c index f89b8a9a8..6c2e3ae8d 100644 --- a/platform/jn516x/dev/rtimer-arch.c +++ b/platform/jn516x/dev/rtimer-arch.c @@ -39,6 +39,7 @@ #include "sys/rtimer.h" #include "sys/clock.h" +#include "sys/process.h" #include #include #include "dev/watchdog.h" diff --git a/platform/jn516x/dev/uart-driver.c b/platform/jn516x/dev/uart-driver.c index e5a58f0b5..b916927a2 100644 --- a/platform/jn516x/dev/uart-driver.c +++ b/platform/jn516x/dev/uart-driver.c @@ -44,6 +44,7 @@ #include "contiki-conf.h" #include "uart-driver.h" #include "sys/rtimer.h" +#include "watchdog.h" #include #include @@ -79,7 +80,9 @@ extern volatile unsigned char xonxoff_state; /*** Local Function Prototypes ***/ static void uart_driver_isr(uint32_t device_id, uint32_t item_bitmap); +#if !UART_XONXOFF_FLOW_CTRL static int16_t uart_driver_get_tx_fifo_available_space(uint8_t uart_dev); +#endif /* !UART_XONXOFF_FLOW_CTRL */ static void uart_driver_set_baudrate(uint8_t uart_dev, uint8_t br); static void uart_driver_set_high_baudrate(uint8_t uart_dev, uint32_t baud_rate); @@ -352,12 +355,14 @@ uart_driver_rx_handler(uint8_t uart_dev) /*** Local Functions ***/ /****************************************************************************/ +#if !UART_XONXOFF_FLOW_CTRL /* Returns the free space in tx fifo, i.e., how many characters we can put */ static int16_t uart_driver_get_tx_fifo_available_space(uint8_t uart_dev) { return tx_fifo_size[uart_dev] - u16AHI_UartReadTxFifoLevel(uart_dev); } +#endif /* !UART_XONXOFF_FLOW_CTRL */ /* Initializes the specified UART with auto-selection of baudrate tuning method */ static void @@ -459,7 +464,7 @@ uart_driver_set_high_baudrate(uint8_t uart_dev, uint32_t baud_rate) DBG_vPrintf(DEBUG_UART_BUFFERED, "Config uart=%d, baud=%d\n", uart_dev, baud_rate); - while(abs(i32BaudError) > (int32)(baud_rate >> 4)) { /* 6.25% (100/16) error */ + while(ABS(i32BaudError) > (int32)(baud_rate >> 4)) { /* 6.25% (100/16) error */ if(--u8ClocksPerBit < 3) { DBG_vPrintf(DEBUG_UART_BUFFERED, "Could not calculate UART settings for target baud!"); diff --git a/platform/jn516x/dev/uart0.h b/platform/jn516x/dev/uart0.h index 293950c5b..6f93f7147 100644 --- a/platform/jn516x/dev/uart0.h +++ b/platform/jn516x/dev/uart0.h @@ -43,6 +43,7 @@ #include #include "contiki-conf.h" +#include "uart-driver.h" #define UART_DEFAULT_RX_BUFFER_SIZE 2047 #if UART_XONXOFF_FLOW_CTRL diff --git a/platform/jn516x/lib/sprintf.c b/platform/jn516x/lib/sprintf.c index 8dbfa10a0..500951e92 100644 --- a/platform/jn516x/lib/sprintf.c +++ b/platform/jn516x/lib/sprintf.c @@ -227,7 +227,7 @@ int puts(const char *s) { char c; - while(c = *s++) { + while((c = *s++) != '\0') { putchar(c); } putchar('\n');