From 420cc243e06e241b72bd068768270e04fbcb5acc Mon Sep 17 00:00:00 2001 From: pedrominatel Date: Fri, 29 Nov 2024 17:02:16 +0000 Subject: [PATCH] fix: Changes in the test script to reduce the test scope for multiple targets --- .../motor/servo/test_apps/main/test_servo.c | 45 +------------------ 1 file changed, 1 insertion(+), 44 deletions(-) diff --git a/components/motor/servo/test_apps/main/test_servo.c b/components/motor/servo/test_apps/main/test_servo.c index d7ea885cb..900641b52 100644 --- a/components/motor/servo/test_apps/main/test_servo.c +++ b/components/motor/servo/test_apps/main/test_servo.c @@ -14,25 +14,10 @@ #include "unity_config.h" #include "sdkconfig.h" -#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S3 -// ESP32 and ESP32-S3 support 8 RMT channels #define SERVO_CH0_PIN 1 #define SERVO_CH1_PIN 2 #define SERVO_CH2_PIN 3 #define SERVO_CH3_PIN 4 -#define SERVO_CH4_PIN 5 -#define SERVO_CH5_PIN 6 -#define SERVO_CH6_PIN 7 -#define SERVO_CH7_PIN 8 -#elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 -// ESP32-C3, ESP32-C6, and ESP32-H2 support 4 RMT channels -#define SERVO_CH0_PIN 1 -#define SERVO_CH1_PIN 2 -#define SERVO_CH2_PIN 3 -#define SERVO_CH3_PIN 4 -#else -#error "Unsupported target or RMT configuration!" -#endif #define TEST_MEMORY_LEAK_THRESHOLD (-500) @@ -56,48 +41,20 @@ TEST_CASE("Servo_motor test", "[servo][iot]") .timer_number = LEDC_TIMER_0, .channels = { .servo_pin = { -#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S3 - SERVO_CH0_PIN, - SERVO_CH1_PIN, - SERVO_CH2_PIN, - SERVO_CH3_PIN, - SERVO_CH4_PIN, - SERVO_CH5_PIN, - SERVO_CH6_PIN, - SERVO_CH7_PIN, -#elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 SERVO_CH0_PIN, SERVO_CH1_PIN, SERVO_CH2_PIN, SERVO_CH3_PIN, -#endif }, .ch = { -#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S3 LEDC_CHANNEL_0, LEDC_CHANNEL_1, LEDC_CHANNEL_2, LEDC_CHANNEL_3, - LEDC_CHANNEL_4, - LEDC_CHANNEL_5, - LEDC_CHANNEL_6, - LEDC_CHANNEL_7, -#elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 - LEDC_CHANNEL_0, - LEDC_CHANNEL_1, - LEDC_CHANNEL_2, - LEDC_CHANNEL_3, -#endif }, }, -#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S3 .channel_number = 8, -#elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 - .channel_number = 4, -#else -#error "Unsupported target or configuration!" -#endif - }; + } ; TEST_ASSERT(ESP_OK == iot_servo_init(LEDC_LOW_SPEED_MODE, &servo_cfg_ls)); size_t i;