Skip to content

Commit b9a6bff

Browse files
committed
added a proper board support verification
1 parent 92adf3b commit b9a6bff

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/Servo_Hardware_PWM.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
For information about the library, license and author, see Servo_Hardware_PWM.h - file.
33
*/
44

5-
#if defined(ARDUINO_ARCH_AVR)
5+
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
66

77
#include <Arduino.h>
88
#include <Servo_Hardware_PWM.h>

src/Servo_Hardware_PWM.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,13 @@
6767

6868
#include <inttypes.h>
6969

70-
#if !defined(ARDUINO_ARCH_AVR)
71-
#error "This library only supports boards with an AVR processor."
70+
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
71+
#warning "INFO: Servos can only be connected to the following pins: 2, 3, 7, 8, 44, and 45"
72+
#else
73+
#error "ERROR: This library only supports boards with an ATmega1280 or ATmega2560 processor. (Arduino/Genuino Mega/Mega1280/Mega2560)"
7274
#endif
7375

74-
#define Servo_VERSION 1.0.1 //software version of this library
76+
#define Servo_VERSION 1.2.0 //software version of this library
7577

7678
#define MIN_PULSE_WIDTH 500 //the shortest pulse sent to a servo
7779
#define MAX_PULSE_WIDTH 2500 //the longest pulse sent to a servo

0 commit comments

Comments
 (0)