Skip to content

Commit 86dd709

Browse files
authored
Merge branch 'espressif:master' into feature/resistive_touch
2 parents 65bec0d + 611cca2 commit 86dd709

File tree

39 files changed

+3132
-1064
lines changed

39 files changed

+3132
-1064
lines changed

.gitlab-ci.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,28 +30,38 @@ before_script:
3030
artifacts:
3131
when: always
3232
paths:
33-
- $BUILD_PATH/*/*/build/*.bin
34-
- $BUILD_PATH/*/*/build/*.elf
35-
- $BUILD_PATH/*/*/build/*.map
36-
- $BUILD_PATH/*/*/build/download.config
37-
- $BUILD_PATH/*/*/build/bootloader/*.bin
38-
- $LOG_PATH
33+
- $BUILD_PATH/*/*/*/build/*.bin
34+
- $BUILD_PATH/*/*/*/build/*/*.bin
35+
- $BUILD_PATH/*/*/*/build/*.json
36+
- $BUILD_PATH/*.json
37+
- $LOG_PATH/*
3938
expire_in: 1 week
4039
variables:
4140
IDF_CI_BUILD: "1"
4241
LOG_PATH: "$CI_PROJECT_DIR/log_examples"
4342
BUILD_PATH: "$CI_PROJECT_DIR/build_examples"
43+
SIZE_INFO_LOCATION: "$CI_PROJECT_DIR/log_examples/size_info.txt"
44+
PEDANTIC_CFLAGS: ""
45+
PEDANTIC_CXXFLAGS: ""
4446
script:
4547
# it's not possible to build 100% out-of-tree and have the "artifacts"
4648
# mechanism work, but this is the next best thing
4749
- rm -rf ${BUILD_PATH}
48-
- mkdir ${BUILD_PATH}
49-
- mkdir -p ${LOG_PATH}
5050
# build some of examples
51-
- ${IOT_SOLUTION_PATH}/tools/ci/build_examples.sh "${CI_JOB_NAME}"
51+
- python ${IOT_SOLUTION_PATH}/tools/ci/genarate_build_json.py
52+
- ${IOT_SOLUTION_PATH}/tools/ci/build_examples.sh
5253

53-
build_examples_00:
54+
build_examples_00_with_idf_v4.2:
5455
<<: *build_examples_template
56+
image: espressif/idf:release-v4.2
57+
58+
build_examples_00_with_idf_v4.3:
59+
<<: *build_examples_template
60+
image: espressif/idf:release-v4.3
61+
62+
build_examples_00_with_idf_v4.4:
63+
<<: *build_examples_template
64+
image: espressif/idf:release-v4.4
5565

5666
build_docs:
5767
stage: build

.readthedocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ formats:
1414
python:
1515
version: 3.7
1616
install:
17+
- requirements: docs/setuptools.requirements.txt
1718
- requirements: docs/requirements.txt

components/audio/dac_audio/dac_audio.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,11 @@ esp_err_t dac_audio_init(dac_audio_config_t *cfg)
154154
i2s_config.mode = I2S_MODE_MASTER | I2S_MODE_TX | I2S_MODE_DAC_BUILT_IN;
155155
i2s_config.sample_rate = cfg->sample_rate;
156156
i2s_config.bits_per_sample = cfg->bits_per_sample;
157+
#if (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(4, 2, 0))
158+
i2s_config.communication_format = I2S_COMM_FORMAT_I2S_MSB;
159+
#else
157160
i2s_config.communication_format = I2S_COMM_FORMAT_STAND_MSB;
161+
#endif
158162
if (I2S_DAC_CHANNEL_RIGHT_EN == cfg->dac_mode) {
159163
i2s_config.channel_format = I2S_CHANNEL_FMT_ALL_RIGHT;
160164
} else if (I2S_DAC_CHANNEL_LEFT_EN == cfg->dac_mode) {

components/audio/pwm_audio/pwm_audio.c

Lines changed: 20 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include "pwm_audio.h"
3030
#include "sdkconfig.h"
3131

32-
#if (CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32)
32+
#if (CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S3)
3333

3434
static const char *TAG = "pwm_audio";
3535

@@ -121,7 +121,7 @@ static esp_err_t rb_destroy(ringbuf_handle_t *rb)
121121
rb = NULL;
122122
return ESP_OK;
123123
}
124-
static ringbuf_handle_t* rb_create(uint32_t size)
124+
static ringbuf_handle_t *rb_create(uint32_t size)
125125
{
126126
if (size < (BUFFER_MIN_SIZE << 2)) {
127127
ESP_LOGE(TAG, "Invalid buffer size, Minimum = %d", (int32_t)(BUFFER_MIN_SIZE << 2));
@@ -260,31 +260,13 @@ static void IRAM_ATTR timer_group_isr(void *para)
260260
if (handle == NULL) {
261261
return;
262262
}
263-
264-
#ifdef CONFIG_IDF_TARGET_ESP32S2
265-
266263
/* Clear the interrupt */
267-
if ((handle->timg_dev)->int_st.val & BIT(handle->config.timer_num)) {
268-
(handle->timg_dev)->int_clr.val |= (1UL << handle->config.timer_num);
264+
if (REG_GET_BIT(TIMG_INT_ST_TIMERS_REG(handle->config.timer_num), BIT(handle->config.timer_num))) {
265+
REG_SET_BIT(TIMG_INT_CLR_TIMERS_REG(handle->config.timer_num), BIT(handle->config.timer_num));
269266
}
270-
271267
/* After the alarm has been triggered
272-
we need enable it again, so it is triggered the next time */
273-
handle->timg_dev->hw_timer[handle->config.timer_num].config.alarm_en = TIMER_ALARM_EN;
274-
#endif /**< CONFIG_IDF_TARGET_ESP32S2 */
275-
276-
#ifdef CONFIG_IDF_TARGET_ESP32
277-
278-
/* Clear the interrupt */
279-
if (handle->timg_dev->int_st_timers.val & BIT(handle->config.timer_num)) {
280-
handle->timg_dev->int_clr_timers.val |= (1UL << handle->config.timer_num);
281-
}
282-
283-
/* After the alarm has been triggered
284-
we need enable it again, so it is triggered the next time */
285-
handle->timg_dev->hw_timer[handle->config.timer_num].config.alarm_en = TIMER_ALARM_EN;
286-
287-
#endif /**< CONFIG_IDF_TARGET_ESP32 */
268+
we need enable it again, so it is triggered the next time */
269+
REG_SET_BIT(TIMG_T0CONFIG_REG(handle->config.timer_num), TIMG_T0_ALARM_EN_M);
288270

289271
static uint8_t wave_h, wave_l;
290272
static uint16_t value;
@@ -557,7 +539,7 @@ esp_err_t pwm_audio_set_param(int rate, ledc_timer_bit_t bits, int ch)
557539
timer_set_counter_value(handle->config.tg_num, handle->config.timer_num, 0x00000000ULL);
558540

559541
/* Configure the alarm value and the interrupt on alarm. */
560-
uint32_t divider = handle->timg_dev->hw_timer[handle->config.timer_num].config.divider;
542+
uint32_t divider = REG_GET_FIELD(TIMG_T0CONFIG_REG(handle->config.timer_num), TIMG_T0_DIVIDER);
561543
timer_set_alarm_value(handle->config.tg_num, handle->config.timer_num, (TIMER_BASE_CLK / divider) / handle->framerate);
562544
// timer_enable_intr(handle->config.tg_num, handle->config.timer_num);
563545
return res;
@@ -572,7 +554,7 @@ esp_err_t pwm_audio_set_sample_rate(int rate)
572554

573555
pwm_audio_data_t *handle = g_pwm_audio_handle;
574556
handle->framerate = rate;
575-
uint32_t divider = handle->timg_dev->hw_timer[handle->config.timer_num].config.divider;
557+
uint32_t divider = REG_GET_FIELD(TIMG_T0CONFIG_REG(handle->config.timer_num), TIMG_T0_DIVIDER);
576558
res = timer_set_alarm_value(handle->config.tg_num, handle->config.timer_num, (TIMER_BASE_CLK / divider) / handle->framerate);
577559
return res;
578560
}
@@ -751,10 +733,12 @@ esp_err_t pwm_audio_start(void)
751733

