c46d6afa39
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. |
||
---|---|---|
.. | ||
arduino-example.c | ||
flash.sh | ||
led_pwm.h | ||
Makefile | ||
project-conf.h | ||
README.md | ||
resource_led_pwm.c | ||
run.sh | ||
sketch.pde |
Arduino compatibility example
This example shows that it is now possible to re-use arduino sketches in
Contiki. This example documents the necessary magic. Arduino specifies
two routines, setup
and loop
. Before setup
is called, the
framework initializes hardware. In original Arduino, all this is done in
a main
function (in C). For contiki we define a process that does the
same.
See the documentation file in apps/contiki-compat/README.md