Skip to content

Commit 334a521

Browse files
78Cmdmac
authored andcommitted
Add esp32c5 configuration (78#1258)
* Add esp32c5 configuration * update idf_component.yml
1 parent 7f31f78 commit 334a521

File tree

5 files changed

+35
-11
lines changed

5 files changed

+35
-11
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ main/mmap_generate_emoji.h
1616
*.pyc
1717
*.bin
1818
mmap_generate_*.h
19+
.clangd

main/Kconfig.projbuild

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,10 @@ choice BOARD_TYPE
213213
depends on IDF_TARGET_ESP32S3
214214
config BOARD_TYPE_ESP32S3_Touch_AMOLED_2_06
215215
bool "Waveshare ESP32-S3-Touch-AMOLED-2.06"
216+
depends on IDF_TARGET_ESP32S3
216217
config BOARD_TYPE_ESP32S3_Touch_AMOLED_1_75
217218
bool "Waveshare ESP32-S3-Touch-AMOLED-1.75"
219+
depends on IDF_TARGET_ESP32S3
218220
config BOARD_TYPE_ESP32S3_Touch_LCD_4B
219221
bool "Waveshare ESP32-S3-Touch-LCD-4B"
220222
depends on IDF_TARGET_ESP32S3
@@ -367,6 +369,7 @@ choice BOARD_TYPE
367369
bool "StarkBoard"
368370
config BOARD_TYPE_JIUCHUAN
369371
bool "九川智能"
372+
depends on IDF_TARGET_ESP32S3
370373
config BOARD_TYPE_LABPLUS_MPYTHON_V3
371374
bool "labplus mpython_v3 board"
372375
depends on IDF_TARGET_ESP32S3
@@ -606,7 +609,7 @@ config RECEIVE_CUSTOM_MESSAGE
606609
help
607610
Enable custom message reception, allow the device to receive custom messages from the server (preferably through the MQTT protocol)
608611

609-
menu TAIJIPAI_S3_CONFIG
612+
menu "TAIJIPAI_S3_CONFIG"
610613
depends on BOARD_TYPE_ESP32S3_Taiji_Pi
611614
choice I2S_TYPE_TAIJIPI_S3
612615
prompt "taiji-pi-S3 I2S Type"

main/audio/codecs/es8311_audio_codec.cc

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,12 @@ Es8311AudioCodec::Es8311AudioCodec(void* i2c_master_handle, i2c_port_t i2c_port,
5050
es8311_cfg.hw_gain.codec_dac_voltage = 3.3;
5151
es8311_cfg.pa_reverted = pa_inverted_;
5252
codec_if_ = es8311_codec_new(&es8311_cfg);
53-
assert(codec_if_ != NULL);
5453

55-
ESP_LOGI(TAG, "Es8311AudioCodec initialized");
54+
if (codec_if_ == nullptr) {
55+
ESP_LOGE(TAG, "Failed to create Es8311AudioCodec");
56+
} else {
57+
ESP_LOGI(TAG, "Es8311AudioCodec initialized");
58+
}
5659
}
5760

5861
Es8311AudioCodec::~Es8311AudioCodec() {
@@ -157,6 +160,9 @@ void Es8311AudioCodec::SetOutputVolume(int volume) {
157160

158161
void Es8311AudioCodec::EnableInput(bool enable) {
159162
std::lock_guard<std::mutex> lock(data_if_mutex_);
163+
if (codec_if_ == nullptr) {
164+
return;
165+
}
160166
if (enable == input_enabled_) {
161167
return;
162168
}
@@ -166,6 +172,9 @@ void Es8311AudioCodec::EnableInput(bool enable) {
166172

167173
void Es8311AudioCodec::EnableOutput(bool enable) {
168174
std::lock_guard<std::mutex> lock(data_if_mutex_);
175+
if (codec_if_ == nullptr) {
176+
return;
177+
}
169178
if (enable == output_enabled_) {
170179
return;
171180
}

main/idf_component.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ dependencies:
1212
espressif/esp_lcd_st7796:
1313
version: 1.3.5
1414
rules:
15-
- if: target not in [esp32c3, esp32c6]
15+
- if: target in [esp32, esp32s2, esp32s3, esp32p4]
1616
espressif/esp_lcd_spd2010: ==1.0.2
1717
espressif/esp_io_expander_tca9554: ==2.0.0
1818
espressif/esp_lcd_panel_io_additions: ^1.0.1
1919
78/esp_lcd_nv3023: ~1.0.0
20-
78/esp-wifi-connect: ~2.5.2
20+
78/esp-wifi-connect: ~2.6.0
2121
78/esp-opus-encoder: ~2.4.1
2222
78/esp-ml307: ~3.3.6
2323
78/xiaozhi-fonts: ~1.5.3
@@ -39,7 +39,11 @@ dependencies:
3939
espressif2022/esp_emote_gfx: ^1.1.0
4040
espressif/adc_mic: ^0.2.1
4141
espressif/esp_mmap_assets: '>=1.2'
42-
txp666/otto-emoji-gif-component: ~1.0.2
42+
txp666/otto-emoji-gif-component:
43+
version: 1.0.2
44+
rules:
45+
- if: target not in [esp32c5]
46+
4347
espressif/adc_battery_estimation: ^0.2.0
4448

4549
# SenseCAP Watcher Board
@@ -48,11 +52,7 @@ dependencies:
4852
rules:
4953
- if: target in [esp32s3]
5054

51-
tny-robotics/sh1106-esp-idf:
52-
version: ^1.0.0
53-
rules:
54-
- if: idf_version >= "5.4.0"
55-
55+
tny-robotics/sh1106-esp-idf: ^1.0.0
5656
waveshare/esp_lcd_jd9365_10_1:
5757
version: '*'
5858
rules:

sdkconfig.defaults.esp32c5

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
3+
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
4+
5+
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
6+
7+
CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=3
8+
CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=6
9+
CONFIG_ESP_WIFI_RX_BA_WIN=3
10+
CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=16
11+
CONFIG_MBEDTLS_DYNAMIC_FREE_CONFIG_DATA=y

0 commit comments

Comments
 (0)