mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-17 22:23:10 +03:00
Servo library refactoring. See #1617
This commit is contained in:
@ -20,7 +20,8 @@
|
|||||||
#include <avr/interrupt.h>
|
#include <avr/interrupt.h>
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
#include "Servo.h"
|
#include <Servo.h>
|
||||||
|
#include "ServoTimers.h"
|
||||||
|
|
||||||
#define usToTicks(_us) (( clockCyclesPerMicrosecond()* _us) / 8) // converts microseconds to tick (assumes prescale of 8) // 12 Aug 2009
|
#define usToTicks(_us) (( clockCyclesPerMicrosecond()* _us) / 8) // converts microseconds to tick (assumes prescale of 8) // 12 Aug 2009
|
||||||
#define ticksToUs(_ticks) (( (unsigned)_ticks * 8)/ clockCyclesPerMicrosecond() ) // converts from ticks back to microseconds
|
#define ticksToUs(_ticks) (( (unsigned)_ticks * 8)/ clockCyclesPerMicrosecond() ) // converts from ticks back to microseconds
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include <Servo.h>
|
#include <Servo.h>
|
||||||
|
#include "ServoTimers.h"
|
||||||
|
|
||||||
#define usToTicks(_us) (( clockCyclesPerMicrosecond() * _us) / 32) // converts microseconds to tick
|
#define usToTicks(_us) (( clockCyclesPerMicrosecond() * _us) / 32) // converts microseconds to tick
|
||||||
#define ticksToUs(_ticks) (( (unsigned)_ticks * 32)/ clockCyclesPerMicrosecond() ) // converts from ticks back to microseconds
|
#define ticksToUs(_ticks) (( (unsigned)_ticks * 32)/ clockCyclesPerMicrosecond() ) // converts from ticks back to microseconds
|
||||||
|
@ -58,9 +58,6 @@
|
|||||||
* _Nbr_16timers indicates how many 16 bit timers are available.
|
* _Nbr_16timers indicates how many 16 bit timers are available.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Architecture specific include
|
|
||||||
#include <ServoTimers.h>
|
|
||||||
|
|
||||||
#define Servo_VERSION 2 // software version of this library
|
#define Servo_VERSION 2 // software version of this library
|
||||||
|
|
||||||
#define MIN_PULSE_WIDTH 544 // the shortest pulse sent to a servo
|
#define MIN_PULSE_WIDTH 544 // the shortest pulse sent to a servo
|
||||||
|
Reference in New Issue
Block a user