35#include "dev/button-sensor.h"
37#include "dev/etc/ds2411/ds2411.h"
42#include "dev/watchdog.h"
44#include "lib/random.h"
49#if NETSTACK_CONF_WITH_IPV6
57#if DCOSYNCH_CONF_ENABLED
58static struct timer mgt_timer;
60extern int msp430_dco_required;
62#define UIP_OVER_MESH_CHANNEL 8
64#ifdef EXPERIMENT_SETUP
65#include "experiment-setup.h"
68SENSORS(&button_sensor);
73#define LOG_MODULE "Sky"
74#define LOG_LEVEL LOG_LEVEL_MAIN
78force_float_inclusion()
81 extern int __floatsisf;
85 return __fixsfsi + __floatsisf + __mulsf3 + __subsf3;
94force_inclusion(
int d1,
int d2)
96 snprintf(NULL, 0,
"%d", d1 % d2);
105 memset(&
addr, 0,
sizeof(linkaddr_t));
106#if NETSTACK_CONF_WITH_IPV6
107 memcpy(
addr.u8, ds2411_id,
sizeof(
addr.u8));
110 for(i = 0; i <
sizeof(linkaddr_t); ++i) {
111 addr.u8[i] = ds2411_id[7 - i];
140 ds2411_id[2] &= 0xfe;
174 memset(longaddr, 0,
sizeof(longaddr));
177 cc2420_set_pan_addr(IEEE802154_PANID, shortaddr, longaddr);
179 LOG_INFO(
"CC2420 CCA threshold %i\n", CC2420_CONF_CCA_THRESH);
181#if !NETSTACK_CONF_WITH_IPV6
182 uart1_set_input(serial_line_input_byte);
186 leds_off(LEDS_GREEN);
188#if TIMESYNCH_CONF_ENABLED
196#if DCOSYNCH_CONF_ENABLED
212#if DCOSYNCH_CONF_ENABLED
218#if CC2420_CONF_SFD_TIMESTAMPS
219 cc2420_arch_sfd_init();
225 ENERGEST_SWITCH(ENERGEST_TYPE_CPU, ENERGEST_TYPE_LPM);
228 if (msp430_dco_required) {
229 _BIS_SR(GIE | CPUOFF);
231 _BIS_SR(GIE | SCG0 | SCG1 | CPUOFF);
239 ENERGEST_SWITCH(ENERGEST_TYPE_LPM, ENERGEST_TYPE_CPU);
CC2420 driver header file.
Header for the Coffee file system.
Header file for the energy estimation mechanism.
802.15.4 frame creation and parsing functions
void random_init(unsigned short seed)
Seed the cc2538 random number generator.
void watchdog_start(void)
Starts the WDT in watchdog mode if enabled by user configuration, maximum interval.
void watchdog_periodic(void)
Writes the WDT clear sequence.
void platform_init_stage_three()
Final stage of platform driver initialisation.
void platform_init_stage_one(void)
Basic (Stage 1) platform driver initialisation.
void platform_idle()
The platform's idle/sleep function.
void platform_init_stage_two()
Stage 2 of platform driver initialisation.
void watchdog_stop(void)
Stops the WDT such that it won't timeout and cause MCU reset.
#define CLOCK_SECOND
A second, measured in system clock time.
void leds_init(void)
Initialise the LED HAL.
linkaddr_t linkaddr_node_addr
The link-layer address of the node.
void linkaddr_copy(linkaddr_t *dest, const linkaddr_t *src)
Copy a link-layer address.
static void linkaddr_set_node_addr(linkaddr_t *addr)
Set the address of the current node.
void process_start(struct process *p, process_data_t data)
Start a process.
process_num_events_t process_nevents(void)
Number of events waiting to be processed.
void timer_set(struct timer *t, clock_time_t interval)
Set a timer.
bool timer_expired(struct timer *t)
Check if a timer has expired.
void timer_reset(struct timer *t)
Reset the timer with the same interval.
void xmem_init(void)
Initialize the external memory.
Header file for the LED HAL.
Header file for the logging system.
Include file for the Contiki low-layer network stack (NETSTACK)
Node-id (simple 16-bit identifiers) handling.
Generic serial I/O process header filer.
Main API declarations for TSCH.
A brief description of what this file is.
void uart1_init(unsigned long ubr)
Initalize the RS232 port.
Header file for IPv6-related data structures.
static uip_ds6_addr_t * addr
Pointer to a nbr cache entry.
Header file to the external flash memory (XMem) API.