Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'test/add_i2s_tdm_full_duplex_test_app' into 'master'
test: add i2s tdm full duplex multi device test app Closes IDFGH-8003 See merge request espressif/esp-idf!19904
- Loading branch information
Showing
13 changed files
with
476 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
components/driver/test_apps/i2s_test_apps/i2s_tdm/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# 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.16) | ||
|
||
include($ENV{IDF_PATH}/tools/cmake/project.cmake) | ||
project(i2s_tdm_full_duplex_test) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
| Supported Targets | ESP32-C3 | ESP32-S3 | | ||
| ----------------- | -------- | -------- | | ||
|
4 changes: 4 additions & 0 deletions
4
components/driver/test_apps/i2s_test_apps/i2s_tdm/main/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
idf_component_register(SRCS "test_app_main.c" "test_i2s_tdm_full_duplex.c" | ||
INCLUDE_DIRS "." | ||
WHOLE_ARCHIVE | ||
) |
41 changes: 41 additions & 0 deletions
41
components/driver/test_apps/i2s_test_apps/i2s_tdm/main/test_app_main.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: Unlicense OR CC0-1.0 | ||
*/ | ||
#include "unity.h" | ||
#include "unity_test_runner.h" | ||
#include "esp_heap_caps.h" | ||
#include "freertos/FreeRTOS.h" | ||
#include "freertos/task.h" | ||
|
||
#define TEST_MEMORY_LEAK_THRESHOLD (-300) | ||
|
||
static size_t before_free_8bit; | ||
static size_t before_free_32bit; | ||
|
||
static void check_leak(size_t before_free, size_t after_free, const char *type) | ||
{ | ||
ssize_t delta = after_free - before_free; | ||
printf("MALLOC_CAP_%s: Before %u bytes free, After %u bytes free (delta %d)\n", type, before_free, after_free, delta); | ||
TEST_ASSERT_MESSAGE(delta >= TEST_MEMORY_LEAK_THRESHOLD, "memory leak"); | ||
} | ||
|
||
void setUp(void) | ||
{ | ||
before_free_8bit = heap_caps_get_free_size(MALLOC_CAP_8BIT); | ||
before_free_32bit = heap_caps_get_free_size(MALLOC_CAP_32BIT); | ||
} | ||
|
||
void tearDown(void) | ||
{ | ||
size_t after_free_8bit = heap_caps_get_free_size(MALLOC_CAP_8BIT); | ||
size_t after_free_32bit = heap_caps_get_free_size(MALLOC_CAP_32BIT); | ||
check_leak(before_free_8bit, after_free_8bit, "8BIT"); | ||
check_leak(before_free_32bit, after_free_32bit, "32BIT"); | ||
} | ||
|
||
void app_main(void) | ||
{ | ||
unity_run_menu(); | ||
} |
Oops, something went wrong.