Skip to content

Commit 14c9eb2

Browse files
authored
Merge pull request #321 from simplefoc/BUGFIX_teensy32_ftm3
bugfix for teensy 3.0-3.0, wrong check for timer 3
2 parents 1694fa3 + c83ea8a commit 14c9eb2

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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)