jn516x platform: fix compiler warnings to enable -Wall -Werror compilation

This commit is contained in:
Simon Duquennoy 2015-10-20 09:45:00 +02:00
parent 48ae0d2ba0
commit c13274c550
7 changed files with 14 additions and 11 deletions

View file

@ -232,13 +232,13 @@ set_linkaddr(void)
{ {
int i; int i;
linkaddr_t addr; linkaddr_t addr;
memset(&addr, 0, sizeof(linkaddr_t)); memset(&addr, 0, LINKADDR_SIZE);
#if NETSTACK_CONF_WITH_IPV6 #if NETSTACK_CONF_WITH_IPV6
memcpy(addr.u8, node_mac, sizeof(addr.u8)); memcpy(addr.u8, node_mac, sizeof(addr.u8));
#else #else
if(node_id == 0) { if(node_id == 0) {
for(i = 0; i < sizeof(linkaddr_t); ++i) { for(i = 0; i < LINKADDR_SIZE; ++i) {
addr.u8[i] = node_mac[7 - i]; addr.u8[i] = node_mac[LINKADDR_SIZE - 1 - i];
} }
} else { } else {
addr.u8[0] = node_id & 0xff; addr.u8[0] = node_id & 0xff;

View file

@ -66,7 +66,6 @@
#endif /* JENNIC_CHIP_FAMILY */ #endif /* JENNIC_CHIP_FAMILY */
#if (defined EXCEPTION_VECTORS_LOCATION_RAM) #if (defined EXCEPTION_VECTORS_LOCATION_RAM)
#pragma "EXCEPTION_VECTORS_LOCATION_RAM"
/* RAM exception vectors are set up at run time */ /* RAM exception vectors are set up at run time */
/* Addresses of exception vectors in RAM */ /* Addresses of exception vectors in RAM */
#define BUS_ERROR *((volatile uint32 *)(0x4000000)) #define BUS_ERROR *((volatile uint32 *)(0x4000000))
@ -79,7 +78,6 @@
#define GENERIC *((volatile uint32 *)(0x400001c)) #define GENERIC *((volatile uint32 *)(0x400001c))
#define STACK_OVERFLOW *((volatile uint32 *)(0x4000020)) #define STACK_OVERFLOW *((volatile uint32 *)(0x4000020))
#elif (defined EXCEPTION_VECTORS_LOCATION_FLASH) #elif (defined EXCEPTION_VECTORS_LOCATION_FLASH)
#pragma "EXCEPTION_VECTORS_LOCATION_FLASH"
/* Flash exception vectors are set up at compile time */ /* Flash exception vectors are set up at compile time */
#else #else
#error Unknown exception vector location #error Unknown exception vector location

View file

@ -57,6 +57,8 @@
#include "JPT.h" #include "JPT.h"
#include "PeripheralRegs.h" #include "PeripheralRegs.h"
void vMMAC_SetChannelAndPower(uint8 u8Channel, int8 i8power);
/* This driver configures the radio in PHY mode and does address decoding /* This driver configures the radio in PHY mode and does address decoding
* and acknowledging in software. */ * and acknowledging in software. */
@ -864,8 +866,6 @@ set_send_on_cca(uint8_t enable)
static radio_result_t static radio_result_t
get_value(radio_param_t param, radio_value_t *value) get_value(radio_param_t param, radio_value_t *value)
{ {
int i, v;
if(!value) { if(!value) {
return RADIO_RESULT_INVALID_VALUE; return RADIO_RESULT_INVALID_VALUE;
} }
@ -926,8 +926,6 @@ get_value(radio_param_t param, radio_value_t *value)
static radio_result_t static radio_result_t
set_value(radio_param_t param, radio_value_t value) set_value(radio_param_t param, radio_value_t value)
{ {
int i;
switch(param) { switch(param) {
case RADIO_PARAM_POWER_MODE: case RADIO_PARAM_POWER_MODE:
if(value == RADIO_POWER_MODE_ON) { if(value == RADIO_POWER_MODE_ON) {

View file

@ -39,6 +39,7 @@
#include "sys/rtimer.h" #include "sys/rtimer.h"
#include "sys/clock.h" #include "sys/clock.h"
#include "sys/process.h"
#include <AppHardwareApi.h> #include <AppHardwareApi.h>
#include <PeripheralRegs.h> #include <PeripheralRegs.h>
#include "dev/watchdog.h" #include "dev/watchdog.h"

View file

@ -44,6 +44,7 @@
#include "contiki-conf.h" #include "contiki-conf.h"
#include "uart-driver.h" #include "uart-driver.h"
#include "sys/rtimer.h" #include "sys/rtimer.h"
#include "watchdog.h"
#include <math.h> #include <math.h>
#include <AppHardwareApi.h> #include <AppHardwareApi.h>
@ -79,7 +80,9 @@ extern volatile unsigned char xonxoff_state;
/*** Local Function Prototypes ***/ /*** Local Function Prototypes ***/
static void uart_driver_isr(uint32_t device_id, uint32_t item_bitmap); 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); 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_baudrate(uint8_t uart_dev, uint8_t br);
static void uart_driver_set_high_baudrate(uint8_t uart_dev, uint32_t baud_rate); 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 ***/ /*** Local Functions ***/
/****************************************************************************/ /****************************************************************************/
#if !UART_XONXOFF_FLOW_CTRL
/* Returns the free space in tx fifo, i.e., how many characters we can put */ /* Returns the free space in tx fifo, i.e., how many characters we can put */
static int16_t static int16_t
uart_driver_get_tx_fifo_available_space(uint8_t uart_dev) uart_driver_get_tx_fifo_available_space(uint8_t uart_dev)
{ {
return tx_fifo_size[uart_dev] - u16AHI_UartReadTxFifoLevel(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 /* Initializes the specified UART with auto-selection of
baudrate tuning method */ baudrate tuning method */
static void 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, DBG_vPrintf(DEBUG_UART_BUFFERED, "Config uart=%d, baud=%d\n", uart_dev,
baud_rate); 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) { if(--u8ClocksPerBit < 3) {
DBG_vPrintf(DEBUG_UART_BUFFERED, DBG_vPrintf(DEBUG_UART_BUFFERED,
"Could not calculate UART settings for target baud!"); "Could not calculate UART settings for target baud!");

View file

@ -43,6 +43,7 @@
#include <PeripheralRegs.h> #include <PeripheralRegs.h>
#include "contiki-conf.h" #include "contiki-conf.h"
#include "uart-driver.h"
#define UART_DEFAULT_RX_BUFFER_SIZE 2047 #define UART_DEFAULT_RX_BUFFER_SIZE 2047
#if UART_XONXOFF_FLOW_CTRL #if UART_XONXOFF_FLOW_CTRL

View file

@ -227,7 +227,7 @@ int
puts(const char *s) puts(const char *s)
{ {
char c; char c;
while(c = *s++) { while((c = *s++) != '\0') {
putchar(c); putchar(c);
} }
putchar('\n'); putchar('\n');