Skip to content

Commit

Permalink
more build changes
Browse files Browse the repository at this point in the history
  • Loading branch information
wizmo2 committed Oct 7, 2023
1 parent ba2711a commit 537d9f0
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 17 deletions.
10 changes: 6 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ include($ENV{IDF_PATH}/tools/cmake/project.cmake)

set(PROJECT_VER $ENV{PROJECT_VER})
add_definitions(-DMODEL_NAME=SqueezeESP32)
add_definitions(-DPURE=Y)
#add_definitions(-DDEPTH=32)
#add_definitions(-DNOPURE=Y) # THIS DOESNT SEEM TO DO ANYHTING!
#set(NOPURE Y) # This may work (but maybe not!)
#set(DEPTH 32) # Thies does work (?is it a number vrs string?)

if (DEFINED ${PURE})
if (NOT DEFINED NOPURE)
message(STATUS "*** PURE IS ENABLED ***")
message(STATUS "All BT, AirPlay, and CSpot must be disabled in menuconfig")
endif()
Expand Down Expand Up @@ -113,7 +114,8 @@ add_custom_target(_jtag_scripts ALL
COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_SOURCE_DIR}/generate_debug_scripts.cmake"
)

if(CMAKE_HOST_UNIX AND NOT DEFINED ${PURE})
if(CMAKE_HOST_UNIX AND DEFINED NOPURE)
message(STATUS "*** PURE is NOT Defined for UNIX")
# Add custom target to set executable permissions before build for cspot component
add_custom_target(set_cspot_permissions
COMMAND ${CMAKE_COMMAND} -E echo "************************************************************************************************"
Expand Down
5 changes: 2 additions & 3 deletions components/platform_console/platform_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,14 +326,14 @@ void initialize_console() {
#else
#error Unsupported console type
#endif
#if defined(CONFIG_ESP_CONSOLE_UART_DEFAULT)
/* TODO: TELNET AND REDIRECT NOT WORKING ON S3/USB_JTAG CONFIGURATION*/
/* re-direct stdin to our own driver so we can gather data from various sources */
stdin_redir.queue_set = xQueueCreateSet(2);
stdin_redir.handle = xRingbufferCreateStatic(sizeof(stdin_redir._buf), RINGBUF_TYPE_BYTEBUF, stdin_redir._buf, &stdin_redir._ringbuf);
xRingbufferAddToQueueSetRead(stdin_redir.handle, stdin_redir.queue_set);
#if defined(CONFIG_ESP_CONSOLE_UART_DEFAULT)
xQueueAddToSet(uart_queue, stdin_redir.queue_set);
#endif
esp_vfs_t vfs = { };
vfs.flags = ESP_VFS_FLAG_DEFAULT;
vfs.open = stdin_dummy;
Expand All @@ -344,7 +344,6 @@ void initialize_console() {

/* Disable buffering on stdin */
setvbuf(stdin, NULL, _IONBF, 0);
#endif
/* Initialize the console */
esp_console_config_t console_config = { .max_cmdline_args = 28,
.max_cmdline_length = 600,
Expand Down
2 changes: 1 addition & 1 deletion components/raop/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if (DEFINED ${PURE})
if (NOT DEFINED NOPURE)
message(STATUS "*** PURE: Skipping airplay (raop) ***")
return()
endif()
Expand Down
4 changes: 2 additions & 2 deletions components/spotify/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# this must be set *before* idf_component_register
if (DEFINED ${PURE})
message(STATUS "*** PURE: Skipping spotify (cspot)")
if (NOT DEFINED NOPURE)
message(STATUS "*** PURE: Skipping spotify (cspot) ***")
return()
endif()

Expand Down
10 changes: 7 additions & 3 deletions components/squeezelite/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ if(IDF_TARGET STREQUAL "esp32")
set(bt_requires "driver_bt")
endif()

if(DEFINED PURE)
unset(bt_requires)
else()
# runs prelink with no dfinition, then with definition.
message(STATUS "*** Squeezelite: NOPURE is ${NOPURE} ***")
if (DEFINED NOPURE)
message(STATUS "*** Squeezelite: PURE is NOT defined ***")
set(cspot_required "spotify")
set(airplay_required "raop")
else()
message(STATUS "*** Squeezelite: PURE is defined ***")
endif()

idf_component_register( SRC_DIRS . external ac101 tas57xx wm8978
Expand Down Expand Up @@ -42,6 +45,7 @@ set_source_files_properties(wm8978/wm8978.c

add_definitions(-DLINKALL -DLOOPBACK -DNO_FAAD -DEMBEDDED -DTREMOR_ONLY -DCUSTOM_VERSION=${BUILD_NUMBER})

message(STATUS "*** Squeezelite: DEPTH is ${DEPTH} ***")
if (${DEPTH} EQUAL "32")
add_definitions(-DBYTES_PER_FRAME=8)
else()
Expand Down
12 changes: 8 additions & 4 deletions merge_output.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
echo BOutpu
C:\Users\Mike\.espressif\python_env\idf4.4_py3.8_env\Scripts\python.exe^
C:\Users\Mike\esp\esp-idf\components\esptool_py\esptool\esptool.py^
set PYTHON=C:\Users\Mike\.espressif\python_env\idf4.4_py3.8_env\Scripts\python.exe
set IDF_PATH=C:\Users\Mike\esp\esp-idf
%PYTHON% %IDF_PATH%\tools\idf.py build -DDEPTH16
%PYTHON% %IDF_PATH%\components\esptool_py\esptool\esptool.py^
--chip esp32s3 merge_bin -o build/output.bin^
--flash_mode dio --flash_freq 40m --flash_size 4MB 0x0 build/bootloader/bootloader.bin 0x10000 build/recovery.bin 0x8000 build/partition_table/partition-table.bin 0xd000 build/ota_data_initial.bin 0x150000 build/squeezelite.bin
--flash_mode dio --flash_freq 40m --flash_size 4MB^
0x0 build/bootloader/bootloader.bin 0x10000 build/recovery.bin 0x8000 build/partition_table/partition-table.bin 0xd000 build/ota_data_initial.bin 0x150000 build/squeezelite.bin
copy "build\output.bin" "C:\Users\Mike\Documents\TAudio-case\builds\squeezelite-tembed.esp32s3.16.bin"
@rem %PYTHON% %IDF_PATH%\tools\idf_monitor.py -p COM7 -b 115200 --toolchain-prefix xtensa-esp32s3-elf- --target esp32s3 build\recovery.elf
5 changes: 5 additions & 0 deletions sdkconfig
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,12 @@ CONFIG_I2C_CONFIG=""
#
# end of Battery measure

#
# Command sets
#
CONFIG_DEFAULT_COMMAND_LINE="squeezelite -o I2S -b 500:2000 -d all=info -C 30 -W"
CONFIG_DEFAULT_COMMAND_2_LINE="squeezelite -o spdif -b 500:2000 -d all=info -C 30"
# end of Command sets
# end of Squeezelite-ESP32

#
Expand Down

0 comments on commit 537d9f0

Please sign in to comment.