Skip to content

Commit

Permalink
new STM32 core F3/F4 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
JAndrassy committed Mar 16, 2020
1 parent 8b4d7f6 commit c6d6519
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions utility/Enc28J60Network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 39,13 @@ uint8_t ENC28J60ControlCS = ENC28J60_CONTROL_CS;
#if defined(ARDUINO)
#if defined(STM32F2)
#include <SPI.h>
#elif !defined(STM32F3) && !defined(__STM32F4__)
#elif !defined(STM32F3) && !defined(__STM32F4__) || defined(ARDUINO_ARCH_STM32)
#include <SPI.h>
extern SPIClass SPI;
//#elif defined(ARDUINO_ARCH_AMEBA)
//SPIClass SPI((void *)(&spi_obj), 11, 12, 13, 10);
//SPI _spi(SPI_MOSI,SPI_MISO,SPI_SCK,ENC28J60ControlCS);
#else
#else // Roger Clarks STM32 F3/F4 core
#include "HardwareSPI.h"
extern HardwareSPI SPI(1);
#endif
Expand Down Expand Up @@ -135,8 135,8 @@ void Enc28J60Network::init(uint8_t* macaddr)
LogObject.uart_send_strln(F("ENC28J60::init DEBUG:Use SPI lib SPI.begin()"));
#endif
#if defined(ARDUINO)
#if defined(__STM32F3__) || defined(STM32F3) || defined(__STM32F4__)
SPI.begin(SPI_9MHZ, MSBFIRST, 0);
#if !defined(ARDUINO_ARCH_STM32) && (defined(__STM32F3__) || defined(STM32F3) || defined(__STM32F4__))
SPI.begin(SPI_9MHZ, MSBFIRST, 0); // Roger Clarks STM32 F3/F4 core
#else
SPI.begin();
#endif
Expand Down
4 changes: 2 additions & 2 deletions utility/Enc28J60Network.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 205,8 @@ extern uint8_t ENC28J60ControlCS;
#endif

#if defined(__MBED__) || defined(ARDUINO_ARCH_SAM) || defined(ARDUINO_ARCH_SAMD) || defined(__ARDUINO_ARC__) || defined(__STM32F1__) || defined(__STM32F3__) || defined(STM32F3) || defined(__STM32F4__) || defined(STM32F2) || defined(ESP8266) || defined(ARDUINO_ARCH_AMEBA) || defined(__MK20DX128__) || defined(__MKL26Z64__) || defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__) || defined(__IMXRT1062__) || defined(__RFduino__) || defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_AVR) || defined(ARDUINO_ARCH_MEGAAVR)
#if defined(ARDUINO) && defined(STM32F3)
#include "HardwareSPI.h"
#if defined(ARDUINO) && !defined(ARDUINO_ARCH_STM32) && defined(STM32F3)
#include "HardwareSPI.h" // Roger Clarks STM32 F3/F4 core
#else
#include <SPI.h>
#endif
Expand Down

0 comments on commit c6d6519

Please sign in to comment.