jn516x examples: fix compiler warnings to enable -Wall -Werror compilation
This commit is contained in:
parent
c13274c550
commit
1634acf2c4
|
@ -38,6 +38,7 @@
|
|||
#include "light-sensor.h"
|
||||
#include "ht-sensor.h"
|
||||
#include "leds.h"
|
||||
#include "leds-extension.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
PROCESS(test_process, "Sensor test process");
|
||||
|
|
|
@ -101,9 +101,10 @@ PROCESS_THREAD(unicast_test_process, ev, data)
|
|||
}
|
||||
|
||||
if(!runicast_is_transmitting(&runicast)) {
|
||||
linkaddr_t recv = { 0 };
|
||||
static char buffer[100] = "hello";
|
||||
linkaddr_t recv;
|
||||
|
||||
memset(&recv, 0, LINKADDR_SIZE);
|
||||
packetbuf_copyfrom(buffer, sizeof(buffer));
|
||||
recv.u8[0] = RX_ADDR1;
|
||||
recv.u8[1] = RX_ADDR2;
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
*/
|
||||
|
||||
#include "contiki.h"
|
||||
#include "dev/slip.h"
|
||||
#include "net/rpl/rpl.h"
|
||||
#include "tools/rpl-tools.h"
|
||||
|
||||
|
|
|
@ -79,8 +79,6 @@ static void
|
|||
put_post_led_toggle_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
||||
{
|
||||
static int led_state = 0;
|
||||
const uint8_t *request_content;
|
||||
int request_content_len;
|
||||
unsigned int accept = -1;
|
||||
|
||||
/* Given the way the LEDs are connected to the DIO ports, the LEDs are controlled via direct DIO access. */
|
||||
|
|
|
@ -39,8 +39,10 @@
|
|||
#include "light-sensor.h"
|
||||
#include "ht-sensor.h"
|
||||
#include "dev/leds.h"
|
||||
#include "dev/leds-extension.h"
|
||||
#include "sys/etimer.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
static void event_sensors_dr1175_handler(void);
|
||||
static void get_sensors_dr1175_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset);
|
||||
|
@ -247,13 +249,12 @@ static void
|
|||
put_post_white_led_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
||||
{
|
||||
const uint8_t *request_content = NULL;
|
||||
int request_content_len;
|
||||
int level;
|
||||
|
||||
unsigned int accept = -1;
|
||||
REST.get_header_accept(request, &accept);
|
||||
if(accept == -1 || accept == REST.type.TEXT_PLAIN) {
|
||||
request_content_len = REST.get_request_payload(request, &request_content);
|
||||
REST.get_request_payload(request, &request_content);
|
||||
level = atoi((const char *)request_content);
|
||||
CLIP(level, 255)
|
||||
leds_set_level(level, LEDS_WHITE);
|
||||
|
@ -272,7 +273,6 @@ static void
|
|||
put_post_rgb_led_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
||||
{
|
||||
const uint8_t *request_content = NULL;
|
||||
int request_content_len;
|
||||
char *pch;
|
||||
int RGB[] = { 0, 0, 0 };
|
||||
int index = 0;
|
||||
|
@ -280,7 +280,7 @@ put_post_rgb_led_handler(void *request, void *response, uint8_t *buffer, uint16_
|
|||
unsigned int accept = -1;
|
||||
REST.get_header_accept(request, &accept);
|
||||
if(accept == -1 || accept == REST.type.TEXT_PLAIN) {
|
||||
request_content_len = REST.get_request_payload(request, &request_content);
|
||||
REST.get_request_payload(request, &request_content);
|
||||
pch = strtok((char *)request_content, " ");
|
||||
while((pch != NULL) && (index != sizeof(RGB) / sizeof(int))) {
|
||||
/* Convert token to int */
|
||||
|
@ -308,11 +308,10 @@ static void
|
|||
put_post_led_d3_1174_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
||||
{
|
||||
const uint8_t *request_content;
|
||||
int request_content_len;
|
||||
unsigned int accept = -1;
|
||||
REST.get_header_accept(request, &accept);
|
||||
if(accept == -1 || accept == REST.type.TEXT_PLAIN) {
|
||||
request_content_len = REST.get_request_payload(request, &request_content);
|
||||
REST.get_request_payload(request, &request_content);
|
||||
SET_LED(LEDS_GP0);
|
||||
}
|
||||
}
|
||||
|
@ -329,11 +328,10 @@ static void
|
|||
put_post_led_d6_1174_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
||||
{
|
||||
const uint8_t *request_content;
|
||||
int request_content_len;
|
||||
unsigned int accept = -1;
|
||||
REST.get_header_accept(request, &accept);
|
||||
if(accept == -1 || accept == REST.type.TEXT_PLAIN) {
|
||||
request_content_len = REST.get_request_payload(request, &request_content);
|
||||
REST.get_request_payload(request, &request_content);
|
||||
SET_LED(LEDS_GP1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include "button-sensor.h"
|
||||
#include "pot-sensor.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
static char content[REST_MAX_CHUNK_SIZE];
|
||||
static int content_len = 0;
|
||||
|
@ -238,11 +239,10 @@ static void
|
|||
put_post_led_d1_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
||||
{
|
||||
const uint8_t *request_content;
|
||||
int request_content_len;
|
||||
unsigned int accept = -1;
|
||||
REST.get_header_accept(request, &accept);
|
||||
if(accept == -1 || accept == REST.type.TEXT_PLAIN) {
|
||||
request_content_len = REST.get_request_payload(request, &request_content);
|
||||
REST.get_request_payload(request, &request_content);
|
||||
SET_LED(LEDS_GREEN)
|
||||
}
|
||||
}
|
||||
|
@ -256,11 +256,10 @@ static void
|
|||
put_post_led_d2_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
||||
{
|
||||
const uint8_t *request_content;
|
||||
int request_content_len;
|
||||
unsigned int accept = -1;
|
||||
REST.get_header_accept(request, &accept);
|
||||
if(accept == -1 || accept == REST.type.TEXT_PLAIN) {
|
||||
request_content_len = REST.get_request_payload(request, &request_content);
|
||||
REST.get_request_payload(request, &request_content);
|
||||
SET_LED(LEDS_BLUE)
|
||||
}
|
||||
}
|
||||
|
@ -274,11 +273,10 @@ static void
|
|||
put_post_led_d3_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
||||
{
|
||||
const uint8_t *request_content;
|
||||
int request_content_len;
|
||||
unsigned int accept = -1;
|
||||
REST.get_header_accept(request, &accept);
|
||||
if(accept == -1 || accept == REST.type.TEXT_PLAIN) {
|
||||
request_content_len = REST.get_request_payload(request, &request_content);
|
||||
REST.get_request_payload(request, &request_content);
|
||||
SET_LED(LEDS_RED)
|
||||
}
|
||||
}
|
||||
|
@ -292,11 +290,10 @@ static void
|
|||
put_post_led_d3_1174_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
||||
{
|
||||
const uint8_t *request_content;
|
||||
int request_content_len;
|
||||
unsigned int accept = -1;
|
||||
REST.get_header_accept(request, &accept);
|
||||
if(accept == -1 || accept == REST.type.TEXT_PLAIN) {
|
||||
request_content_len = REST.get_request_payload(request, &request_content);
|
||||
REST.get_request_payload(request, &request_content);
|
||||
SET_LED(LEDS_GP0);
|
||||
}
|
||||
}
|
||||
|
@ -310,11 +307,10 @@ static void
|
|||
put_post_led_d6_1174_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
||||
{
|
||||
const uint8_t *request_content;
|
||||
int request_content_len;
|
||||
unsigned int accept = -1;
|
||||
REST.get_header_accept(request, &accept);
|
||||
if(accept == -1 || accept == REST.type.TEXT_PLAIN) {
|
||||
request_content_len = REST.get_request_payload(request, &request_content);
|
||||
REST.get_request_payload(request, &request_content);
|
||||
SET_LED(LEDS_GP1);
|
||||
}
|
||||
}
|
||||
|
@ -328,11 +324,10 @@ static void
|
|||
put_post_led_all_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset)
|
||||
{
|
||||
const uint8_t *request_content;
|
||||
int request_content_len;
|
||||
unsigned int accept = -1;
|
||||
REST.get_header_accept(request, &accept);
|
||||
if(accept == -1 || accept == REST.type.TEXT_PLAIN) {
|
||||
request_content_len = REST.get_request_payload(request, &request_content);
|
||||
REST.get_request_payload(request, &request_content);
|
||||
if(atoi((const char *)request_content) != 0) {
|
||||
leds_on(LEDS_ALL);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue