40 #include "dev/watchdog.h"
42 #include "net/uip-driver.h"
57 #ifdef DCOSYNCH_CONF_PERIOD
58 #define DCOSYNCH_PERIOD DCOSYNCH_CONF_PERIOD
60 #define DCOSYNCH_PERIOD 30
63 #ifdef DCOSYNCH_CONF_ENABLED
64 #define DCOSYNCH_ENABLED DCOSYNCH_CONF_ENABLED
66 #define DCOSYNCH_ENABLED 0
70 static struct timer dco_timer;
73 SENSORS(&button_sensor, &sound_sensor, &vib_sensor,
74 &pir_sensor, &radio_sensor, &battery_sensor, &ctsrts_sensor,
84 rimeaddr.u8[0] = node_id & 0xff;
85 rimeaddr.u8[1] = node_id >> 8;
88 printf(
"Rime started with address ");
89 for(i = 0; i <
sizeof(rimeaddr.u8) - 1; i++) {
90 printf(
"%u.", rimeaddr.u8[i]);
92 printf(
"%u\n", rimeaddr.u8[i]);
113 uip_ipaddr(&hostaddr, 172, 16, 1, node_id & 0xff);
126 print_processes(
struct process *
const processes[])
129 while(*processes !=
NULL) {
130 printf(
" '%s'", (*processes)->name);
137 static void init_ports_toberemoved() {
178 init_ports_toberemoved();
199 printf(CONTIKI_VERSION_STRING
" started. ");
201 printf(
"Node id is set to %u.\n", node_id);
203 printf(
"Node id is not set.\n");
208 printf(
"%s %s, channel check rate %lu Hz\n",
209 NETSTACK_MAC.name, NETSTACK_RDC.name,
210 CLOCK_SECOND / (NETSTACK_RDC.channel_check_interval() == 0 ? 1:
211 NETSTACK_RDC.channel_check_interval()));
233 ENERGEST_ON(ENERGEST_TYPE_CPU);
237 print_processes(autostart_processes);
238 autostart_start(autostart_processes);
251 profile_episode_start();
259 profile_episode_end();
270 static unsigned long irq_energest = 0;
273 #if DCOSYNCH_CONF_ENABLED
283 ENERGEST_OFF(ENERGEST_TYPE_CPU);
284 ENERGEST_ON(ENERGEST_TYPE_LPM);
289 energest_type_set(ENERGEST_TYPE_IRQ, irq_energest);
293 _BIS_SR(GIE | SCG0 | CPUOFF);
299 irq_energest = energest_type_time(ENERGEST_TYPE_IRQ);
301 ENERGEST_OFF(ENERGEST_TYPE_LPM);
302 ENERGEST_ON(ENERGEST_TYPE_CPU);
320 printf(
"uIP log: '%s'\n", m);