Skip to content

Commit

Permalink
feat(pwm_audio): publish official version
Browse files Browse the repository at this point in the history
1. add test-apps
  • Loading branch information
lijunru-hub committed Oct 28, 2024
1 parent a4894c5 commit 4c185ba
Show file tree
Hide file tree
Showing 29 changed files with 8,164 additions and 8,096 deletions.
8 changes: 8 additions & 0 deletions .gitlab/ci/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,14 @@ build_example_utilities_xz_decompress_file:
variables:
EXAMPLE_DIR: examples/utilities/xz_decompress_file

build_components_audio_pwm_audio_test_apps:
extends:
- .build_examples_template
- .rules:build:component_audio_pwm_audio_test_apps
- .build_idf_active_release_version
variables:
EXAMPLE_DIR: components/audio/pwm_audio/test_apps

build_components_avi_player_test_apps:
extends:
- .build_examples_template
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/ci/rules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1429,7 +1429,7 @@
- <<: *if-dev-push
changes: *patterns-components_audio_dac_audio

.rules:build:component_audio_pwm_audio_test:
.rules:build:component_audio_pwm_audio_test_apps:
rules:
- <<: *if-protected
- <<: *if-label-build
Expand Down
4 changes: 4 additions & 0 deletions components/.build-rules.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
components/audio/pwm_audio/test_apps:
enable:
- if: INCLUDE_DEFAULT == 1

components/avi_player/test_apps:
enable:
- if: IDF_TARGET in ["esp32s3", "esp32p4"]
Expand Down
6 changes: 6 additions & 0 deletions components/audio/pwm_audio/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# ChangeLog

## v1.1.2 - 2024-08-15

### Enhancements:

* Add test-apps.

## v1.1.1 - 2023-03-20

### Bug Fixes:
Expand Down
2 changes: 1 addition & 1 deletion components/audio/pwm_audio/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "1.1.1"
version: "1.1.2"
description: PWM audio output driver for ESP32 series Socs
url: https://github.com/espressif/esp-iot-solution/tree/master/components/audio/pwm_audio
repository: https://github.com/espressif/esp-iot-solution.git
Expand Down
28 changes: 22 additions & 6 deletions components/audio/pwm_audio/pwm_audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,12 +475,28 @@ esp_err_t pwm_audio_init(const pwm_audio_config_t *cfg)
/**
* Get the address of LEDC register to reduce the addressing time
*/
g_ledc_left_duty_val = &LEDC.channel_group[handle->ledc_timer.speed_mode].channel[handle->ledc_channel[CHANNEL_LEFT_INDEX].channel].duty.val;
g_ledc_left_conf0_val = &LEDC.channel_group[handle->ledc_timer.speed_mode].channel[handle->ledc_channel[CHANNEL_LEFT_INDEX].channel].conf0.val;
g_ledc_left_conf1_val = &LEDC.channel_group[handle->ledc_timer.speed_mode].channel[handle->ledc_channel[CHANNEL_LEFT_INDEX].channel].conf1.val;
g_ledc_right_duty_val = &LEDC.channel_group[handle->ledc_timer.speed_mode].channel[handle->ledc_channel[CHANNEL_RIGHT_INDEX].channel].duty.val;
g_ledc_right_conf0_val = &LEDC.channel_group[handle->ledc_timer.speed_mode].channel[handle->ledc_channel[CHANNEL_RIGHT_INDEX].channel].conf0.val;
g_ledc_right_conf1_val = &LEDC.channel_group[handle->ledc_timer.speed_mode].channel[handle->ledc_channel[CHANNEL_RIGHT_INDEX].channel].conf1.val;
#if defined (CONFIG_IDF_TARGET_ESP32P4) || defined (CONFIG_IDF_TARGET_ESP32C5) || defined (CONFIG_IDF_TARGET_ESP32C61)
g_ledc_left_duty_val = &LEDC.channel_group[handle->ledc_timer.speed_mode].
channel[handle->ledc_channel[CHANNEL_LEFT_INDEX].channel].duty_init.val;
#else
g_ledc_left_duty_val = &LEDC.channel_group[handle->ledc_timer.speed_mode].
channel[handle->ledc_channel[CHANNEL_LEFT_INDEX].channel].duty.val;
#endif
g_ledc_left_conf0_val = &LEDC.channel_group[handle->ledc_timer.speed_mode].
channel[handle->ledc_channel[CHANNEL_LEFT_INDEX].channel].conf0.val;
g_ledc_left_conf1_val = &LEDC.channel_group[handle->ledc_timer.speed_mode].
channel[handle->ledc_channel[CHANNEL_LEFT_INDEX].channel].conf1.val;
#if defined (CONFIG_IDF_TARGET_ESP32P4) || defined (CONFIG_IDF_TARGET_ESP32C5) || defined (CONFIG_IDF_TARGET_ESP32C61)
g_ledc_right_duty_val = &LEDC.channel_group[handle->ledc_timer.speed_mode].
channel[handle->ledc_channel[CHANNEL_RIGHT_INDEX].channel].duty_init.val;
#else
g_ledc_right_duty_val = &LEDC.channel_group[handle->ledc_timer.speed_mode].
channel[handle->ledc_channel[CHANNEL_RIGHT_INDEX].channel].duty.val;
#endif
g_ledc_right_conf0_val = &LEDC.channel_group[handle->ledc_timer.speed_mode].
channel[handle->ledc_channel[CHANNEL_RIGHT_INDEX].channel].conf0.val;
g_ledc_right_conf1_val = &LEDC.channel_group[handle->ledc_timer.speed_mode].
channel[handle->ledc_channel[CHANNEL_RIGHT_INDEX].channel].conf1.val;

#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
gptimer_config_t timer_config = {
Expand Down
3 changes: 0 additions & 3 deletions components/audio/pwm_audio/test/CMakeLists.txt

This file was deleted.

2,013 changes: 0 additions & 2,013 deletions components/audio/pwm_audio/test/wave_1ch_16bits.c

This file was deleted.

2,013 changes: 0 additions & 2,013 deletions components/audio/pwm_audio/test/wave_1ch_8bits.c

This file was deleted.

2,013 changes: 0 additions & 2,013 deletions components/audio/pwm_audio/test/wave_2ch_16bits.c

This file was deleted.

2,013 changes: 0 additions & 2,013 deletions components/audio/pwm_audio/test/wave_2ch_8bits.c

This file was deleted.

8 changes: 8 additions & 0 deletions components/audio/pwm_audio/test_apps/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# The following lines of boilerplate have to be in your project's CMakeLists
# in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)

set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/unit-test-app/components"
"../../pwm_audio")
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(pwm_audio_test)
2 changes: 2 additions & 0 deletions components/audio/pwm_audio/test_apps/main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
idf_component_register(SRC_DIRS "."
INCLUDE_DIRS ".")
Loading

0 comments on commit 4c185ba

Please sign in to comment.