Commit graph

16 commits

Author SHA1 Message Date
Ralf Schlatterbeck d890a492bb Set arduino LOOP_INTERVAL in project-conf.h 2017-08-20 19:42:42 +02:00
Harald Pichler 16e6a20b31 add button function 2016-12-06 21:36:22 +01:00
Harald Pichler 0556557d8b remove unneeded code 2016-10-28 11:43:55 +02:00
Harald Pichler 5de29079ae bugfix switch netstack mode 2016-09-16 16:18:02 +02:00
Ralf Schlatterbeck 28cb276c70 Merge branch 'osd'
Conflicts:
	apps/arduino/arduino-process.c
	apps/arduino/arduino-process.h
	apps/json-resource/generic_resource.c
	apps/json-resource/generic_resource.h
	apps/time/Makefile.time
	apps/time/resource_gmtime.c
	apps/time/resource_timestamp.c
	apps/time/time.c
	apps/time/time_resource.h
	core/dev/leds.c
	core/lib/petsciiconv.c
	core/net/ip/resolv.c
	core/net/ip/slipdev.c
	core/net/ip/tcpip.c
	core/net/ipv4/uip.c
	core/net/ipv6/uip-ds6.c
	core/net/mac/contikimac/contikimac.c
	core/net/mac/frame802154.h
	core/net/mac/framer-802154.c
	core/net/mac/nullrdc.c
	core/net/rpl/rpl-dag.c
	core/net/rpl/rpl-ext-header.c
	core/net/rpl/rpl-icmp6.c
	core/net/rpl/rpl-mrhof.c
	core/net/rpl/rpl-of0.c
	core/net/rpl/rpl-timers.c
	core/net/rpl/rpl.c
	cpu/avr/Makefile.avr
	cpu/avr/dev/lanc111.c
	cpu/avr/radio/rf230bb/halbb.c
	dev/arduino/arduino-compat.h
	examples/osd/.gitignore
	examples/osd/arduino-dooralert/Makefile
	examples/osd/arduino-dooralert/flash.sh
	examples/osd/arduino-dooralert/run.sh
	examples/osd/arduino-dooralert/sketch.pde
	examples/osd/arduino-merkurboard/Makefile
	examples/osd/arduino-merkurboard/README.md
	examples/osd/arduino-merkurboard/flash.sh
	examples/osd/arduino-merkurboard/project-conf.h
	examples/osd/arduino-merkurboard/run.sh
	examples/osd/arduino-plantobserving/Makefile
	examples/osd/arduino-plantobserving/flash.sh
	examples/osd/arduino-plantobserving/project-conf.h
	examples/osd/arduino-plantobserving/run.sh
	examples/osd/arduino-plantobserving/sketch.pde
	examples/osd/arduino-roomalert/Makefile
	examples/osd/arduino-roomalert/flash.sh
	examples/osd/arduino-roomalert/run.sh
	examples/osd/arduino-roomalert/sketch.pde
	examples/osd/arduino-sketch/Makefile
	examples/osd/arduino-sketch/flash.sh
	examples/osd/arduino-sketch/led_pwm.h
	examples/osd/arduino-sketch/resource_led_pwm.c
	examples/osd/arduino-sketch/run.sh
	examples/osd/arduino-sketch/sketch.pde
	examples/osd/arduino-wateralert/Makefile
	examples/osd/arduino-wateralert/flash.sh
	examples/osd/arduino-wateralert/run.sh
	examples/osd/arduino-wateralert/sketch.pde
	examples/osd/climate/Makefile
	examples/osd/climate/er-example-server.c
	examples/osd/climate/flash.sh
	examples/osd/climate/project-conf.h
	examples/osd/climate/run.sh
	examples/osd/climate/server-only.csc
	examples/osd/climate2/Makefile
	examples/osd/climate2/er-example-server.c
	examples/osd/climate2/flash.sh
	examples/osd/climate2/project-conf.h
	examples/osd/climate2/run.sh
	examples/osd/climate2/server-only.csc
	examples/osd/dual-rgbw-actor/Makefile
	examples/osd/dual-rgbw-actor/flash.sh
	examples/osd/dual-rgbw-actor/run.sh
	examples/osd/dual-rgbw-actor/server-client.csc
	examples/osd/dual-rgbw-actor/server-only.csc
	examples/osd/embedd-vm-merkurboard/Makefile
	examples/osd/embedd-vm-merkurboard/embedd-vm-server.c
	examples/osd/embedd-vm-merkurboard/flash.sh
	examples/osd/embedd-vm-merkurboard/run.sh
	examples/osd/embedd-vm-merkurboard/server-only.csc
	examples/osd/er-rest-example-merkurboard/Makefile
	examples/osd/er-rest-example-merkurboard/README.md
	examples/osd/er-rest-example-merkurboard/er-example-client.c
	examples/osd/er-rest-example-merkurboard/er-example-server.c
	examples/osd/er-rest-example-merkurboard/er-plugtest-server.c
	examples/osd/er-rest-example-merkurboard/flash.sh
	examples/osd/er-rest-example-merkurboard/flashclient.sh
	examples/osd/er-rest-example-merkurboard/project-conf.h
	examples/osd/er-rest-example-merkurboard/run.sh
	examples/osd/er-rest-example-merkurboard/runclient.sh
	examples/osd/er-rest-example-merkurboard/server-client.csc
	examples/osd/light-actor/Makefile
	examples/osd/light-actor/er-example-server.c
	examples/osd/light-actor/flash.sh
	examples/osd/light-actor/pcintkey.c
	examples/osd/light-actor/project-conf.h
	examples/osd/light-actor/run.sh
	examples/osd/light-actor/server-only.csc
	examples/osd/light-shutter-control/Makefile
	examples/osd/light-shutter-control/flash.sh
	examples/osd/light-shutter-control/pcintkey.c
	examples/osd/light-shutter-control/run.sh
	examples/osd/light-shutter-control/server-only.csc
	examples/osd/merkurboard/Makefile
	examples/osd/merkurboard/README.md
	examples/osd/merkurboard/er-example-client.c
	examples/osd/merkurboard/er-example-server.c
	examples/osd/merkurboard/er-plugtest-server.c
	examples/osd/merkurboard/flash.sh
	examples/osd/merkurboard/flashclient.sh
	examples/osd/merkurboard/project-conf.h
	examples/osd/merkurboard/run.sh
	examples/osd/merkurboard/runclient.sh
	examples/osd/native-border-router/Makefile
	examples/osd/native-border-router/border-router-cmds.c
	examples/osd/native-border-router/border-router-cmds.h
	examples/osd/native-border-router/border-router-rdc.c
	examples/osd/native-border-router/border-router.c
	examples/osd/native-border-router/border-router.h
	examples/osd/native-border-router/project-conf.h
	examples/osd/native-border-router/slip-config.c
	examples/osd/native-border-router/slip-dev.c
	examples/osd/native-border-router/tun-bridge.c
	examples/osd/pingtheplug/Makefile
	examples/osd/pingtheplug/er-example-server.c
	examples/osd/pingtheplug/flash.sh
	examples/osd/pingtheplug/pcintkey.c
	examples/osd/pingtheplug/run.sh
	examples/osd/pingtheplug/server-only.csc
	examples/osd/pir-sensor/Makefile
	examples/osd/pir-sensor/flash.sh
	examples/osd/pir-sensor/run.sh
	examples/osd/pir-sensor/server-client.csc
	examples/osd/pir-sensor/server-only.csc
	examples/osd/powerbox/Makefile
	examples/osd/powerbox/er-example-server.c
	examples/osd/powerbox/flash.sh
	examples/osd/powerbox/run.sh
	examples/osd/powerbox/server-only.csc
	examples/osd/pwm-example/Makefile
	examples/osd/pwm-example/er-example-server.c
	examples/osd/pwm-example/flash.sh
	examples/osd/pwm-example/led_pwm.h
	examples/osd/pwm-example/resource_led_pwm.c
	examples/osd/pwm-example/run.sh
	examples/osd/rpl-border-router/Makefile
	examples/osd/rpl-border-router/border-router.c
	examples/osd/rpl-border-router/flash.sh
	examples/osd/rpl-border-router/project-conf.h
	examples/osd/rpl-border-router/run.sh
	examples/osd/rpl-border-router/slip-bridge.c
	examples/osd/runall.sh
	examples/osd/servo-sensor/Makefile
	examples/osd/servo-sensor/er-example-server.c
	examples/osd/servo-sensor/flash.sh
	examples/osd/servo-sensor/project-conf.h
	examples/osd/servo-sensor/run.sh
	examples/osd/servo-sensor/server-client.csc
	examples/osd/servo-sensor/server-only.csc
	examples/osd/slip-radio/Makefile
	examples/osd/slip-radio/flash.sh
	examples/osd/slip-radio/no-framer.c
	examples/osd/slip-radio/project-conf.h
	examples/osd/slip-radio/run.sh
	examples/osd/slip-radio/slip-net.c
	examples/osd/slip-radio/slip-radio-cc2420.c
	examples/osd/slip-radio/slip-radio-sky-sensors.c
	examples/osd/slip-radio/slip-radio.c
	examples/osd/slip-radio/slip-radio.h
	examples/osd/wallclock-time/Makefile
	examples/osd/wallclock-time/flash.sh
	examples/osd/wallclock-time/run.sh
	examples/osd/wirelessplug/Makefile
	examples/osd/wirelessplug/flash.sh
	examples/osd/wirelessplug/run.sh
	examples/osd/wirelessplug/server-client.csc
	examples/osd/wirelessplug/server-only.csc
	platform/avr-atmega128rfa1/apps/raven-lcd-interface/raven-lcd.c
	platform/avr-raven/apps/raven-lcd-interface/raven-lcd.c
	tools/tunslip6.c
