Răsfoiți Sursa

update: pwm通道使用超过限制后,打印提示日志

Wendal Chen 3 ani în urmă
părinte
comite
8d9e6219f1
1 a modificat fișierele cu 2 adăugiri și 1 ștergeri
  1. 2 1
      luatos/components/luat/port/luat_pwm_idf5.c

+ 2 - 1
luatos/components/luat/port/luat_pwm_idf5.c

@@ -7,7 +7,7 @@
 #include "luat_log.h"
 #include "luat_log.h"
 #define LUAT_LOG_TAG "pwm"
 #define LUAT_LOG_TAG "pwm"
 
 
-static int luat_pwm_idf[LEDC_TIMER_MAX] = {0};
+static uint8_t luat_pwm_idf[LEDC_TIMER_MAX] = {0};
 
 
 int luat_pwm_setup(luat_pwm_conf_t *conf){
 int luat_pwm_setup(luat_pwm_conf_t *conf){
     int timer = -1;
     int timer = -1;
@@ -17,6 +17,7 @@ int luat_pwm_setup(luat_pwm_conf_t *conf){
         }
         }
     }
     }
     if (timer < 0) {
     if (timer < 0) {
+        LLOGE("too many PWM!!! only %d channels supported", LEDC_TIMER_MAX);
         return -1;
         return -1;
     }
     }
     if (luat_pwm_idf[timer] == 0){
     if (luat_pwm_idf[timer] == 0){