From e99b87a269e8485348e477a1b36433829b342821 Mon Sep 17 00:00:00 2001 From: Jeroen Domburg Date: Sun, 4 Feb 2018 14:55:17 +0800 Subject: [PATCH] Add SPI LCD as menuconfig option, clean up scripts to flash ROM/HD --- components/tme-esp32/component.mk | 9 +++++++++ components/tme-esp32/spi_lcd.c | 2 -- flashhd.sh | 13 +++++++++++-- flashrom.sh | 15 ++++++++++++--- sdkconfig | 8 ++++++++ 5 files changed, 40 insertions(+), 7 deletions(-) diff --git a/components/tme-esp32/component.mk b/components/tme-esp32/component.mk index 0a6fdc9..2a46b34 100644 --- a/components/tme-esp32/component.mk +++ b/components/tme-esp32/component.mk @@ -1,2 +1,11 @@ #Component makefile +COMPONENT_SRCDIRS := . +COMPONENT_OBJS := hd.o hexdump.o localtalk.o main.o mpu6050.o mpumouse.o snd.o + +ifdef CONFIG_TME_DISP_MIPI +COMPONENT_OBJS += mipi_lcd.o adns9500.o +endif +ifdef CONFIG_TME_DISP_WROVER +COMPONENT_OBJS += spi_lcd.o +endif \ No newline at end of file diff --git a/components/tme-esp32/spi_lcd.c b/components/tme-esp32/spi_lcd.c index 632ccaf..b8abcd3 100644 --- a/components/tme-esp32/spi_lcd.c +++ b/components/tme-esp32/spi_lcd.c @@ -1,4 +1,3 @@ -#if 0 /* SPI Master example This example code is in the Public Domain (or CC0 licensed, at your option.) @@ -310,4 +309,3 @@ void dispInit() { xTaskCreatePinnedToCore(&displayTask, "display", 3000, NULL, 6, NULL, 1); #endif } -#endif \ No newline at end of file diff --git a/flashhd.sh b/flashhd.sh index 42dda8d..b577481 100755 --- a/flashhd.sh +++ b/flashhd.sh @@ -1,4 +1,13 @@ #!/bin/bash -#python /home/jeroen/esp8266/esp32/esp-idf/bin/esptool.py --chip esp32 --port "/dev/ttyUSB0" --baud 115200 write_flash -z -fs 32m 0x100000 doom1-cut.wad -python /home/jeroen/esp8266/esp32/esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port "/dev/ttyUSB0" --baud $((921600/2)) --before default_reset --after hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size detect 0x120000 $1 + +if [ -n "$1" ]; then + echo "Usage: $0 /dev/ttyUSBx hard_disk_file.bin" +fi + +PORT=/dev/ttyUSB1 +FILE=hard_disk.bin +if [ -n "$1" ]; then PORT=$1; fi +if [ -n "$2" ]; then FILE=$2; fi + +python $IDF_PATH/components/esptool_py/esptool/esptool.py --chip esp32 --port $PORT --baud $((921600/2)) --before default_reset --after hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size detect 0x120000 $FILE diff --git a/flashrom.sh b/flashrom.sh index 3c011a0..c8a96a1 100755 --- a/flashrom.sh +++ b/flashrom.sh @@ -1,5 +1,14 @@ #!/bin/bash -#python /home/jeroen/esp8266/esp32/esp-idf/bin/esptool.py --chip esp32 --port "/dev/ttyUSB0" --baud 115200 write_flash -z -fs 32m 0x100000 doom1-cut.wad -python /home/jeroen/esp8266/esp32/esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port "/dev/ttyUSB0" --baud $((921600/2)) --before default_reset --after hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size detect 0x100000 rom.bin -#python /home/jeroen/esp8266/esp32/esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port "/dev/ttyUSB0" --baud $((921600/2)) --before default_reset --after hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size detect 0x100000 rom320240.bin +if [ -n "$1" ]; then + echo "Usage: $0 mac_plus_rom.bin /dev/ttyUSBx" +fi + + +PORT=/dev/ttyUSB1 +FILE=rom.bin +if [ -n "$1" ]; then PORT=$1; fi +if [ -n "$2" ]; then FILE=$2; fi + + +python $IDF_DIR/components/esptool_py/esptool/esptool.py --chip esp32 --port $PORT --baud $((921600/2)) --before default_reset --after hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size detect 0x100000 $FILE diff --git a/sdkconfig b/sdkconfig index 3b5f53f..38a4c1a 100644 --- a/sdkconfig +++ b/sdkconfig @@ -339,6 +339,7 @@ CONFIG_LOG_COLORS=y # LWIP # CONFIG_L2_TO_L3_COPY= +CONFIG_LWIP_IRAM_OPTIMIZATION= CONFIG_LWIP_MAX_SOCKETS=10 CONFIG_LWIP_SO_REUSE= CONFIG_LWIP_SO_RCVBUF= @@ -509,6 +510,7 @@ CONFIG_SPIFFS_CACHE_STATS= CONFIG_SPIFFS_PAGE_CHECK=y CONFIG_SPIFFS_GC_MAX_RUNS=10 CONFIG_SPIFFS_GC_STATS= +CONFIG_SPIFFS_PAGE_SIZE=256 CONFIG_SPIFFS_OBJ_NAME_LEN=32 CONFIG_SPIFFS_USE_MAGIC=y CONFIG_SPIFFS_USE_MAGIC_LENGTH=y @@ -530,6 +532,12 @@ CONFIG_SPIFFS_TEST_VISUALISATION= # CONFIG_IP_LOST_TIMER_INTERVAL=120 +# +# Tiny Mac Emulator options +# +CONFIG_TME_DISP_MIPI=y +CONFIG_TME_DISP_WROVER= + # # Wear Levelling #