Commit c5dd194
committed
Fix SPI::setClockDivider implementation
As said in Arduino API:
https://www.arduino.cc/en/Reference/SPISetClockDivider
"On the Due, the system clock can be divided by values
from 1 to 255. The default value is 21, which sets the clock
to 4 MHz like other Arduino boards."
So in fact, it should be possible to divide the clock by any value.
Then HAL will use the best prescaler to fit requested Freq.
Moreover, it is not possible to define SPI_CLOCK_DIVx to match
the 16MHz value for avr as SPI frequency depends of system clock
configuration.
Fix #299
Signed-off-by: Frederic.Pillon <[email protected]>1 parent 18b8b10 commit c5dd194
2 files changed
+12
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
| 223 | + | |
224 | 224 | | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
| 225 | + | |
| 226 | + | |
233 | 227 | | |
234 | 228 | | |
235 | 229 | | |
| |||
240 | 234 | | |
241 | 235 | | |
242 | 236 | | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
260 | 242 | | |
261 | 243 | | |
262 | 244 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
0 commit comments