update code base to Marlin 2.0.9.2
This commit is contained in:
24
Marlin/src/HAL/ESP32/HAL_SPI.cpp
Executable file → Normal file
24
Marlin/src/HAL/ESP32/HAL_SPI.cpp
Executable file → Normal file
@@ -17,19 +17,17 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef ARDUINO_ARCH_ESP32
|
||||
|
||||
#include "HAL.h"
|
||||
#include "../shared/HAL_SPI.h"
|
||||
#include <pins_arduino.h>
|
||||
#include "spi_pins.h"
|
||||
#include <SPI.h>
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#include "../../core/macros.h"
|
||||
#include "../shared/HAL_SPI.h"
|
||||
|
||||
#include <pins_arduino.h>
|
||||
#include <SPI.h>
|
||||
|
||||
// ------------------------
|
||||
// Public Variables
|
||||
@@ -55,11 +53,11 @@ static SPISettings spiConfig;
|
||||
// ------------------------
|
||||
|
||||
void spiBegin() {
|
||||
#if !PIN_EXISTS(SS)
|
||||
#error "SS_PIN not defined!"
|
||||
#if !PIN_EXISTS(SD_SS)
|
||||
#error "SD_SS_PIN not defined!"
|
||||
#endif
|
||||
|
||||
OUT_WRITE(SS_PIN, HIGH);
|
||||
OUT_WRITE(SD_SS_PIN, HIGH);
|
||||
}
|
||||
|
||||
void spiInit(uint8_t spiRate) {
|
||||
@@ -87,7 +85,7 @@ uint8_t spiRec() {
|
||||
return returnByte;
|
||||
}
|
||||
|
||||
void spiRead(uint8_t* buf, uint16_t nbyte) {
|
||||
void spiRead(uint8_t *buf, uint16_t nbyte) {
|
||||
SPI.beginTransaction(spiConfig);
|
||||
SPI.transferBytes(0, buf, nbyte);
|
||||
SPI.endTransaction();
|
||||
@@ -99,7 +97,7 @@ void spiSend(uint8_t b) {
|
||||
SPI.endTransaction();
|
||||
}
|
||||
|
||||
void spiSendBlock(uint8_t token, const uint8_t* buf) {
|
||||
void spiSendBlock(uint8_t token, const uint8_t *buf) {
|
||||
SPI.beginTransaction(spiConfig);
|
||||
SPI.transfer(token);
|
||||
SPI.writeBytes(const_cast<uint8_t*>(buf), 512);
|
||||
|
Reference in New Issue
Block a user