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.
This commit is contained in:
parent
08abd8807d
commit
c46d6afa39
7 changed files with 61 additions and 273 deletions
|
@ -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 ();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue