Skip to content

Commit

Permalink
RP2040: an experiment with ESPHost library
Browse files Browse the repository at this point in the history
  • Loading branch information
lyusupov committed Apr 20, 2024
1 parent 2300f3a commit dd3e804
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
5 changes: 3 additions & 2 deletions software/firmware/source/SoftRF/src/platform/RP2040.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ static void RP2040_msc_flush_cb (void)
}
#endif /* ARDUINO_ARCH_MBED */

#if defined(ARDUINO_RASPBERRY_PI_PICO) && !defined(EXCLUDE_WIFI)
#if defined(ARDUINO_RASPBERRY_PI_PICO) && \
!defined(EXCLUDE_WIFI) && !defined(ESPHOSTSPI)
SPIClassRP2040 SPI0(spi0, PIN_SPI0_MISO, PIN_SPI0_SS, PIN_SPI0_SCK, PIN_SPI0_MOSI);
#endif /* EXCLUDE_WIFI */

Expand Down Expand Up @@ -283,7 +284,7 @@ static void RP2040_setup()

#if defined(ARDUINO_RASPBERRY_PI_PICO)
RP2040_board = RP2040_RPIPICO;
#if !defined(EXCLUDE_WIFI)
#if !defined(EXCLUDE_WIFI) && !defined(ESPHOSTSPI)
WiFi.setPins(PIN_SPI0_SS, D26, D24, D20, &SPI0);
#endif /* EXCLUDE_WIFI */
#elif defined(ARDUINO_RASPBERRY_PI_PICO_W)
Expand Down
7 changes: 7 additions & 0 deletions software/firmware/source/SoftRF/src/platform/RP2040.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,14 @@ struct rst_info {
#define ENABLE_PROL
//#define ENABLE_BT_VOICE
#else
#if defined(ESPHOSTSPI)
#include <ESP8266WiFi.h>
#define Serial_setDebugOutput(x) ({})
#define USE_ARDUINO_WIFI
#define EXCLUDE_OTA
#else
#define EXCLUDE_WIFI
#endif /* ESPHOSTSPI */
//#define EXCLUDE_OTA
//#define USE_ARDUINO_WIFI
//#define USE_WIFI_NINA false
Expand Down
5 changes: 5 additions & 0 deletions software/firmware/source/SoftRF/src/ui/Web.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,13 @@ static uint32_t prev_rx_pkt_cnt = 0;
#include "jquery_min_js.h"
#endif /* EXCLUDE_OTA */

#if defined(ESPHOSTSPI)
#include <WebServer.h>
WebServer server ( 80 );
#else
#include <WiFiWebServer.h>
WiFiWebServer server ( 80 );
#endif

byte getVal(char c)
{
Expand Down
4 changes: 4 additions & 0 deletions software/firmware/source/libraries/LibAPRS_ESP32/AX25.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,16 @@ uint8_t *ctxbuffer;

#define typeof(x) __typeof__(x)
#define countof(a) sizeof(a) / sizeof(a[0])

#ifndef MIN
#define MIN(a, b) ( \
{ \
typeof(a) _a = (a); \
typeof(b) _b = (b); \
((typeof(_a))((_a < _b) ? _a : _b)); \
})
#endif

#define DECODE_CALL(buf, addr) \
for (unsigned i = 0; i < sizeof((addr)) - CALL_OVERSPACE; i++) \
{ \
Expand Down

1 comment on commit dd3e804

@lyusupov
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Please sign in to comment.