From a6b744fe3cfb58eb36220991df7c28c0ed9b2b53 Mon Sep 17 00:00:00 2001 From: ichbtm <7622549+ichbtm@users.noreply.github.com> Date: Fri, 30 Mar 2018 17:02:01 +0200 Subject: [PATCH] added named constants and removed hoardcoded pulse cycle limits --- libraries/Servo/src/nrf52/ServoTimers.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libraries/Servo/src/nrf52/ServoTimers.h b/libraries/Servo/src/nrf52/ServoTimers.h index 51759bea..ce6c7de6 100644 --- a/libraries/Servo/src/nrf52/ServoTimers.h +++ b/libraries/Servo/src/nrf52/ServoTimers.h @@ -28,11 +28,14 @@ * NRF52 Only definitions * --------------------- */ - -#define MIN_PULSE 55 -#define MAX_PULSE 284 +//PWM_PRESCALER_PRESCALER_DIV_128 -> NRF_PWM_CLK_125kHz -> resolution 8µs +//MaxValue = 2500 -> PWM period = 20ms +//20ms - 50Hz +#define DUTY_CYCLE_RESOLUTION 8 +#define MAXVALUE 2500 +#define CLOCKDIV PWM_PRESCALER_PRESCALER_DIV_128 // define one timer in order to have MAX_SERVOS = 12 typedef enum { _timer1, _Nbr_16timers } timer16_Sequence_t; -#endif // __SERVO_TIMERS_H__ \ No newline at end of file +#endif // __SERVO_TIMERS_H__