migrating to esp-idf V4.0 gcc 8.2 and CMake

This commit is contained in:
Sebastien
2020-03-06 16:43:56 -05:00
parent f998ea2a52
commit 562bec14fe
77 changed files with 2002 additions and 2802 deletions

View File

@@ -0,0 +1,27 @@
idf_component_register(SRCS link_helper.c
INCLUDE_DIRS . ./inc inc/alac inc/faad2 inc/FLAC inc/helix-aac inc/mad inc/ogg inc/opus inc/opusfile inc/resample16 inc/soxr inc/vorbis
REQUIRES esp_common platform_config
PRIV_REQUIRES freertos bt nvs_flash esp32 spi_flash newlib log console pthread
)
add_prebuilt_library(libmad lib/libmad.a)
add_prebuilt_library(libesp-flac lib/libesp-flac.a )
add_prebuilt_library(libhelix-aac lib/libhelix-aac.a )
add_prebuilt_library(libvorbisidec lib/libvorbisidec.a )
add_prebuilt_library(libogg lib/libogg.a )
add_prebuilt_library(libalac lib/libalac.a )
add_prebuilt_library(libremple16 lib/libresample16.a )
add_prebuilt_library(libsoxr lib/libsoxr.a )
add_prebuilt_library(libopusfile lib/libopusfile.a )
add_prebuilt_library(libopus lib/libopus.a )
target_link_libraries(${COMPONENT_LIB} PRIVATE libmad)
target_link_libraries(${COMPONENT_LIB} PRIVATE libesp-flac)
target_link_libraries(${COMPONENT_LIB} PRIVATE libhelix-aac)
target_link_libraries(${COMPONENT_LIB} PRIVATE libvorbisidec)
target_link_libraries(${COMPONENT_LIB} PRIVATE libogg)
target_link_libraries(${COMPONENT_LIB} PRIVATE libalac)
target_link_libraries(${COMPONENT_LIB} PRIVATE libremple16)
target_link_libraries(${COMPONENT_LIB} PRIVATE libsoxr)
target_link_libraries(${COMPONENT_LIB} PRIVATE libopusfile)
target_link_libraries(${COMPONENT_LIB} PRIVATE libopus)

View File

@@ -35,8 +35,8 @@
#include "export.h"
#include "assert.h"
#include "callback.h"
#include "flac_assert.h"
#include "format.h"
#include "metadata.h"
#include "ordinals.h"

View File

@@ -0,0 +1,3 @@
void dummy_obj() {
return;
}

View File

@@ -1,6 +0,0 @@
idf_component_register(SRCS "display.c" "SH1106.c" "SSD1306.c" "SSD132x.c" "core/ifaces/default_if_i2c.c" "core/ifaces/default_if_spi.c" "core/gds_draw.c" "core/gds_font.c" "core/gds_image.c" "core/gds_text.c" "core/gds.c" "fonts/font_droid_sans_fallback_11x13.c" "fonts/font_droid_sans_fallback_15x17.c" "fonts/font_droid_sans_fallback_24x28.c" "fonts/font_droid_sans_mono_13x24.c" "fonts/font_droid_sans_mono_16x31.c" "fonts/font_droid_sans_mono_7x13.c"
INCLUDE_DIRS . fonts core
)

View File

@@ -1,6 +0,0 @@
idf_component_register(SRCS "bt_app_core.c" "bt_app_sink.c" "bt_app_source.c"
INCLUDE_DIRS "." "../tools/"
REQUIRES esp_common
PRIV_REQUIRES freertos bt nvs_flash esp32 spi_flash newlib log console pthread
)

View File

@@ -0,0 +1,8 @@
idf_component_register(SRCS platform_bt_core.c
platform_bt_sink.c
platform_bt_source.c
INCLUDE_DIRS .
REQUIRES bt platform_display esp_common freertos nvs_flash esp32 spi_flash newlib log pthread platform_config
)

View File

@@ -6,8 +6,9 @@
CONDITIONS OF ANY KIND, either express or implied.
*/
#include "platform_bt_core.h"
#include <stdint.h>
#include "bt_app_core.h"
#include "esp_system.h"
#include <string.h>
#include <stdbool.h>

View File

