From 60156d1c48b821a176c1b9a1936dfe4f2fb11346 Mon Sep 17 00:00:00 2001 From: Ralf Schlatterbeck Date: Sun, 29 Jun 2014 18:06:48 +0200 Subject: [PATCH] Fix off-by-one error in digitalPinToTimer --- examples/osd/arduino-sketch/sketch.pde | 2 +- platform/osd-merkur/dev/hw-arduino.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/osd/arduino-sketch/sketch.pde b/examples/osd/arduino-sketch/sketch.pde index 13da7e6bb..ef47d4271 100644 --- a/examples/osd/arduino-sketch/sketch.pde +++ b/examples/osd/arduino-sketch/sketch.pde @@ -13,7 +13,7 @@ extern "C" { #include #include "led_pwm.h" -#define LED_PIN 5 +#define LED_PIN 4 uint8_t pwm = 128; uint8_t period_100ms = 10; /* one second */ diff --git a/platform/osd-merkur/dev/hw-arduino.h b/platform/osd-merkur/dev/hw-arduino.h index 1894d23cc..bcd626ec6 100644 --- a/platform/osd-merkur/dev/hw-arduino.h +++ b/platform/osd-merkur/dev/hw-arduino.h @@ -59,11 +59,11 @@ extern "C"{ * contiki for sleep/wakeup timing and is not usable for PWM. */ #define digitalPinToTimer(pin) \ - ( (pin) == 3 \ + ( (pin) == 2 \ ? TIMER3A \ - : ( (pin) == 4 \ + : ( (pin) == 3 \ ? TIMER3B \ - : ((pin == 5) ? TIMER3C : NOT_ON_TIMER) \ + : ((pin == 4) ? TIMER3C : NOT_ON_TIMER) \ ) \ )