From cd050d05d1fa7ae87da68574a9e50edf6ac1ed8f Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Sat, 12 Feb 2011 14:47:08 -0500 Subject: Adding noAnalogWrite() function to disable PWM. Also, removing the inline version of digitalPinToTimer() (since we're not optimizing the functions that use it anyway). The noAnalogWrite() function is in wiring_analog.c, deriving from the previous turnOffPWM() which has moved from wiring_digital.c. http://code.google.com/p/arduino/issues/detail?id=476 --- cores/arduino/wiring.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'cores/arduino/wiring.h') diff --git a/cores/arduino/wiring.h b/cores/arduino/wiring.h index 66ce2f7..2915b63 100755 --- a/cores/arduino/wiring.h +++ b/cores/arduino/wiring.h @@ -114,6 +114,7 @@ int digitalRead_lookup(uint8_t); int analogRead(uint8_t); void analogReference(uint8_t mode); void analogWrite(uint8_t, int); +void noAnalogWrite(uint8_t); unsigned long millis(void); unsigned long micros(void); @@ -145,10 +146,7 @@ INLINED uint8_t digitalPinToBitMask(uint8_t pin) { } INLINED uint8_t digitalPinToTimer(uint8_t pin) { - if (__builtin_constant_p(pin)) - return inlined_digitalPinToTimer(pin); - else - return pgm_read_byte( digital_pin_to_timer_PGM + pin ); + return pgm_read_byte( digital_pin_to_timer_PGM + pin ); } INLINED volatile uint8_t *portOutputRegister(uint8_t index) { -- cgit v1.2.3-18-g5258