Skip to content

Commit 19a7e33

Browse files
committed
Merge branch 'dev' into ssi-sensors
2 parents 1b4fe43 + 28e7897 commit 19a7e33

File tree

7 files changed

+65
-16
lines changed

7 files changed

+65
-16
lines changed

.github/workflows/ccpp.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Library Compile
2+
on: push
3+
jobs:
4+
build:
5+
name: Test compile
6+
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
arduino-boards-fqbn:
10+
- arduino:avr:uno # arudino uno
11+
- arduino:sam:arduino_due_x # arduino due
12+
- arduino:samd:nano_33_iot # samd21
13+
- adafruit:samd:adafruit_metro_m4 # samd51
14+
- esp32:esp32:esp32doit-devkit-v1 # esm32
15+
- STM32:stm32:GenF1:pnum=BLUEPILL_F103C8 # stm32 bluepill
16+
- STM32:stm32:Nucleo_64:pnum=NUCLEO_F411RE # stm32 nucleo
17+
- arduino:mbed_rp2040:pico # rpi pico
18+
include:
19+
- arduino-boards-fqbn: arduino:avr:uno
20+
sketch-names: '**.ino'
21+
required-libraries: Simple FOC
22+
- arduino-boards-fqbn: arduino:sam:arduino_due_x
23+
required-libraries: Simple FOC
24+
sketch-names: '**.ino'
25+
- arduino-boards-fqbn: arduino:samd:nano_33_iot
26+
required-libraries: Simple FOC
27+
sketch-names: '**.ino'
28+
- arduino-boards-fqbn: arduino:mbed_rp2040:pico
29+
required-libraries: Simple FOC
30+
sketch-names: '**.ino'
31+
- arduino-boards-fqbn: adafruit:samd:adafruit_metro_m4
32+
platform-url: https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
33+
required-libraries: Simple FOC
34+
sketch-names: '**.ino'
35+
- arduino-boards-fqbn: esp32:esp32:esp32doit-devkit-v1
36+
platform-url: https://dl.espressif.com/dl/package_esp32_index.json
37+
required-libraries: Simple FOC
38+
sketch-names: '**.ino'
39+
- arduino-boards-fqbn: STM32:stm32:GenF1:pnum=BLUEPILL_F103C8
40+
platform-url: https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json
41+
required-libraries: Simple FOC
42+
sketch-names: '**.ino'
43+
- arduino-boards-fqbn: STM32:stm32:Nucleo_64:pnum=NUCLEO_F411RE
44+
platform-url: https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json
45+
required-libraries: Simple FOC
46+
sketch-names: '**.ino'
47+
# Do not cancel all jobs / architectures if one job fails
48+
fail-fast: false
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@master
52+
- name: Compile all examples
53+
uses: ArminJo/arduino-test-compile@master
54+
with:
55+
arduino-board-fqbn: ${{ matrix.arduino-boards-fqbn }}
56+
required-libraries: ${{ matrix.required-libraries }}
57+
platform-url: ${{ matrix.platform-url }}
58+
sketch-names: ${{ matrix.sketch-names }}
59+
sketches-exclude: ${{ matrix.sketches-exclude }}

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# SimpleFOC Driver and Support Library
22

3+
![Library Compile](https://github.com/simplefoc/Arduino-FOC-drivers/workflows/Library%20Compile/badge.svg)
4+
35
This library contains an assortment of drivers and supporting code for SimpleFOC.
46

57
The intent is to keep the core of SimpleFOC clean, and thus easy to maintain, understand and port to different platforms. In addition to this core, there are various drivers and supporting code which has grown around SimpleFOC, and which we would like to make available to the community.

examples/drivers/drv8316/drv8316_3pwm.ino renamed to examples/drivers/drv8316/3pwm/drv8316_3pwm.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
#include "Arduino.h"
55
#include <Wire.h>
66
#include <SimpleFOC.h>
7-
#include <Math.h>
7+
#include <SimpleFOCDrivers.h>
88
#include "drivers/drv8316/drv8316.h"
99

1010

1111

1212

1313
BLDCMotor motor = BLDCMotor(11);
14-
DRV8316Driver3PWM driver = DRV8316Driver3PWM(A3,A4,2,7,false); // MKR1010 3-PWM
14+
DRV8316Driver3PWM driver = DRV8316Driver3PWM(2,3,4,7,false); // use the right pins for your setup!
1515
#define ENABLE_A 0
1616
#define ENABLE_B 1
1717
#define ENABLE_C 6

examples/drivers/drv8316/drv8316_6pwm.ino renamed to examples/drivers/drv8316/6pwm/drv8316_6pwm.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
#include "Arduino.h"
55
#include <Wire.h>
66
#include <SimpleFOC.h>
7-
#include <Math.h>
7+
#include <SimpleFOCDrivers.h>
88
#include "drivers/drv8316/drv8316.h"
99

1010

1111

1212

1313
BLDCMotor motor = BLDCMotor(11);
14-
DRV8316Driver6PWM driver = DRV8316Driver6PWM(A3,0,A4,1,2,6,7,false); // MKR1010 6-PWM
14+
DRV8316Driver6PWM driver = DRV8316Driver6PWM(0,1,2,3,4,6,7,false); // use the right pins for your setup!
1515

1616

1717

src/encoders/as5047/AS5047.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,7 @@ struct AS5047Error {
9494
#define AS5047_RESULT_MASK 0x3FFF
9595

9696

97-
#if defined(ESP32)
9897
#define AS5047_BITORDER MSBFIRST
99-
#else
100-
#define AS5047_BITORDER BitOrder::MSBFIRST
101-
#endif
10298

10399
static SPISettings AS5047SPISettings(8000000, AS5047_BITORDER, SPI_MODE1); // @suppress("Invalid arguments")
104100

src/encoders/as5048a/AS5048A.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,7 @@ struct AS5048Error {
4747
#define AS5048A_RESULT_MASK 0x3FFF
4848

4949

50-
#if defined(ESP32)
5150
#define AS5048_BITORDER MSBFIRST
52-
#else
53-
#define AS5048_BITORDER BitOrder::MSBFIRST
54-
#endif
5551

5652

5753
static SPISettings AS5048SPISettings(8000000, AS5048_BITORDER, SPI_MODE1); // @suppress("Invalid arguments")

src/encoders/ma730/MA730.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@ enum FieldStrength {
2525
#define MA730_REG_RD 0x09
2626
#define MA730_REG_MGH_MGL 0x1B
2727

28-
#if defined(ESP32)
2928
#define MA730_BITORDER MSBFIRST
30-
#else
31-
#define MA730_BITORDER BitOrder::MSBFIRST
32-
#endif
3329

3430
static SPISettings MA730SPISettings(8000000, MA730_BITORDER, SPI_MODE3); // @suppress("Invalid arguments")
3531
static SPISettings MA730SSISettings(8000000, MA730_BITORDER, SPI_MODE1); // @suppress("Invalid arguments")

0 commit comments

Comments
 (0)