Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Language: Cpp
BasedOnStyle: Google
IndentWidth: 2
ColumnLimit: 80
AllowShortBlocksOnASingleLine: Always
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
BinPackArguments: true
BinPackParameters: true
BreakBeforeBraces: Attach
DerivePointerAlignment: false
PointerAlignment: Left
SpacesBeforeTrailingComments: 1
19 changes: 14 additions & 5 deletions .github/workflows/githubci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,21 @@ name: Arduino Library CI
on: [pull_request, push, repository_dispatch]

jobs:
build:
clang-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: adafruit/ci-arduino
path: ci
- name: Check code formatting with clang-format
run: python3 ci/run-clang-format.py -e "ci/*" -e "bin/*" -r .

build:
needs: clang-format
runs-on: ubuntu-latest

steps:
- uses: actions/setup-python@v4
with:
Expand All @@ -22,11 +34,8 @@ jobs:
- name: test platforms
run: python3 ci/build_platform.py main_platforms

- name: clang
run: python3 ci/run-clang-format.py -e "ci/*" -e "bin/*" -r .

- name: doxygen
env:
GH_REPO_TOKEN: ${{ secrets.GH_REPO_TOKEN }}
PRETTYNAME : "Adafruit PCA9685 PWM Library"
run: bash ci/doxy_gen_and_deploy.sh
run: bash ci/doxy_gen_and_deploy.sh
4 changes: 2 additions & 2 deletions Adafruit_PWMServoDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include "Adafruit_PWMServoDriver.h"

//#define ENABLE_DEBUG_OUTPUT
// #define ENABLE_DEBUG_OUTPUT

/*!
* @brief Instantiates a new PCA9685 PWM driver chip with the I2C address on a
Expand All @@ -54,7 +54,7 @@ Adafruit_PWMServoDriver::Adafruit_PWMServoDriver(const uint8_t addr)
* with
*/
Adafruit_PWMServoDriver::Adafruit_PWMServoDriver(const uint8_t addr,
TwoWire &i2c)
TwoWire& i2c)
: _i2caddr(addr), _i2c(&i2c) {}

/*!
Expand Down
12 changes: 6 additions & 6 deletions Adafruit_PWMServoDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
#define MODE1_RESTART 0x80 /**< Restart enabled */
// MODE2 bits
#define MODE2_OUTNE_0 0x01 /**< Active LOW output enable input */
#define MODE2_OUTNE_1 \
#define MODE2_OUTNE_1 \
0x02 /**< Active LOW output enable input - high impedience */
#define MODE2_OUTDRV 0x04 /**< totem pole structure vs open-drain */
#define MODE2_OCH 0x08 /**< Outputs change on ACK vs STOP */
Expand All @@ -73,10 +73,10 @@
* PWM chip
*/
class Adafruit_PWMServoDriver {
public:
public:
Adafruit_PWMServoDriver();
Adafruit_PWMServoDriver(const uint8_t addr);
Adafruit_PWMServoDriver(const uint8_t addr, TwoWire &i2c);
Adafruit_PWMServoDriver(const uint8_t addr, TwoWire& i2c);
bool begin(uint8_t prescale = 0);
void reset();
void sleep();
Expand All @@ -93,10 +93,10 @@ class Adafruit_PWMServoDriver {
void setOscillatorFrequency(uint32_t freq);
uint32_t getOscillatorFrequency(void);

private:
private:
uint8_t _i2caddr;
TwoWire *_i2c;
Adafruit_I2CDevice *i2c_dev = NULL; ///< Pointer to I2C bus interface
TwoWire* _i2c;
Adafruit_I2CDevice* i2c_dev = NULL; ///< Pointer to I2C bus interface

uint32_t _oscillator_freq;
uint8_t read8(uint8_t addr);
Expand Down