-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libraries/SPI: abs -> std::abs and cast fixes (#7362)
* libraries/SPI: remove pointless abs(...) call SPI library code erroneously assumed that: - abs() is a C function, so include stdlib.h is required. what happens instead is Arduino.h shadows `abs()` with it's own macro - uint32_t() - int32_t() promotes to int32_t, thus needing abs() Fix both issues, leaving existing calculations as-is. * additional changes for freq and constants - restore abs call, cast freq to correctly display the intent - update magic numbers comments - move some spiclk_t magic numbers to func consts
- Loading branch information
Showing
2 changed files
with
18 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,6 @@ | |
#define _SPI_H_INCLUDED | ||
|
||
#include <Arduino.h> | ||
#include <stdlib.h> | ||
|
||
#define SPI_HAS_TRANSACTION 1 | ||
|
||
|