diff --git a/0001-Enable-lwIP-TFTP-server-support.patch b/0001-Enable-lwIP-TFTP-server-support.patch new file mode 100644 index 0000000..211781e --- /dev/null +++ b/0001-Enable-lwIP-TFTP-server-support.patch @@ -0,0 +1,46 @@ +From 963e5981b7e9212068ee6589983f5cd0e217f7b1 Mon Sep 17 00:00:00 2001 +From: jrhoffa +Date: Sun, 27 Nov 2022 18:05:45 -0800 +Subject: [PATCH] Enable lwIP TFTP server support + +--- + components/lwip/CMakeLists.txt | 4 ++++ + components/lwip/Kconfig | 7 +++++++ + 2 files changed, 11 insertions(+) + +diff --git a/components/lwip/CMakeLists.txt b/components/lwip/CMakeLists.txt +index acd587de92..40dcb7f4f4 100644 +--- a/components/lwip/CMakeLists.txt ++++ b/components/lwip/CMakeLists.txt +@@ -148,6 +148,10 @@ if(CONFIG_LWIP_DHCPS) + list(APPEND srcs "apps/dhcpserver/dhcpserver.c") + endif() + ++if(CONFIG_LWIP_TFTPS) ++ list(APPEND srcs "lwip/src/apps/tftp/tftp_server.c") ++endif() ++ + idf_component_register(SRCS "${srcs}" + INCLUDE_DIRS "${include_dirs}" + LDFRAGMENTS linker.lf +diff --git a/components/lwip/Kconfig b/components/lwip/Kconfig +index 57e8c2b045..5016394397 100644 +--- a/components/lwip/Kconfig ++++ b/components/lwip/Kconfig +@@ -871,6 +871,13 @@ menu "LWIP" + + endmenu # LWIP RAW API + ++ menu "TFTP" ++ config LWIP_TFTPS ++ bool "Enable TFTP server" ++ default n ++ ++ endmenu # TFTP ++ + menu "SNTP" + + config LWIP_SNTP_MAX_SERVERS +-- +2.25.1 + diff --git a/main/main.cpp b/main/main.cpp index 4dc18ae..0c630e5 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -106,7 +106,7 @@ extern "C" void app_main(void) { // TerminalLEDs() // ScreenLEDs() // SPI_LEDs(39); - // RMT_LEDs(17); + // RMT_LEDs(GPIO_NUM_17); LEDStrip *LEDs = new RMT_LEDs(GPIO_NUM_17); int frequency = 30; diff --git a/main/spi_leds.cpp b/main/spi_leds.cpp index 174347d..641fd96 100644 --- a/main/spi_leds.cpp +++ b/main/spi_leds.cpp @@ -54,7 +54,9 @@ SPI_LEDs::SPI_LEDs(int _gpio, int length) : .cs_ena_posttrans = 0, // moot // Datasheet implies 3.2 MHz => 1.25 us / 4 // We can get away with 4.4_ MHz => 900 ns / 4 - .clock_speed_hz = 3200000, + // HOWEVER, better implementations divide 1.25 us into thirds! + // Thus, 2.4 MHz has the same H times and slightly longer L times. + .clock_speed_hz = 2400000, .input_delay_ns = 0, // moot .spics_io_num = -1, .flags = 0, // Keep it MSB first