diff options
author | Christian Pointner <equinox@spreadspace.org> | 2013-06-25 00:48:44 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2013-06-25 00:48:44 +0200 |
commit | d421e4359d31603e39bdedeaedac5cb11a014add (patch) | |
tree | bcee484371cd22ab52ccb9ec2d8f7493fd457cfc | |
parent | added inital dustmap-node sourcecode (diff) |
serial shell and hearteat thread
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | software/dustmap-node/Makefile | 16 | ||||
-rw-r--r-- | software/dustmap-node/dustmap-node.c | 60 |
3 files changed, 67 insertions, 12 deletions
@@ -3,3 +3,6 @@ hardware/*/*-cache.lib hardware/*/$savepcb.brd hardware/*/*.000 contrib/contiki-2.6/ +software/dustmap-node/contiki-avr-zigbit.* +software/dustmap-node/dustmap-node.avr-zigbit* +software/dustmap-node/obj_avr-zigbit/ diff --git a/software/dustmap-node/Makefile b/software/dustmap-node/Makefile index e152d62..a511bd9 100644 --- a/software/dustmap-node/Makefile +++ b/software/dustmap-node/Makefile @@ -1,9 +1,23 @@ CONTIKI_PROJECT = dustmap-node all: $(CONTIKI_PROJECT) -APPS = telnetd program-handler +APPS = serial-shell WITH_UIP=1 +UIP_CONF_IPV6=1 +UIP_CONF_RPL=1 +#DEFINES=UIP_CONF_ROUTER=1 CONTIKI = ../../contrib/contiki-2.6 include $(CONTIKI)/Makefile.include + +hexfile = $(CONTIKI_PROJECT).$(TARGET).hex +eepfile = $(CONTIKI_PROJECT).$(TARGET).eep + +download: $(hexfile) $(eepfile) + @avrdude -c avrispmkII -P usb -p $(MCU) -U eeprom:w:$(eepfile) -U flash:w:$(hexfile) + +distclean: clean + @rm -f $(hexfile) + @rm -f $(eepfile) + @rm -f $(CONTIKI_PROJECT).$(TARGET)
\ No newline at end of file diff --git a/software/dustmap-node/dustmap-node.c b/software/dustmap-node/dustmap-node.c index 3c3a649..1d46607 100644 --- a/software/dustmap-node/dustmap-node.c +++ b/software/dustmap-node/dustmap-node.c @@ -20,28 +20,66 @@ * along with dustmap-node. If not, see <http://www.gnu.org/licenses/>. */ -#include "contiki-net.h" -#include "telnetd.h" +#include "contiki.h" +#include <stdio.h> + +#include "serial-shell.h" #include "shell.h" + /*---------------------------------------------------------------------------*/ -PROCESS(shell_init_process, "Shell init process"); +PROCESS(hello_world_process, "Hello world process"); +PROCESS_THREAD(hello_world_process, ev, data) +{ + PROCESS_BEGIN(); + + printf("Hello, world\n"); + + PROCESS_END(); +} +/*---------------------------------------------------------------------------*/ + + /*---------------------------------------------------------------------------*/ +static struct etimer et; +PROCESS(heartbeat_process, "heartbeat process"); +PROCESS_THREAD(heartbeat_process, ev, data) +{ + PROCESS_BEGIN(); + + DDRE |= (1<<PE2); + PORTE &= ~(1<<PE2); + etimer_set(&et, 12); + + for(;;) { + PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et)); + etimer_reset(&et); + PORTE ^= (1<<PE2); + } + + PROCESS_END(); +} +/*---------------------------------------------------------------------------*/ + + +/*---------------------------------------------------------------------------*/ +PROCESS(shell_init_process, "Shell init process"); PROCESS_THREAD(shell_init_process, ev, data) { PROCESS_BEGIN(); - shell_file_init(); - shell_httpd_init(); - shell_irc_init(); - shell_ps_init(); - shell_run_init(); + serial_shell_init(); + shell_text_init(); shell_time_init(); - shell_wget_init(); + shell_ps_init(); + shell_power_init(); + shell_netstat_init(); + shell_ping_init(); + shell_udpsend_init(); PROCESS_END(); } /*---------------------------------------------------------------------------*/ -AUTOSTART_PROCESSES(&telnetd_process, &shell_init_process); -/*---------------------------------------------------------------------------*/ + +AUTOSTART_PROCESSES(&hello_world_process, &heartbeat_process, &shell_init_process); |