Skip to content

Commit

Permalink
fix: Changes in the test script to reduce the test scope for multiple…
Browse files Browse the repository at this point in the history
… targets
  • Loading branch information
pedrominatel committed Nov 29, 2024
1 parent fe6f646 commit 420cc24
Showing 1 changed file with 1 addition and 44 deletions.
45 changes: 1 addition & 44 deletions components/motor/servo/test_apps/main/test_servo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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;
Expand Down

0 comments on commit 420cc24

Please sign in to comment.