@@ -347,7 +347,7 @@ bool PulseSensorPlayground::setupInterrupt(){
347
347
#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega16U4__)
348
348
349
349
// check to see if the Servo library is in use
350
- #if defined Servo_h
350
+ #if __has_include (<Servo.h>)
351
351
// Initializes Timer2 to throw an interrupt every 2mS
352
352
// Interferes with PWM on pins 3 and 11
353
353
#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__)
@@ -396,7 +396,7 @@ bool PulseSensorPlayground::setupInterrupt(){
396
396
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
397
397
398
398
// check to see if the Servo library is in use
399
- #if defined Servo_h
399
+ #if __has_include (<Servo.h>)
400
400
// Initializes Timer1 to throw an interrupt every 2mS.
401
401
// Interferes with PWM on pins 9 and 10
402
402
TCCR1A = 0x00 ; // Disable PWM and go into CTC mode
@@ -519,7 +519,7 @@ bool PulseSensorPlayground::enableInterrupt(){
519
519
#if USE_HARDWARE_TIMER
520
520
#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega16U4__)
521
521
// check to see if the Servo library is in use
522
- #if defined Servo_h
522
+ #if __has_include (<Servo.h>)
523
523
#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__)
524
524
DISABLE_PULSE_SENSOR_INTERRUPTS;
525
525
TIMSK2 = 0x02 ; // Enable OCR2A match interrupt
@@ -541,7 +541,7 @@ bool PulseSensorPlayground::enableInterrupt(){
541
541
542
542
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
543
543
// check to see if the Servo library is in use
544
- #if defined Servo_h
544
+ #if __has_include (<Servo.h>)
545
545
DISABLE_PULSE_SENSOR_INTERRUPTS;
546
546
TIMSK1 = 0x02 ; // Enable OCR1A match interrupt
547
547
ENABLE_PULSE_SENSOR_INTERRUPTS;
@@ -602,7 +602,7 @@ bool PulseSensorPlayground::disableInterrupt(){
602
602
#if USE_HARDWARE_TIMER
603
603
#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega16U4__)
604
604
// check to see if the Servo library is in use
605
- #if defined Servo_h
605
+ #if __has_include (<Servo.h>)
606
606
#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__)
607
607
DISABLE_PULSE_SENSOR_INTERRUPTS;
608
608
TIMSK2 = 0x00 ; // Disable OCR2A match interrupt
@@ -624,7 +624,7 @@ bool PulseSensorPlayground::disableInterrupt(){
624
624
625
625
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
626
626
// check to see if the Servo library is in use
627
- #if defined Servo_h
627
+ #if __has_include (<Servo.h>)
628
628
DISABLE_PULSE_SENSOR_INTERRUPTS;
629
629
TIMSK1 = 0x00 ; // Disable OCR1A match interrupt
630
630
ENABLE_PULSE_SENSOR_INTERRUPTS;
0 commit comments