File tree Expand file tree Collapse file tree 1 file changed +1
-44
lines changed
components/motor/servo/test_apps/main Expand file tree Collapse file tree 1 file changed +1
-44
lines changed Original file line number Diff line number Diff line change 1414#include "unity_config.h"
1515#include "sdkconfig.h"
1616
17- #if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S3
18- // ESP32 and ESP32-S3 support 8 RMT channels
1917#define SERVO_CH0_PIN 1
2018#define SERVO_CH1_PIN 2
2119#define SERVO_CH2_PIN 3
2220#define SERVO_CH3_PIN 4
23- #define SERVO_CH4_PIN 5
24- #define SERVO_CH5_PIN 6
25- #define SERVO_CH6_PIN 7
26- #define SERVO_CH7_PIN 8
27- #elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2
28- // ESP32-C3, ESP32-C6, and ESP32-H2 support 4 RMT channels
29- #define SERVO_CH0_PIN 1
30- #define SERVO_CH1_PIN 2
31- #define SERVO_CH2_PIN 3
32- #define SERVO_CH3_PIN 4
33- #else
34- #error "Unsupported target or RMT configuration!"
35- #endif
3621
3722#define TEST_MEMORY_LEAK_THRESHOLD (-500)
3823
@@ -56,48 +41,20 @@ TEST_CASE("Servo_motor test", "[servo][iot]")
5641 .timer_number = LEDC_TIMER_0 ,
5742 .channels = {
5843 .servo_pin = {
59- #if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S3
60- SERVO_CH0_PIN ,
61- SERVO_CH1_PIN ,
62- SERVO_CH2_PIN ,
63- SERVO_CH3_PIN ,
64- SERVO_CH4_PIN ,
65- SERVO_CH5_PIN ,
66- SERVO_CH6_PIN ,
67- SERVO_CH7_PIN ,
68- #elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2
6944 SERVO_CH0_PIN ,
7045 SERVO_CH1_PIN ,
7146 SERVO_CH2_PIN ,
7247 SERVO_CH3_PIN ,
73- #endif
7448 },
7549 .ch = {
76- #if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S3
7750 LEDC_CHANNEL_0 ,
7851 LEDC_CHANNEL_1 ,
7952 LEDC_CHANNEL_2 ,
8053 LEDC_CHANNEL_3 ,
81- LEDC_CHANNEL_4 ,
82- LEDC_CHANNEL_5 ,
83- LEDC_CHANNEL_6 ,
84- LEDC_CHANNEL_7 ,
85- #elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2
86- LEDC_CHANNEL_0 ,
87- LEDC_CHANNEL_1 ,
88- LEDC_CHANNEL_2 ,
89- LEDC_CHANNEL_3 ,
90- #endif
9154 },
9255 },
93- #if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S3
9456 .channel_number = 8 ,
95- #elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2
96- .channel_number = 4 ,
97- #else
98- #error "Unsupported target or configuration!"
99- #endif
100- };
57+ } ;
10158 TEST_ASSERT (ESP_OK == iot_servo_init (LEDC_LOW_SPEED_MODE , & servo_cfg_ls ));
10259
10360 size_t i ;
You can’t perform that action at this time.
0 commit comments