forked from contiki-os/contiki
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated RE-Mote revision A support and cleaning up Zolertia platforms
- Loading branch information
Showing
86 changed files
with
2,011 additions
and
863 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
*.c128 | ||
*.c64 | ||
*.cc2538dk | ||
*.remote | ||
*.zoul | ||
*.jn516x | ||
*.srf06-cc26xx | ||
*.ev-aducrf101mkxz | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
examples/z1/ipv6/z1-websense/Makefile → ...les/zolertia/z1/ipv6/z1-websense/Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
all: z1-websense | ||
|
||
CONTIKI=../../../.. | ||
CONTIKI=../../../../.. | ||
|
||
SMALL=1 | ||
|
||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
DEFINES+=PROJECT_CONF_H=\"project-conf.h\" | ||
CONTIKI_PROJECT = remote-demo test-tsl2563 test-sht25 | ||
CONTIKI_PROJECT = zoul-demo test-tsl2563 test-sht25 | ||
CONTIKI_TARGET_SOURCEFILES += tsl2563.c sht25.c | ||
|
||
all: $(CONTIKI_PROJECT) | ||
|
||
CONTIKI = ../.. | ||
CONTIKI = ../../.. | ||
CONTIKI_WITH_RIME = 1 | ||
include $(CONTIKI)/Makefile.include |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
TARGET = zoul |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
DEFINES+=PROJECT_CONF_H=\"project-conf.h\" | ||
CONTIKI_PROJECT = cc1200-demo | ||
|
||
all: $(CONTIKI_PROJECT) | ||
|
||
CONTIKI = ../../../.. | ||
CONTIKI_WITH_RIME = 1 | ||
include $(CONTIKI)/Makefile.include |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
TARGET = zoul |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (c) 2007, Swedish Institute of Computer Science. | ||
* Copyright (c) 2015, Zolertia - http://www.zolertia.com | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -26,106 +26,80 @@ | |
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
* SUCH DAMAGE. | ||
* | ||
* This file is part of the Contiki operating system. | ||
* | ||
*/ | ||
|
||
/*---------------------------------------------------------------------------*/ | ||
/** | ||
* \addtogroup zoul-cc1200-demo Zoul on-board CC1200 RF transceiver test | ||
* | ||
* Demonstrates the use of the TI CC1200 RF transceiver on Sub-1GHz | ||
* @{ | ||
* | ||
* \file | ||
* Best-effort single-hop unicast example | ||
* Test file for the CC1200 demo | ||
* | ||
* \author | ||
* Adam Dunkels <[email protected]> | ||
* Antonio Lignan <[email protected]> | ||
*/ | ||
|
||
#include "contiki.h" | ||
#include "net/rime/rime.h" | ||
|
||
#include "dev/button-sensor.h" | ||
|
||
#include "cpu.h" | ||
#include "sys/etimer.h" | ||
#include "dev/leds.h" | ||
#include "dev/watchdog.h" | ||
#include "dev/serial-line.h" | ||
#include "dev/sys-ctrl.h" | ||
#include "net/rime/broadcast.h" | ||
|
||
#include <stdio.h> | ||
#include "dev/i2cmaster.h" | ||
#include "dev/tmp102.h" | ||
|
||
#if 1 | ||
#define PRINTF(...) printf(__VA_ARGS__) | ||
#else | ||
#define PRINTF(...) | ||
#endif | ||
|
||
|
||
#define SENDER 205 | ||
#define RECEIVER 200 | ||
|
||
|
||
#define PRINTFDEBUG(...) | ||
|
||
|
||
#define TMP102_READ_INTERVAL (CLOCK_SECOND/2) | ||
|
||
int16_t tempint; | ||
uint16_t tempfrac; | ||
int16_t raw; | ||
uint16_t absraw; | ||
int16_t sign; | ||
char minus = ' '; | ||
|
||
#include <stdint.h> | ||
/*---------------------------------------------------------------------------*/ | ||
PROCESS(example_unicast_process, "Example unicast"); | ||
AUTOSTART_PROCESSES(&example_unicast_process); | ||
#define LOOP_PERIOD 2 | ||
#define LOOP_INTERVAL (CLOCK_SECOND * LOOP_PERIOD) | ||
#define BROADCAST_CHANNEL 129 | ||
/*---------------------------------------------------------------------------*/ | ||
static struct etimer et; | ||
static uint16_t counter; | ||
/*---------------------------------------------------------------------------*/ | ||
static void | ||
recv_uc(struct unicast_conn *c, const linkaddr_t *from) | ||
broadcast_recv(struct broadcast_conn *c, const linkaddr_t *from) | ||
{ | ||
printf("unicast message received from %d.%d\n", | ||
from->u8[0], from->u8[1]); | ||
printf("*** Received %u bytes from %u:%u: '0x%04u' ", packetbuf_datalen(), | ||
from->u8[0], from->u8[1], *(uint16_t *)packetbuf_dataptr()); | ||
printf("%d - %u\n", (int8_t) packetbuf_attr(PACKETBUF_ATTR_RSSI), | ||
packetbuf_attr(PACKETBUF_ATTR_LINK_QUALITY)); | ||
leds_toggle(LEDS_GREEN); | ||
} | ||
static const struct unicast_callbacks unicast_callbacks = {recv_uc}; | ||
static struct unicast_conn uc; | ||
/*---------------------------------------------------------------------------*/ | ||
PROCESS_THREAD(example_unicast_process, ev, data) | ||
static const struct broadcast_callbacks bc_rx = { broadcast_recv }; | ||
static struct broadcast_conn bc; | ||
/*---------------------------------------------------------------------------*/ | ||
PROCESS(cc1200_demo_process, "cc1200 demo process"); | ||
AUTOSTART_PROCESSES(&cc1200_demo_process); | ||
/*---------------------------------------------------------------------------*/ | ||
PROCESS_THREAD(cc1200_demo_process, ev, data) | ||
{ | ||
PROCESS_EXITHANDLER(unicast_close(&uc);) | ||
|
||
PROCESS_EXITHANDLER(broadcast_close(&bc)) | ||
PROCESS_BEGIN(); | ||
|
||
broadcast_open(&bc, BROADCAST_CHANNEL, &bc_rx); | ||
|
||
tmp102_init(); | ||
linkaddr_t addr; | ||
unicast_open(&uc, 133, &unicast_callbacks); | ||
SENSORS_ACTIVATE(button_sensor); | ||
while(1) { | ||
|
||
PROCESS_WAIT_EVENT_UNTIL(ev==sensors_event && data == &button_sensor); | ||
sign = 1; | ||
|
||
//PRINTFDEBUG ("Reading Temp...\n"); | ||
raw = tmp102_read_temp_raw(); | ||
|
||
absraw = raw; | ||
if (raw < 0) { // Perform 2C's if sensor returned negative data | ||
absraw = (raw ^ 0xFFFF) + 1; | ||
sign = -1; | ||
} | ||
tempint = (absraw >> 8) * sign; | ||
tempfrac = ((absraw>>4) % 16) * 625; // Info in 1/10000 of degree | ||
minus = ((tempint == 0) & (sign == -1)) ? '-' : ' ' ; | ||
PRINTF ("Current Temp = %c%d.%04d\n", minus, tempint, tempfrac); | ||
etimer_set(&et, LOOP_INTERVAL); | ||
|
||
|
||
|
||
char s[30]; | ||
sprintf(s,"Temp is %c%d.%04d\n", minus, tempint, tempfrac); | ||
printf("sending %s\n",s); | ||
packetbuf_copyfrom(s, 30); | ||
addr.u8[0] = RECEIVER; | ||
addr.u8[1] = 0; | ||
unicast_send(&uc, &addr); | ||
while(1) { | ||
PROCESS_YIELD(); | ||
if(ev == PROCESS_EVENT_TIMER) { | ||
printf("Broadcast --> %u\n", counter); | ||
leds_toggle(LEDS_RED); | ||
packetbuf_copyfrom(&counter, sizeof(counter)); | ||
broadcast_send(&bc); | ||
counter++; | ||
etimer_set(&et, LOOP_INTERVAL); | ||
} | ||
} | ||
|
||
PROCESS_END(); | ||
} | ||
/*---------------------------------------------------------------------------*/ | ||
/** | ||
* @} | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (c) 2007, Swedish Institute of Computer Science. | ||
* Copyright (c) 2015, Zolertia - http://www.zolertia.com | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
|
@@ -26,64 +26,36 @@ | |
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
* SUCH DAMAGE. | ||
* | ||
* This file is part of the Contiki operating system. | ||
* | ||
*/ | ||
|
||
/*---------------------------------------------------------------------------*/ | ||
/** | ||
* \addtogroup zoul-examples | ||
* @{ | ||
* | ||
* \defgroup remote-cc1200-demo RE-Mote CC1200 RF transceiver test | ||
* | ||
* Demonstrates the use of the TI CC1200 RF transceiver on Sub-1GHz | ||
* @{ | ||
* | ||
* \file | ||
* Best-effort single-hop unicast example | ||
* Configuration file for the cc1200 demo | ||
* | ||
* \author | ||
* Adam Dunkels <[email protected]> | ||
* Antonio Lignan <[email protected]> | ||
*/ | ||
#ifndef PROJECT_CONF_H_ | ||
#define PROJECT_CONF_H_ | ||
|
||
#include "contiki.h" | ||
#include "net/rime/rime.h" | ||
|
||
#include "dev/button-sensor.h" | ||
#undef NETSTACK_CONF_RADIO | ||
#define NETSTACK_CONF_RADIO cc1200_driver | ||
#define NETSTACK_CONF_RDC nullrdc_driver | ||
#define CC1200_CONF_USE_GPIO2 0 | ||
#define CC1200_CONF_USE_RX_WATCHDOG 0 | ||
#define ANTENNA_SW_SELECT_DEF_CONF ANTENNA_SW_SELECT_SUBGHZ | ||
|
||
#include "dev/leds.h" | ||
#endif /* PROJECT_CONF_H_ */ | ||
|
||
#include <stdio.h> | ||
|
||
/*---------------------------------------------------------------------------*/ | ||
PROCESS(example_unicast_process, "Example unicast"); | ||
AUTOSTART_PROCESSES(&example_unicast_process); | ||
/*---------------------------------------------------------------------------*/ | ||
static void | ||
recv_uc(struct unicast_conn *c, const linkaddr_t *from) | ||
{ | ||
printf("unicast message received from %d.%d\n", | ||
from->u8[0], from->u8[1]); | ||
} | ||
static const struct unicast_callbacks unicast_callbacks = {recv_uc}; | ||
static struct unicast_conn uc; | ||
/*---------------------------------------------------------------------------*/ | ||
PROCESS_THREAD(example_unicast_process, ev, data) | ||
{ | ||
PROCESS_EXITHANDLER(unicast_close(&uc);) | ||
|
||
PROCESS_BEGIN(); | ||
|
||
unicast_open(&uc, 199, &unicast_callbacks); | ||
|
||
while(1) { | ||
static struct etimer et; | ||
linkaddr_t addr; | ||
|
||
etimer_set(&et, CLOCK_SECOND); | ||
|
||
PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et)); | ||
|
||
//packetbuf_copyfrom("Enric Here!", 12); | ||
//addr.u8[0] = 200; | ||
//addr.u8[1] = 0; | ||
//if(!linkaddr_cmp(&addr, &linkaddr_node_addr)) { | ||
//unicast_send(&uc, &addr); | ||
//} | ||
|
||
} | ||
|
||
PROCESS_END(); | ||
} | ||
/*---------------------------------------------------------------------------*/ | ||
/** | ||
* @} | ||
* @} | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.