752734
/**< timer enable interrupt */
753735
portENTER_CRITICAL_SAFE(&timer_spinlock);
754-
handle->timg_dev->int_ena.val |= BIT(handle->config.timer_num);
755-
handle->timg_dev->hw_timer[handle->config.timer_num].config.enable = 1;
756-
handle->timg_dev->hw_timer[handle->config.timer_num].config.alarm_en = TIMER_ALARM_EN; /** Make sure the interrupt is enabled*/
757-
handle->timg_dev->hw_timer[handle->config.timer_num].config.level_int_en = 1;
736+
REG_SET_BIT(TIMG_INT_ENA_TIMERS_REG(handle->config.timer_num), BIT(handle->config.timer_num));
737+
REG_SET_BIT(TIMG_T0CONFIG_REG(handle->config.timer_num), TIMG_T0_EN_M);
738+
REG_SET_BIT(TIMG_T0CONFIG_REG(handle->config.timer_num), TIMG_T0_ALARM_EN_M);
739+
#ifdef TIMG_T0_LEVEL_INT_EN_M
740+
REG_SET_BIT(TIMG_T0CONFIG_REG(handle->config.timer_num), TIMG_T0_LEVEL_INT_EN_M);
741+
#endif
758742
portEXIT_CRITICAL_SAFE(&timer_spinlock);
759743

760744
res = timer_start(handle->config.tg_num, handle->config.timer_num);
@@ -770,9 +754,12 @@ esp_err_t pwm_audio_stop(void)
770754
/**< just disable timer ,keep pwm output to reduce switching nosie */
771755
/**< timer disable interrupt */
772756
portENTER_CRITICAL_SAFE(&timer_spinlock);
773-
handle->timg_dev->hw_timer[handle->config.timer_num].config.enable = 0;
774-
handle->timg_dev->int_ena.val &= (~BIT(handle->config.timer_num));
775-
handle->timg_dev->hw_timer[handle->config.timer_num].config.level_int_en = 0;
757+
REG_CLR_BIT(TIMG_INT_ENA_TIMERS_REG(handle->config.timer_num), BIT(handle->config.timer_num));
758+
REG_CLR_BIT(TIMG_T0CONFIG_REG(handle->config.timer_num), TIMG_T0_EN_M);
759+
REG_CLR_BIT(TIMG_T0CONFIG_REG(handle->config.timer_num), TIMG_T0_ALARM_EN_M);
760+
#ifdef TIMG_T0_LEVEL_INT_EN_M
761+
REG_CLR_BIT(TIMG_T0CONFIG_REG(handle->config.timer_num), TIMG_T0_LEVEL_INT_EN_M);
762+
#endif
776763
portEXIT_CRITICAL_SAFE(&timer_spinlock);
777764

778765
// timer_pause(handle->config.tg_num, handle->config.timer_num);

0 commit comments

Comments
 (0)