@@ -7,14 +7,13 @@
CONDITIONS OF ANY KIND, either express or implied.
*/
#include <platform_bt_sink.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include "esp_log.h"
#include "bt_app_core.h"
#include "bt_app_sink.h"
#include "esp_bt.h"
#include "esp_bt_main.h"
#include "esp_bt_device.h"
@@ -29,6 +28,7 @@
#include "audio_controls.h"
#include "sys/lock.h"
#include "display.h"
#include "platform_bt_core.h"
// AVRCP used transaction label
#define APP_RC_CT_TL_GET_CAPS (0)
@@ -231,6 +231,7 @@ void bt_app_rc_ct_cb(esp_avrc_ct_cb_event_t event, esp_avrc_ct_cb_param_t *param
switch (event) {
case ESP_AVRC_CT_METADATA_RSP_EVT:
bt_app_alloc_meta_buffer(param);
/* no break */
/* fall through */
case ESP_AVRC_CT_CONNECTION_STATE_EVT:
case ESP_AVRC_CT_PASSTHROUGH_RSP_EVT:

View File

@@ -10,7 +10,7 @@
#define __BT_APP_SINK_H__
#include <stdint.h>
#include <platform_bt_core.h>
typedef enum { BT_SINK_CONNECTED, BT_SINK_DISCONNECTED, BT_SINK_AUDIO_STARTED, BT_SINK_AUDIO_STOPPED, BT_SINK_PLAY, BT_SINK_STOP, BT_SINK_PAUSE,
BT_SINK_RATE, BT_SINK_VOLUME, BT_SINK_METADATA, BT_SINK_PROGRESS } bt_sink_cmd_t;

View File

@@ -15,8 +15,8 @@
#include "esp_wifi.h"
#include "freertos/timers.h"
#include "argtable3/argtable3.h"
#include "platform_bt_core.h"
#include "platform_config.h"
#include "bt_app_core.h"
#include "trace.h"
static const char * TAG = "platform";

View File

@@ -1,7 +1,7 @@
idf_component_register(SRCS "nvs_utilities.c" "platform_config.c"
INCLUDE_DIRS .
INCLUDE_DIRS . ../tools/
REQUIRES nvs_flash json platform_console services vfs
REQUIRES newlib nvs_flash json platform_console services vfs
)

View File

@@ -2,6 +2,7 @@
#include <stdio.h>
#include <string.h>
#include "nvs.h"
#include "assert.h"
#ifdef __cplusplus
extern "C" {

View File

@@ -2,6 +2,6 @@ set(COMPONENT_ADD_INCLUDEDIRS .)
set(COMPONENT_SRCS "platform_console.c" "cmd_ota.c" "cmd_nvs.c" "cmd_i2ctools.c" "cmd_squeezelite.c" "cmd_system.c" "cmd_wifi.c" )
set(COMPONENT_REQUIRES console nvs_flash spi_flash app_update platform_config vfs pthread wifi-manager)
set(COMPONENT_REQUIRES squeezelite console nvs_flash spi_flash app_update platform_config vfs pthread wifi-manager)
register_component()

View File

@@ -0,0 +1,33 @@
idf_component_register(SRCS display.c
SH1106.c
SSD1306.c
SSD132x.c
core/ifaces/default_if_i2c.c
core/ifaces/default_if_spi.c
core/gds_draw.c
core/gds_font.c
core/gds_image.c
core/gds_text.c
core/gds.c
fonts/font_droid_sans_fallback_11x13.c
fonts/font_droid_sans_fallback_15x17.c
fonts/font_droid_sans_fallback_24x28.c
fonts/font_droid_sans_mono_13x24.c
fonts/font_droid_sans_mono_16x31.c
fonts/font_droid_sans_mono_7x13.c
fonts/font_liberation_mono_13x21.c
fonts/font_liberation_mono_17x30.c
fonts/font_liberation_mono_9x15.c
fonts/font_line_1.c
fonts/font_line_2.c
fonts/font_tarable7seg_16x32.c
fonts/font_tarable7seg_32x64.c
PRIV_REQUIRES services
INCLUDE_DIRS . fonts core
)
set_source_files_properties(display.c
PROPERTIES COMPILE_FLAGS
-Wno-format-overflow
)

View File

@@ -266,6 +266,6 @@ void GDS_DrawBitmapCBR(struct GDS_Device* Device, uint8_t *Data, int Width, int
}
*/
}
Device->Dirty = true;
}
}

