Skip to content

Commit 14c6834

Browse files
committed
Merge branch 'dev' of github.com:askuric/Arduino-FOC into dev
2 parents c42ebc4 + 2c039ba commit 14c6834

File tree

2 files changed

+44
-4
lines changed

2 files changed

+44
-4
lines changed

.github/workflows/teensy.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: PlatformIO - Teensy build
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- uses: actions/cache@v3
12+
with:
13+
path: |
14+
~/.cache/pip
15+
~/.platformio/.cache
16+
key: ${{ runner.os }}-pio
17+
- uses: actions/setup-python@v4
18+
with:
19+
python-version: '3.9'
20+
- name: Install PlatformIO Core
21+
run: pip install --upgrade platformio
22+
23+
- name: PIO Run Teensy 4
24+
run: pio ci --lib="." --board=teensy41 --board=teensy40
25+
env:
26+
PLATFORMIO_CI_SRC: examples/hardware_specific_examples/Teensy/Teensy4/bldc_driver_6pwm_standalone/bldc_driver_6pwm_standalone.ino
27+
28+
- name: PIO Run Teensy 4
29+
run: pio ci --lib="." --board=teensy41 --board=teensy40
30+
env:
31+
PLATFORMIO_CI_SRC: examples/hardware_specific_examples/Teensy/Teensy4/open_loop_velocity_6pwm/open_loop_velocity_6pwm.ino
32+
33+
- name: PIO Run Teensy 3
34+
run: pio ci --lib="." --board=teensy31 --board=teensy30 --board=teensy35 --board=teensy36
35+
env:
36+
PLATFORMIO_CI_SRC: examples/hardware_specific_examples/Teensy/Teensy3/bldc_driver_6pwm_standalone/bldc_driver_6pwm_standalone.ino
37+
38+
- name: PIO Run Teensy 3
39+
run: pio ci --lib="." --board=teensy31 --board=teensy30 --board=teensy35 --board=teensy36
40+
env:
41+
PLATFORMIO_CI_SRC: examples/hardware_specific_examples/Teensy/Teensy3/open_loop_velocity_6pwm/open_loop_velocity_6pwm.ino

src/drivers/hardware_specific/teensy/teensy3_mcu.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// if defined
44
// - Teensy 3.0 MK20DX128
55
// - Teensy 3.1/3.2 MK20DX256
6-
// - Teensy 3.5 MK20DX128
76
// - Teensy LC MKL26Z64
87
// - Teensy 3.5 MK64FX512
98
// - Teensy 3.6 MK66FX1M0
@@ -14,7 +13,7 @@
1413
#pragma message("SimpleFOC: compiling for Teensy 3.x")
1514
#pragma message("")
1615

17-
// pin definition from https://github.com/PaulStoffregen/cores/blob/286511f3ec849a6c9e0ec8b73ad6a2fada52e44c/teensy3/pins_teensy.c
16+
// pin definition from https://github.com/PaulStoffregen/cores/blob/286511f3ec849a6c9e0ec8b73ad6a2fada52e44c/teensy3/pins_teensy.c#L627
1817
#if defined(__MK20DX128__)
1918
#define FTM0_CH0_PIN 22
2019
#define FTM0_CH1_PIN 23
@@ -116,7 +115,7 @@ int _findTimer( const int Ah, const int Al, const int Bh, const int Bl, const i
116115
}
117116
}
118117

119-
#ifdef FTM3_SC // if the board has FTM3 timer
118+
#ifdef FTM3_CH0_PIN // if the board has FTM3 timer
120119
if((Ah == FTM3_CH0_PIN && Al == FTM3_CH1_PIN) ||
121120
(Ah == FTM3_CH2_PIN && Al == FTM3_CH3_PIN) ||
122121
(Ah == FTM3_CH4_PIN && Al == FTM3_CH5_PIN) ){
@@ -134,7 +133,7 @@ int _findTimer( const int Ah, const int Al, const int Bh, const int Bl, const i
134133
}
135134
}
136135
}
137-
#endif
136+
#endif
138137

139138
#ifdef SIMPLEFOC_TEENSY_DEBUG
140139
SIMPLEFOC_DEBUG("TEENSY-DRV: ERR: Pins not on timers FTM0 or FTM3!");

0 commit comments

Comments
 (0)