2016-08-12 22:04:56 +02:00
Harald Pichler 8402b1c151 initial upload, add button 2016-08-03 21:58:02 +02:00
harald42 9a3c6adf8d add mcu_sleep routines 2016-04-12 10:34:40 +02:00
Harald Pichler df95393980 remove init pwm per default, switch moisture sensor on and off to save energy 2014-12-12 08:47:01 +01:00
Ralf Schlatterbeck ef06560465 Use PROCESS_PAUSE macro 2014-11-19 13:54:07 +01:00
Ralf Schlatterbeck abdf6f8c6b Refactor A/D conversion in adc.c
Now the necessary settings are in adc.h. Refactored to allow repeated
ADC reads without reinitialization. Arduino allows setting
analogReference, this is now also implemented.
ADC is now initialized to sane values in apps/arduino/arduino-process.c
dev/arduino/arduino-compat.h now has all hardware independent settings
for arduino (some moved from platform/osd-merkur/dev/hw-arduino.h).
turnOffPWM re-implemented with hw_timer, removed from wiring_digital.c
ADC-specific arduino stuff moved to arduino-compat.h
Arduinos wiring_analog no longer necessary.
arduino-sketch example now reads analog inputs 1 and 5 using analogRead.
2014-11-19 13:53:32 +01:00
Ralf Schlatterbeck c46d6afa39 Make Arduino timer stuff work on Contiki
New discovery: Contiki also uses timer 0. With almost the same interface
as Arduino. So we now completely get rid of wiring.c (only the main
file, the other wiring_xxx stay) and implement Arduino timer, delay, etc
in terms of the corresponding Contiki routines. Verified that now delay
works as expected. The LED in examples/osd/arduino-sketch blinks!

