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.
This commit is contained in:
Ralf Schlatterbeck 2014-06-26 18:37:13 +02:00
parent b6e20bf6c0
commit f0f5391409
7 changed files with 60 additions and 273 deletions

View file

@ -50,6 +50,8 @@
*/
#include "arduino-process.h"
#include "hw_timer.h"
#include "hw-arduino.h"
PROCESS(arduino_sketch, "Arduino Sketch Wrapper");
@ -57,7 +59,7 @@ PROCESS_THREAD(arduino_sketch, ev, data)
{
PROCESS_BEGIN();
arduino_init ();
arduino_pwm_timer_init ();
setup ();
while (1) {
loop ();