Skip to content

Commit

Permalink
Remove legacy Host dependencies on Esp8266 Components
Browse files Browse the repository at this point in the history
  • Loading branch information
mikee47 committed Jul 16, 2024
1 parent f56189f commit 91e8514
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 17 deletions.
11 changes: 5 additions & 6 deletions Sming/Arch/Host/Components/driver/uart_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
****/

#include "uart_server.h"
#include <espinc/uart_register.h>
#include <driver/SerialBuffer.h>
#include <BitManipulations.h>
#include <hostlib/keyb.h>
Expand Down Expand Up @@ -76,7 +75,7 @@ void* KeyboardThread::thread_routine()
buf->writeChar(c);
} while((c = getkey()) != KEY_NONE);

uart->status |= UART_RXFIFO_TOUT_INT_ST;
uart->status |= UART_STATUS_RXFIFO_TOUT;

interrupt_begin();

Expand Down Expand Up @@ -254,7 +253,7 @@ int CUart::serviceRead()

int space = uart->rx_buffer->getFreeSpace();
if(space < avail) {
uart->status |= UART_RXFIFO_OVF_INT_ST;
uart->status |= UART_STATUS_RXFIFO_OVF;
}
int read = std::min(space, avail);
if(read != 0) {
Expand All @@ -266,9 +265,9 @@ int CUart::serviceRead()
}
space -= read;
if(space == 0) {
uart->status |= UART_RXFIFO_FULL_INT_ST;
uart->status |= UART_STATUS_RXFIFO_FULL;
} else {
uart->status |= UART_RXFIFO_TOUT_INT_ST;
uart->status |= UART_STATUS_RXFIFO_TOUT;
}
}
}
Expand Down Expand Up @@ -306,7 +305,7 @@ int CUart::serviceWrite()
} while((avail = txbuf->getReadData(data)) != 0);

if(txbuf->isEmpty()) {
uart->status |= UART_TXFIFO_EMPTY_INT_ST;
uart->status |= UART_STATUS_TXFIFO_EMPTY;
} else {
txsem.post();
}
Expand Down
2 changes: 0 additions & 2 deletions Sming/Arch/Host/Components/esp_hal/component.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
COMPONENT_INCDIRS := include $(ESP8266_COMPONENTS)/esp8266/include

COMPONENT_DEPENDS := hostlib
4 changes: 0 additions & 4 deletions Sming/Arch/Host/Components/sming-arch/component.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
# EXCLUDE_LIBRARIES := Adafruit_ILI9341 Adafruit_NeoPixel Adafruit_PCD8544 Adafruit_SSD1306 \
# ArduCAM CapacitiveSensor IR MCP23S17 RF24 SDCard TFT_ILI9163C WS2812

# Eventually this will go, but for now we use some Esp8266 code
ESP8266_COMPONENTS := $(SMING_HOME)/Arch/Esp8266/Components
export ESP8266_COMPONENTS

COMPONENT_SRCDIRS := \
$(ARCH_CORE) $(call ListAllSubDirs,$(ARCH_CORE)) \
$(ARCH_BASE)/Platform \
Expand Down
2 changes: 0 additions & 2 deletions Sming/Arch/Host/Components/spi_flash/component.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
COMPONENT_INCDIRS += $(ESP8266_COMPONENTS)/spi_flash/include

COMPONENT_DEPENDS := IFS
5 changes: 2 additions & 3 deletions Sming/Arch/Host/Components/spi_flash/include/esp_spi_flash.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@

#pragma once

#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

#include <spi_flash.h>
#include <esp_attr.h>

#define INTERNAL_FLASH_SECTOR_SIZE 4096
#define INTERNAL_FLASH_START_ADDRESS 0x40200000

Expand Down

0 comments on commit 91e8514

Please sign in to comment.