View File

@@ -118,7 +118,7 @@ struct GDS_Device {
bool GDS_Reset( struct GDS_Device* Device );
inline bool IsPixelVisible( struct GDS_Device* Device, int x, int y ) {
static inline bool IsPixelVisible( struct GDS_Device* Device, int x, int y ) {
bool Result = (
( x >= 0 ) &&
( x < Device->Width ) &&
@@ -135,7 +135,7 @@ inline bool IsPixelVisible( struct GDS_Device* Device, int x, int y ) {
return Result;
}
inline void IRAM_ATTR GDS_DrawPixel1Fast( struct GDS_Device* Device, int X, int Y, int Color ) {
static inline void IRAM_ATTR GDS_DrawPixel1Fast( struct GDS_Device* Device, int X, int Y, int Color ) {
uint32_t YBit = ( Y & 0x07 );
uint8_t* FBOffset = NULL;
@@ -156,23 +156,23 @@ inline void IRAM_ATTR GDS_DrawPixel1Fast( struct GDS_Device* Device, int X, int
}
}
inline void IRAM_ATTR GDS_DrawPixel4Fast( struct GDS_Device* Device, int X, int Y, int Color ) {
static inline void IRAM_ATTR GDS_DrawPixel4Fast( struct GDS_Device* Device, int X, int Y, int Color ) {
uint8_t* FBOffset;
FBOffset = Device->Framebuffer + ( (Y * Device->Width >> 1) + (X >> 1));
*FBOffset = X & 0x01 ? (*FBOffset & 0x0f) | (Color << 4) : ((*FBOffset & 0xf0) | Color);
}
inline void IRAM_ATTR GDS_DrawPixelFast( struct GDS_Device* Device, int X, int Y, int Color ) {
static inline void IRAM_ATTR GDS_DrawPixelFast( struct GDS_Device* Device, int X, int Y, int Color ) {
if (Device->DrawPixelFast) Device->DrawPixelFast( Device, X, Y, Color );
else if (Device->Depth == 4) GDS_DrawPixel4Fast( Device, X, Y, Color);
else if (Device->Depth == 1) GDS_DrawPixel1Fast( Device, X, Y, Color);
}
inline void IRAM_ATTR GDS_DrawPixel( struct GDS_Device* Device, int x, int y, int Color ) {
static inline void IRAM_ATTR GDS_DrawPixel( struct GDS_Device* Device, int x, int y, int Color ) {
if ( IsPixelVisible( Device, x, y ) == true ) {
GDS_DrawPixelFast( Device, x, y, Color );
}
}
#endif
#endif

View File

@@ -211,7 +211,7 @@ static void displayer_task(void *args) {
scroll_sleep -= sleep;
vTaskDelay(sleep / portTICK_PERIOD_MS);
}
}
}
/****************************************************************************************
*

View File

@@ -0,0 +1,6 @@
idf_component_register(SRCS dmap_parser.c raop_sink.c raop.c rtp.c util.c
INCLUDE_DIRS .
REQUIRES newlib platform_config services codecs tools
PRIV_REQUIRES platform_display
)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,65 @@
idf_component_register(SRCS "alac.c"
"buffer.c"
"controls.c"
"decode_external.c"
"decode.c"
"display.c"
"embedded.c"
"flac.c"
"helix-aac.c"
"mad.c"
"main.c"
"mpg.c"
"opus.c"
"output_bt.c"
"output_embedded.c"
"output_i2s.c"
"output_pack.c"
"output_visu.c"
"output.c"
"pcm.c"
"process.c"
"resample.c"
"resample16.c"
"slimproto.c"
"stream.c"
"utils.c"
"vorbis.c"
"a1s/ac101.c"
"tas57xx/dac_57xx.c"
"external/dac_external.c"
INCLUDE_DIRS . a1s
REQUIRES newlib
esp_common
esp-dsp
platform_display
platform_config
platform_bluetooth
codecs
services
raop
)
set_source_files_properties(mad.c
PROPERTIES COMPILE_FLAGS
-Wno-maybe-uninitialized
)
set_source_files_properties(pcm.c
PROPERTIES COMPILE_FLAGS
-Wno-maybe-uninitialized
)
set_source_files_properties(flac.c
PROPERTIES COMPILE_FLAGS
-Wno-maybe-uninitialized
)
add_definitions(-O3 -DLINKALL -DLOOPBACK -DNO_FAAD -DRESAMPLE16 -DEMBEDDED -DTREMOR_ONLY -DBYTES_PER_FRAME=4)
#add_library(platform_bluetooth STATIC IMPORTED GLOBAL)
#set_property(TARGET platform_bt PROPERTY IMPORTED_LOCATION "${COMPONENT_DIR}/../freetype/libfreetype.a")
#add_library(platform_bluetooth STATIC IMPORTED GLOBAL)
#set_property(TARGET platform_bluetooth PROPERTY IMPORTED_LOCATION "../platform_bluetooth/platform_bluetooth.a")
#target_link_libraries(${COMPONENT_TARGET} PUBLIC platform_bluetooth)

View File

@@ -13,7 +13,7 @@ CFLAGS += -O3 -DLINKALL -DLOOPBACK -DNO_FAAD -DRESAMPLE16 -DEMBEDDED -DTREMOR_ON
-I$(COMPONENT_PATH)/../tools \
-I$(COMPONENT_PATH)/../codecs/inc/opus \
-I$(COMPONENT_PATH)/../codecs/inc/opusfile \
-I$(COMPONENT_PATH)/../driver_bt \
-I$(COMPONENT_PATH)/../platform_bluetooth \
-I$(COMPONENT_PATH)/../raop \
-I$(COMPONENT_PATH)/../services

View File

@@ -21,9 +21,9 @@
#include "platform_config.h"
#include "squeezelite.h"
#include "bt_app_sink.h"
#include "raop_sink.h"
#include <math.h>
#include <platform_bt_sink.h>
#define LOCK_O mutex_lock(outputbuf->mutex)
#define UNLOCK_O mutex_unlock(outputbuf->mutex)

View File

@@ -1,6 +1,6 @@
#ifndef EMBEDDED_H
#define EMBEDDED_H
#include <ctype.h>
#include <inttypes.h>
/* must provide
@@ -20,6 +20,9 @@
#ifndef PTHREAD_STACK_MIN
#define PTHREAD_STACK_MIN 256
#endif
#ifndef _CONST
#define _CONST
#endif
#define STREAM_THREAD_STACK_SIZE 6 * 1024
#define DECODE_THREAD_STACK_SIZE 16 * 1024

View File

@@ -18,11 +18,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "driver/gpio.h"
#include "squeezelite.h"
#include "perf_trace.h"
#include "platform_config.h"
#include <assert.h>
extern struct outputstate output;
extern struct buffer *outputbuf;
@@ -196,3 +197,4 @@ void output_bt_tick(void) {
RESET_ALL_MIN_MAX;
}
}

View File

@@ -1,5 +1,4 @@
idf_component_register(SRCS "telnet.c"
INCLUDE_DIRS .
INCLUDE_DIRS . ../tools/
idf_component_register(SRCS "telnet.c" "libtelnet/libtelnet.c"
INCLUDE_DIRS . libtelnet
REQUIRES platform_config services
)

View File

@@ -18,9 +18,9 @@
* https://github.com/PocketSprite/8bkc-sdk/blob/master/8bkc-components/8bkc-hal/vfs-stdout.c
*
*/
#include <stdlib.h> // Required for CONFIG_PTHREAD_TASK_PRIO_DEFAULT.h
#include <stdlib.h> // Required for libtelnet.h
#include <esp_log.h>
#include "CONFIG_PTHREAD_TASK_PRIO_DEFAULT.h"
#include "libtelnet.h"
#include "stdbool.h"
#include <lwip/def.h>
#include <lwip/sockets.h>
@@ -35,7 +35,7 @@
#include "esp_attr.h"
#include "soc/uart_struct.h"
#include "driver/uart.h"
#include "platform_config.h"
#include "config.h"
#include "nvs_utilities.h"
#include "platform_esp32.h"

View File

@@ -1,7 +1,6 @@
idf_component_register(SRCS "dns_server.c" "http_server.c" "wifi_manager.c"
INCLUDE_DIRS .
REQUIRES esp_common newlib freertos spi_flash nvs_flash mdns pthread wpa_supplicant platform_console squeezelite-ota
EMBED_FILES style.css code.js index.html bootstrap.min.css.gz jquery.min.js.gz popper.min.js.gz bootstrap.min.js.gz