Before this, the arduino_init routine in wiring.c destroyed the timer-0
initialization of contiki, making both, contiki timer implementation
*and* contiki timer implementation fail if the arduino_init routine was
called. Now both work.

Squashed with following bug-fix commit.
2014-11-19 13:50:58 +01:00
Ralf Schlatterbeck b6be226e69 Add Arduino compatibility layer
We can now directly compile arduino sketches (.pde) files.
Arduino compatible analogWrite works now.
But there is still a long way to go, serial I/O and timer stuff (delay,
millis etc) currently don't work (not tested but I don't expect this to
work).
It can be used in an arduino sketch or in a normal contiki program.
We get a PWM frequency of 490.2 Hz (a period of 2.040 ms), that's
Arduino compatible. If you need different frequencies see native timer
usage in examples/osd/pwm-example
In a contiki program you have to call arduino_pwm_timer_init to
initialize the timer before pwm works. The arduino sketch wrapper
already does this.
For running a sketch, see examples/osd/arduino-sketch
2014-11-19 13:48:05 +01:00
Ralf Schlatterbeck f61d0b2e1e Use PROCESS_PAUSE macro 2014-06-30 10:25:47 +02:00
Ralf Schlatterbeck 77c02d58f8 Refactor A/D conversion in adc.c
Now the necessary settings are in adc.h. Refactored to allow repeated
ADC reads without reinitialization. Arduino allows setting
analogReference, this is now also implemented.
ADC is now initialized to sane values in apps/arduino/arduino-process.c
dev/arduino/arduino-compat.h now has all hardware independent settings
for arduino (some moved from platform/osd-merkur/dev/hw-arduino.h).
turnOffPWM re-implemented with hw_timer, removed from wiring_digital.c
ADC-specific arduino stuff moved to arduino-compat.h
Arduinos wiring_analog no longer necessary.
arduino-sketch example now reads analog inputs 1 and 5 using analogRead.
2014-06-29 17:26:15 +02:00
Ralf Schlatterbeck f0f5391409 Make Arduino timer stuff work on Contiki
New discovery: Contiki also uses timer 0. With almost the same interface
as Arduino. So we now completely get rid of wiring.c (only the main
file, the other wiring_xxx stay) and implement Arduino timer, delay, etc
in terms of the corresponding Contiki routines. Verified that now delay
works as expected. The LED in examples/osd/arduino-sketch blinks!

Before this, the arduino_init routine in wiring.c destroyed the timer-0
initialization of contiki, making both, contiki timer implementation
*and* contiki timer implementation fail if the arduino_init routine was
called. Now both work.
2014-06-26 18:37:13 +02:00
Ralf Schlatterbeck e65dabb119 Add Arduino compatibility layer
We can now directly compile arduino sketches (.pde) files.
Arduino compatible analogWrite works now.
But there is still a long way to go, serial I/O and timer stuff (delay,
millis etc) currently don't work (not tested but I don't expect this to
work).
It can be used in an arduino sketch or in a normal contiki program.
We get a PWM frequency of 490.2 Hz (a period of 2.040 ms), that's
Arduino compatible. If you need different frequencies see native timer
usage in examples/osd/pwm-example
In a contiki program you have to call arduino_pwm_timer_init to
initialize the timer before pwm works. The arduino sketch wrapper
already does this.
For running a sketch, see examples/osd/arduino-sketch
2014-06-26 11:00:01 +02:00