diff --git a/cores/nRF5/Arduino.h b/cores/nRF5/Arduino.h index 96c197e9..286afc76 100644 --- a/cores/nRF5/Arduino.h +++ b/cores/nRF5/Arduino.h @@ -51,6 +51,7 @@ uint32_t setLoopStacksize(void); #include "WMath.h" #include "HardwareSerial.h" #include "pulse.h" + #include "HardwarePWM.h" #endif #include "delay.h" diff --git a/cores/nRF5/HardwarePWM.cpp b/cores/nRF5/HardwarePWM.cpp index f73ee9ab..a866b55a 100644 --- a/cores/nRF5/HardwarePWM.cpp +++ b/cores/nRF5/HardwarePWM.cpp @@ -34,6 +34,7 @@ */ /**************************************************************************/ +#include "Arduino.h" #include "HardwarePWM.h" HardwarePWM PWM0(NRF_PWM0); diff --git a/cores/nRF5/HardwarePWM.h b/cores/nRF5/HardwarePWM.h index ae9955fa..298c205a 100644 --- a/cores/nRF5/HardwarePWM.h +++ b/cores/nRF5/HardwarePWM.h @@ -36,7 +36,7 @@ #ifndef HARDWAREPWM_H_ #define HARDWAREPWM_H_ -#include "Arduino.h" +#include "common_inc.h" #include "nrf.h" class HardwarePWM diff --git a/cores/nRF5/common_inc.h b/cores/nRF5/common_inc.h index dca46ced..ae2bcad2 100644 --- a/cores/nRF5/common_inc.h +++ b/cores/nRF5/common_inc.h @@ -36,6 +36,9 @@ #ifndef COMMON_INC_H_ #define COMMON_INC_H_ +#include +#include + #include "compiler_macro.h" #include "verify.h" #include "common_func.h" diff --git a/libraries/Bluefruit52Lib/examples/Hardware/hwpwm/hwpwm.ino b/libraries/Bluefruit52Lib/examples/Hardware/hwpwm/hwpwm.ino index 5f933486..4dff82fa 100644 --- a/libraries/Bluefruit52Lib/examples/Hardware/hwpwm/hwpwm.ino +++ b/libraries/Bluefruit52Lib/examples/Hardware/hwpwm/hwpwm.ino @@ -78,7 +78,7 @@ void loop() // fade in from min to max // inverted PWM0 (false), PWM1 (true), PWM2 (false) - for (int fadeValue = 0 ; fadeValue <= maxValue; fadeValue += 512) + for (int fadeValue = 0 ; fadeValue <= maxValue; fadeValue += 1024) { inverted = false; @@ -96,7 +96,7 @@ void loop() // fade out from max to min // inverted PWM0 (false), PWM1 (true), PWM2 (false) - for (int fadeValue = maxValue ; fadeValue >= 0; fadeValue -= 512) + for (int fadeValue = maxValue ; fadeValue >= 0; fadeValue -= 1024) { inverted = false;