From f6d67b6268d674dc637b4e525953169a1d15c9d0 Mon Sep 17 00:00:00 2001 From: pennam Date: Fri, 28 Mar 2025 08:50:33 +0100 Subject: [PATCH 1/3] Offload spi transport to be shared with ArduinoBLE --- src/utility/debug.h | 95 ------ src/utility/server_drv.cpp | 2 +- src/utility/spi_drv.cpp | 604 ------------------------------------- src/utility/spi_drv.h | 109 ------- src/utility/wifi_drv.cpp | 2 +- src/utility/wifi_drv.h | 2 +- src/utility/wifi_spi.h | 71 ----- 7 files changed, 3 insertions(+), 882 deletions(-) delete mode 100644 src/utility/debug.h delete mode 100644 src/utility/spi_drv.cpp delete mode 100644 src/utility/spi_drv.h diff --git a/src/utility/debug.h b/src/utility/debug.h deleted file mode 100644 index 86c705f9..00000000 --- a/src/utility/debug.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - debug.h - Library for Arduino WiFi shield. - Copyright (c) 2011-2014 Arduino. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ -//*********************************************/ -// -// File: debug.h -// -// Author: dlf (Metodo2 srl) -// -//********************************************/ - - -#ifndef Debug_H -#define Debug_H - -#include -#include - -#define PRINT_FILE_LINE() do { \ - Serial.print("[");Serial.print(__FILE__); \ - Serial.print("::");Serial.print(__LINE__);Serial.print("]");\ -}while (0); - -#ifdef _DEBUG_ - -#define INFO(format, args...) do { \ - char buf[250]; \ - sprintf(buf, format, args); \ - Serial.println(buf); \ -} while(0); - -#define INFO1(x) do { PRINT_FILE_LINE() Serial.print("-I-");\ - Serial.println(x); \ -}while (0); - - -#define INFO2(x,y) do { PRINT_FILE_LINE() Serial.print("-I-");\ - Serial.print(x,16);Serial.print(",");Serial.println(y,16); \ -}while (0); - - -#else -#define INFO1(x) do {} while(0); -#define INFO2(x,y) do {} while(0); -#define INFO(format, args...) do {} while(0); -#endif - -#if 0 -#define WARN(args) do { PRINT_FILE_LINE() \ - Serial.print("-W-"); Serial.println(args); \ -}while (0); -#else -#define WARN(args) do {} while (0); -#endif - -#if _DEBUG_SPI_ -#define DBG_PIN2 5 -#define DBG_PIN 4 - -#define START() digitalWrite(DBG_PIN2, HIGH); -#define END() digitalWrite(DBG_PIN2, LOW); -#define SET_TRIGGER() digitalWrite(DBG_PIN, HIGH); -#define RST_TRIGGER() digitalWrite(DBG_PIN, LOW); - -#define INIT_TRIGGER() pinMode(DBG_PIN, OUTPUT); \ - pinMode(DBG_PIN2, OUTPUT); \ - RST_TRIGGER() -#define TOGGLE_TRIGGER() SET_TRIGGER() \ - delayMicroseconds(2); \ - RST_TRIGGER() -#else -#define START() -#define END() -#define SET_TRIGGER() -#define RST_TRIGGER() -#define INIT_TRIGGER() -#define TOGGLE_TRIGGER() -#endif - -#endif diff --git a/src/utility/server_drv.cpp b/src/utility/server_drv.cpp index 8ee6a6ee..c94eec52 100644 --- a/src/utility/server_drv.cpp +++ b/src/utility/server_drv.cpp @@ -23,7 +23,7 @@ #include "utility/server_drv.h" #include "Arduino.h" -#include "utility/spi_drv.h" +#include extern "C" { #include "utility/wl_types.h" diff --git a/src/utility/spi_drv.cpp b/src/utility/spi_drv.cpp deleted file mode 100644 index 729e02e9..00000000 --- a/src/utility/spi_drv.cpp +++ /dev/null @@ -1,604 +0,0 @@ -/* - spi_drv.cpp - Library for Arduino WiFi shield. - Copyright (c) 2018 Arduino SA. All rights reserved. - Copyright (c) 2011-2014 Arduino. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "Arduino.h" -#include -#include "utility/spi_drv.h" -#include "pins_arduino.h" -#include "WiFi.h" - -#ifdef ARDUINO_SAMD_MKRVIDOR4000 - -// check if a bitstream is already included -#if __has_include() -// yes, so use the existing VidorFPGA include -#include -#else -// otherwise, fallback to VidorPeripherals and its bitstream -#include -#endif - -#define NINA_GPIO0 FPGA_NINA_GPIO0 -#define SPIWIFI_SS FPGA_SPIWIFI_SS -#define SPIWIFI_ACK FPGA_SPIWIFI_ACK -#define SPIWIFI_RESET FPGA_SPIWIFI_RESET - -#define pinMode(pin, mode) FPGA.pinMode(pin, mode) -#define digitalRead(pin) FPGA.digitalRead(pin) -#define digitalWrite(pin, value) FPGA.digitalWrite(pin, value) -#endif - -// #define _DEBUG_ -extern "C" { -#include "utility/debug.h" -} - -static uint8_t SLAVESELECT = 10; // ss -static uint8_t SLAVEREADY = 7; // handshake pin -static uint8_t SLAVERESET = 5; // reset pin - -static bool inverted_reset = false; - -#define DELAY_TRANSFER() - -#ifndef SPIWIFI -#define SPIWIFI SPI -#endif - -#ifndef NINA_GPIOIRQ -#define NINA_GPIOIRQ NINA_GPIO0 -#endif - -bool SpiDrv::initialized = false; - -extern WiFiClass WiFi; - -void SpiDrv::begin(bool force) -{ - if(initialized && !force) { - return; - } - -#ifdef ARDUINO_SAMD_MKRVIDOR4000 - FPGA.begin(); -#endif - -#ifdef SPIWIFI_SS - SLAVESELECT = SPIWIFI_SS; -#endif - -#ifdef SPIWIFI_ACK - SLAVEREADY = SPIWIFI_ACK; -#endif - -#ifdef SPIWIFI_RESET - SLAVERESET = (uint8_t)SPIWIFI_RESET; -#endif - -#ifdef ARDUINO_SAMD_MKRVIDOR4000 - inverted_reset = false; -#else - if (SLAVERESET > PINS_COUNT) { - inverted_reset = true; - SLAVERESET = ~SLAVERESET; - } -#endif - - pinMode(SLAVESELECT, OUTPUT); - pinMode(SLAVEREADY, INPUT); - pinMode(SLAVERESET, OUTPUT); - pinMode(NINA_GPIO0, OUTPUT); - - digitalWrite(NINA_GPIO0, HIGH); - digitalWrite(SLAVESELECT, HIGH); - digitalWrite(SLAVERESET, inverted_reset ? HIGH : LOW); - delay(10); - digitalWrite(SLAVERESET, inverted_reset ? LOW : HIGH); - delay(750); - - digitalWrite(NINA_GPIO0, LOW); - pinMode(NINA_GPIOIRQ, INPUT); - - SPIWIFI.begin(); - -#ifdef _DEBUG_ - INIT_TRIGGER() -#endif - - initialized = true; -} - -void SpiDrv::end() { - digitalWrite(SLAVERESET, inverted_reset ? HIGH : LOW); - - pinMode(SLAVESELECT, INPUT); - - SPIWIFI.end(); - - initialized = false; -} - -void SpiDrv::spiSlaveSelect() -{ - SPIWIFI.beginTransaction(SPISettings(8000000, MSBFIRST, SPI_MODE0)); - digitalWrite(SLAVESELECT,LOW); - - // wait for up to 5 ms for the NINA to indicate it is not ready for transfer - // the timeout is only needed for the case when the shield or module is not present - for (unsigned long start = millis(); (digitalRead(SLAVEREADY) != HIGH) && (millis() - start) < 5;); -} - - -void SpiDrv::spiSlaveDeselect() -{ - digitalWrite(SLAVESELECT,HIGH); - SPIWIFI.endTransaction(); -} - - -char SpiDrv::spiTransfer(volatile char data) -{ - char result = SPIWIFI.transfer(data); - DELAY_TRANSFER(); - - return result; // return the received byte -} - -int SpiDrv::waitSpiChar(unsigned char waitChar) -{ - int timeout = TIMEOUT_CHAR; - unsigned char _readChar = 0; - do{ - _readChar = readChar(); //get data byte - if (_readChar == ERR_CMD) - { - WARN("Err cmd received\n"); - return -1; - } - }while((timeout-- > 0) && (_readChar != waitChar)); - return (_readChar == waitChar); -} - -int SpiDrv::readAndCheckChar(char checkChar, char* readChar) -{ - getParam((uint8_t*)readChar); - - return (*readChar == checkChar); -} - -char SpiDrv::readChar() -{ - uint8_t readChar = 0; - getParam(&readChar); - return readChar; -} - -#define WAIT_START_CMD(x) waitSpiChar(START_CMD) - -#define IF_CHECK_START_CMD(x) \ - if (!WAIT_START_CMD(_data)) \ - { \ - TOGGLE_TRIGGER() \ - WARN("Error waiting START_CMD"); \ - return 0; \ - }else \ - -#define CHECK_DATA(check, x) \ - if (!readAndCheckChar(check, &x)) \ - { \ - TOGGLE_TRIGGER() \ - WARN("Reply error"); \ - INFO2(check, (uint8_t)x); \ - return 0; \ - }else \ - -#define waitSlaveReady() (digitalRead(SLAVEREADY) == LOW) -#define waitSlaveSign() (digitalRead(SLAVEREADY) == HIGH) -#define waitSlaveSignalH() while(digitalRead(SLAVEREADY) != HIGH){} -#define waitSlaveSignalL() while(digitalRead(SLAVEREADY) != LOW){} - -void SpiDrv::waitForSlaveSign() -{ - while (!waitSlaveSign()); -} - -void SpiDrv::waitForSlaveReady(bool const feed_watchdog) -{ - unsigned long const start = millis(); - while (!waitSlaveReady()) - { - if (feed_watchdog) { - if ((millis() - start) < 10000) { - WiFi.feedWatchdog(); - } - } - } -} - -void SpiDrv::getParam(uint8_t* param) -{ - // Get Params data - *param = spiTransfer(DUMMY_DATA); - DELAY_TRANSFER(); -} - -int SpiDrv::waitResponseCmd(uint8_t cmd, uint8_t numParam, uint8_t* param, uint8_t* param_len) -{ - char _data = 0; - int ii = 0; - - IF_CHECK_START_CMD(_data) - { - CHECK_DATA(cmd | REPLY_FLAG, _data){}; - - CHECK_DATA(numParam, _data) - { - readParamLen8(param_len); - for (ii=0; ii<(*param_len); ++ii) - { - // Get Params data - //param[ii] = spiTransfer(DUMMY_DATA); - getParam(¶m[ii]); - } - } - - readAndCheckChar(END_CMD, &_data); - } - - return 1; -} -/* -int SpiDrv::waitResponse(uint8_t cmd, uint8_t numParam, uint8_t* param, uint16_t* param_len) -{ - char _data = 0; - int i =0, ii = 0; - - IF_CHECK_START_CMD(_data) - { - CHECK_DATA(cmd | REPLY_FLAG, _data){}; - - CHECK_DATA(numParam, _data); - { - readParamLen16(param_len); - for (ii=0; ii<(*param_len); ++ii) - { - // Get Params data - param[ii] = spiTransfer(DUMMY_DATA); - } - } - - readAndCheckChar(END_CMD, &_data); - } - - return 1; -} -*/ - -int SpiDrv::waitResponseData16(uint8_t cmd, uint8_t* param, uint16_t* param_len) -{ - char _data = 0; - uint16_t ii = 0; - - IF_CHECK_START_CMD(_data) - { - CHECK_DATA(cmd | REPLY_FLAG, _data){}; - - uint8_t numParam = readChar(); - if (numParam != 0) - { - readParamLen16(param_len); - for (ii=0; ii<(*param_len); ++ii) - { - // Get Params data - param[ii] = spiTransfer(DUMMY_DATA); - } - } - - readAndCheckChar(END_CMD, &_data); - } - - return 1; -} - -int SpiDrv::waitResponseData8(uint8_t cmd, uint8_t* param, uint8_t* param_len) -{ - char _data = 0; - int ii = 0; - - IF_CHECK_START_CMD(_data) - { - CHECK_DATA(cmd | REPLY_FLAG, _data){}; - - uint8_t numParam = readChar(); - if (numParam != 0) - { - readParamLen8(param_len); - for (ii=0; ii<(*param_len); ++ii) - { - // Get Params data - param[ii] = spiTransfer(DUMMY_DATA); - } - } - - readAndCheckChar(END_CMD, &_data); - } - - return 1; -} - -int SpiDrv::waitResponseParams(uint8_t cmd, uint8_t numParam, tParam* params) -{ - char _data = 0; - int i =0, ii = 0; - - - IF_CHECK_START_CMD(_data) - { - CHECK_DATA(cmd | REPLY_FLAG, _data){}; - - uint8_t _numParam = readChar(); - if (_numParam != 0) - { - for (i=0; i<_numParam; ++i) - { - params[i].paramLen = readParamLen8(); - for (ii=0; ii maxNumParams) - { - numParam = maxNumParams; - } - *numParamRead = numParam; - if (numParam != 0) - { - for (i=0; i maxNumParams) - { - numParam = maxNumParams; - } - *numParamRead = numParam; - if (numParam != 0) - { - for (i=0; i>8)); - spiTransfer((uint8_t)(param_len & 0xff)); -} - -uint8_t SpiDrv::readParamLen8(uint8_t* param_len) -{ - uint8_t _param_len = spiTransfer(DUMMY_DATA); - if (param_len != NULL) - { - *param_len = _param_len; - } - return _param_len; -} - -uint16_t SpiDrv::readParamLen16(uint16_t* param_len) -{ - uint16_t _param_len = spiTransfer(DUMMY_DATA)<<8 | (spiTransfer(DUMMY_DATA)& 0xff); - if (param_len != NULL) - { - *param_len = _param_len; - } - return _param_len; -} - - -void SpiDrv::sendBuffer(const uint8_t* param, uint16_t param_len, uint8_t lastParam) -{ - uint16_t i = 0; - - // Send SPI paramLen - sendParamLen16(param_len); - - // Send SPI param data - for (i=0; i>8)); - spiTransfer((uint8_t)(param & 0xff)); - - // if lastParam==1 Send SPI END CMD - if (lastParam == 1) - spiTransfer(END_CMD); -} - -/* Cmd Struct Message */ -/* _________________________________________________________________________________ */ -/*| START CMD | C/R | CMD |[TOT LEN]| N.PARAM | PARAM LEN | PARAM | .. | END CMD | */ -/*|___________|______|______|_________|_________|___________|________|____|_________| */ -/*| 8 bit | 1bit | 7bit | 8bit | 8bit | 8bit | nbytes | .. | 8bit | */ -/*|___________|______|______|_________|_________|___________|________|____|_________| */ - -void SpiDrv::sendCmd(uint8_t cmd, uint8_t numParam) -{ - // Send SPI START CMD - spiTransfer(START_CMD); - - // Send SPI C + cmd - spiTransfer(cmd & ~(REPLY_FLAG)); - - // Send SPI totLen - //spiTransfer(totLen); - - // Send SPI numParam - spiTransfer(numParam); - - // If numParam == 0 send END CMD - if (numParam == 0) - spiTransfer(END_CMD); - -} - -int SpiDrv::available() -{ - return (digitalRead(NINA_GPIOIRQ) != LOW); -} - -SpiDrv spiDrv; diff --git a/src/utility/spi_drv.h b/src/utility/spi_drv.h deleted file mode 100644 index 333d0d6e..00000000 --- a/src/utility/spi_drv.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - spi_drv.h - Library for Arduino WiFi shield. - Copyright (c) 2018 Arduino SA. All rights reserved. - Copyright (c) 2011-2014 Arduino. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef SPI_Drv_h -#define SPI_Drv_h - -#include -#include "utility/wifi_spi.h" - -#define SPI_START_CMD_DELAY 10 - -#define NO_LAST_PARAM 0 -#define LAST_PARAM 1 - -#define DUMMY_DATA 0xFF - -#define WAIT_FOR_SLAVE_SELECT() \ - if (!SpiDrv::initialized) { \ - SpiDrv::begin(); \ - } \ - SpiDrv::waitForSlaveReady(); \ - SpiDrv::spiSlaveSelect(); - -class SpiDrv -{ -private: - //static bool waitSlaveReady(); - static void waitForSlaveSign(); - static void getParam(uint8_t* param); -public: - static bool initialized; - - static void begin(bool force=false); - - static void end(); - - static void spiDriverInit(); - - static void spiSlaveSelect(); - - static void spiSlaveDeselect(); - - static char spiTransfer(volatile char data); - - static void waitForSlaveReady(bool const feed_watchdog = false); - - //static int waitSpiChar(char waitChar, char* readChar); - - static int waitSpiChar(unsigned char waitChar); - - static int readAndCheckChar(char checkChar, char* readChar); - - static char readChar(); - - static int waitResponseParams(uint8_t cmd, uint8_t numParam, tParam* params); - - static int waitResponseCmd(uint8_t cmd, uint8_t numParam, uint8_t* param, uint8_t* param_len); - - static int waitResponseData8(uint8_t cmd, uint8_t* param, uint8_t* param_len); - - static int waitResponseData16(uint8_t cmd, uint8_t* param, uint16_t* param_len); -/* - static int waitResponse(uint8_t cmd, tParam* params, uint8_t* numParamRead, uint8_t maxNumParams); - - static int waitResponse(uint8_t cmd, uint8_t numParam, uint8_t* param, uint16_t* param_len); -*/ - static int waitResponse(uint8_t cmd, uint8_t* numParamRead, uint8_t** params, uint8_t maxNumParams); - - static void sendParam(const uint8_t* param, uint8_t param_len, uint8_t lastParam = NO_LAST_PARAM); - - static void sendParamNoLen(const uint8_t* param, size_t param_len, uint8_t lastParam = NO_LAST_PARAM); - - static void sendParamLen8(const uint8_t param_len); - - static void sendParamLen16(const uint16_t param_len); - - static uint8_t readParamLen8(uint8_t* param_len = NULL); - - static uint16_t readParamLen16(uint16_t* param_len = NULL); - - static void sendBuffer(const uint8_t* param, uint16_t param_len, uint8_t lastParam = NO_LAST_PARAM); - - static void sendParam(uint16_t param, uint8_t lastParam = NO_LAST_PARAM); - - static void sendCmd(uint8_t cmd, uint8_t numParam); - - static int available(); -}; - -extern SpiDrv spiDrv; - -#endif diff --git a/src/utility/wifi_drv.cpp b/src/utility/wifi_drv.cpp index c1cef344..7a7b8364 100644 --- a/src/utility/wifi_drv.cpp +++ b/src/utility/wifi_drv.cpp @@ -23,7 +23,7 @@ #include #include "Arduino.h" -#include "utility/spi_drv.h" +#include #include "utility/wifi_drv.h" #define _DEBUG_ diff --git a/src/utility/wifi_drv.h b/src/utility/wifi_drv.h index 055aadd3..3a5d94f2 100644 --- a/src/utility/wifi_drv.h +++ b/src/utility/wifi_drv.h @@ -22,7 +22,7 @@ #define WiFi_Drv_h #include -#include "utility/wifi_spi.h" +#include "wifi_spi.h" #include "IPAddress.h" #include "WiFiUdp.h" #include "WiFiClient.h" diff --git a/src/utility/wifi_spi.h b/src/utility/wifi_spi.h index e7f3509c..d712396d 100644 --- a/src/utility/wifi_spi.h +++ b/src/utility/wifi_spi.h @@ -159,75 +159,4 @@ enum wl_tcp_state { TIME_WAIT = 10 }; - -enum numParams{ - PARAM_NUMS_0, - PARAM_NUMS_1, - PARAM_NUMS_2, - PARAM_NUMS_3, - PARAM_NUMS_4, - PARAM_NUMS_5, - PARAM_NUMS_6, - MAX_PARAM_NUMS -}; - -#define MAX_PARAMS MAX_PARAM_NUMS-1 -#define PARAM_LEN_SIZE 1 - -typedef struct __attribute__((__packed__)) -{ - uint8_t paramLen; - char* param; -}tParam; - -typedef struct __attribute__((__packed__)) -{ - uint16_t dataLen; - char* data; -}tDataParam; - - -typedef struct __attribute__((__packed__)) -{ - unsigned char cmd; - unsigned char tcmd; - unsigned char nParam; - tParam params[MAX_PARAMS]; -}tSpiMsg; - -typedef struct __attribute__((__packed__)) -{ - unsigned char cmd; - unsigned char tcmd; - unsigned char nParam; - tDataParam params[MAX_PARAMS]; -}tSpiMsgData; - - -typedef struct __attribute__((__packed__)) -{ - unsigned char cmd; - unsigned char tcmd; - //unsigned char totLen; - unsigned char nParam; -}tSpiHdr; - -typedef struct __attribute__((__packed__)) -{ - uint8_t paramLen; - uint32_t param; -}tLongParam; - -typedef struct __attribute__((__packed__)) -{ - uint8_t paramLen; - uint16_t param; -}tIntParam; - -typedef struct __attribute__((__packed__)) -{ - uint8_t paramLen; - uint8_t param; -}tByteParam; - #endif From 6dfc9cf40e0561cfe671dbd01a6564d1b703d2b0 Mon Sep 17 00:00:00 2001 From: pennam Date: Fri, 28 Mar 2025 09:47:25 +0100 Subject: [PATCH 2/3] fix build --- src/WiFi.cpp | 2 +- src/WiFiClient.cpp | 2 +- src/WiFiServer.cpp | 6 +++--- src/WiFiUdp.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/WiFi.cpp b/src/WiFi.cpp index eb16f9f1..0ecf8314 100644 --- a/src/WiFi.cpp +++ b/src/WiFi.cpp @@ -24,7 +24,7 @@ extern "C" { #include "utility/wl_definitions.h" #include "utility/wl_types.h" - #include "utility/debug.h" + //#include "utility/debug.h" } WiFiClass::WiFiClass() : _timeout(50000), _feed_watchdog_func(0) diff --git a/src/WiFiClient.cpp b/src/WiFiClient.cpp index c2de0018..bb72a7c0 100644 --- a/src/WiFiClient.cpp +++ b/src/WiFiClient.cpp @@ -22,7 +22,7 @@ extern "C" { #include "utility/wl_definitions.h" #include "utility/wl_types.h" #include "string.h" - #include "utility/debug.h" + //#include "utility/debug.h" } diff --git a/src/WiFiServer.cpp b/src/WiFiServer.cpp index 7839a180..4686e3ee 100644 --- a/src/WiFiServer.cpp +++ b/src/WiFiServer.cpp @@ -21,9 +21,9 @@ #include #include "utility/server_drv.h" -extern "C" { - #include "utility/debug.h" -} +//extern "C" { +// #include "utility/debug.h" +//} #include "WiFi.h" #include "WiFiClient.h" diff --git a/src/WiFiUdp.cpp b/src/WiFiUdp.cpp index 38e4d7ec..6e3fb7df 100644 --- a/src/WiFiUdp.cpp +++ b/src/WiFiUdp.cpp @@ -21,7 +21,7 @@ #include extern "C" { - #include "utility/debug.h" + //#include "utility/debug.h" #include "utility/wifi_spi.h" } From b9a8d705f85fef8c19862c32e314367d4bba5734 Mon Sep 17 00:00:00 2001 From: pennam Date: Tue, 1 Apr 2025 16:08:13 +0200 Subject: [PATCH 3/3] remove spi driver defines --- src/utility/wifi_spi.h | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/utility/wifi_spi.h b/src/utility/wifi_spi.h index d712396d..3f9f52d0 100644 --- a/src/utility/wifi_spi.h +++ b/src/utility/wifi_spi.h @@ -24,25 +24,9 @@ #include #include "utility/wl_definitions.h" -#define CMD_FLAG 0 -#define REPLY_FLAG 1<<7 -#define DATA_FLAG 0x40 - -#define WIFI_SPI_ACK 1 -#define WIFI_SPI_ERR 0xFF - -#define TIMEOUT_CHAR 1000 - //#define MAX_SOCK_NUM 4 /**< Maximum number of socket */ #define NO_SOCKET_AVAIL 255 -#define START_CMD 0xE0 -#define END_CMD 0xEE -#define ERR_CMD 0xEF -#define CMD_POS 1 // Position of Command OpCode on SPI stream -#define PARAM_LEN_POS 2 // Position of Param len on SPI stream - - enum { SET_NET_CMD = 0x10, SET_PASSPHRASE_CMD = 0x11,