Skip to content

Commit

Permalink
Fix Arduino CLI/IDE build with Servos
Browse files Browse the repository at this point in the history
  • Loading branch information
peteGSX committed Aug 1, 2023
1 parent ac97783 commit 4829dcc
Show file tree
Hide file tree
Showing 17 changed files with 15 additions and 15 deletions.
16 changes: 8 additions & 8 deletions Servo.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,21 @@

// Architecture specific include
#if defined(ARDUINO_ARCH_AVR)
#include "avr/ServoTimers.h"
#include "src/avr/ServoTimers.h"
#elif defined(ARDUINO_ARCH_SAM)
#include "sam/ServoTimers.h"
#include "src/sam/ServoTimers.h"
#elif defined(ARDUINO_ARCH_SAMD)
#include "samd/ServoTimers.h"
#include "src/samd/ServoTimers.h"
#elif defined(ARDUINO_ARCH_STM32F4)
#include "stm32f4/ServoTimers.h"
#include "src/stm32f4/ServoTimers.h"
#elif defined(ARDUINO_ARCH_NRF52)
#include "nrf52/ServoTimers.h"
#include "src/nrf52/ServoTimers.h"
#elif defined(ARDUINO_ARCH_MEGAAVR)
#include "megaavr/ServoTimers.h"
#include "src/megaavr/ServoTimers.h"
#elif defined(ARDUINO_ARCH_MBED)
#include "mbed/ServoTimers.h"
#include "src/mbed/ServoTimers.h"
#elif defined(ARDUINO_ARCH_RENESAS)
#include "renesas/ServoTimers.h"
#include "src/renesas/ServoTimers.h"
#else
#error "This library only supports boards with an AVR, SAM, SAMD, NRF52 or STM32F4 processor."
#endif
Expand Down
2 changes: 1 addition & 1 deletion avr/Servo.cpp → src/avr/Servo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <avr/interrupt.h>
#include <Arduino.h>

#include "Servo.h"
#include "../../Servo.h"

#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
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion mbed/Servo.cpp → src/mbed/Servo.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#if defined(ARDUINO_ARCH_MBED)

#include <Arduino.h>
#include <Servo.h>
#include "../../Servo.h"
#include <mbed.h>

#if defined __has_include
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion megaavr/Servo.cpp → src/megaavr/Servo.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#if defined(ARDUINO_ARCH_MEGAAVR)

#include <Arduino.h>
#include <Servo.h>
#include "../../Servo.h"

#define usToTicks(_us) ((clockCyclesPerMicrosecond() / 16 * _us) / 4) // converts microseconds to tick
#define ticksToUs(_ticks) (((unsigned) _ticks * 16) / (clockCyclesPerMicrosecond() / 4)) // converts from ticks back to microseconds
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion nrf52/Servo.cpp → src/nrf52/Servo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#if defined(ARDUINO_ARCH_NRF52)

#include <Arduino.h>
#include <Servo.h>
#include "../../Servo.h"


static servo_t servos[MAX_SERVOS]; // static array of servo structures
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion renesas/Servo.cpp → src/renesas/Servo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#if defined(ARDUINO_ARCH_RENESAS)

#include "Arduino.h"
#include "Servo.h"
#include "../../Servo.h"
#include "ServoTimers.h"
#include "math.h"
#include "FspTimer.h"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion sam/Servo.cpp → src/sam/Servo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#if defined(ARDUINO_ARCH_SAM)

#include <Arduino.h>
#include <Servo.h>
#include "../../Servo.h"

#define usToTicks(_us) (( clockCyclesPerMicrosecond() * _us) / 32) // converts microseconds to tick
#define ticksToUs(_ticks) (( (unsigned)_ticks * 32)/ clockCyclesPerMicrosecond() ) // converts from ticks back to microseconds
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion samd/Servo.cpp → src/samd/Servo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#if defined(ARDUINO_ARCH_SAMD)

#include <Arduino.h>
#include <Servo.h>
#include "../../Servo.h"

#define usToTicks(_us) ((clockCyclesPerMicrosecond() * _us) / 16) // converts microseconds to tick
#define ticksToUs(_ticks) (((unsigned) _ticks * 16) / clockCyclesPerMicrosecond()) // converts from ticks back to microseconds
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 4829dcc

Please sign in to comment.