From fcd97c1392d86dbf94d896a43bbcdeb685011bed Mon Sep 17 00:00:00 2001 From: Robofish <1683502971@qq.com> Date: Thu, 28 Aug 2025 23:16:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E4=BA=9B=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .DS_Store | Bin 8196 -> 8196 bytes app/code_page/device_interface.py | 4 ++++ assets/User_code/config.csv | 2 +- assets/User_code/device/.DS_Store | Bin 8196 -> 8196 bytes assets/User_code/device/servo.h | 4 ++-- 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.DS_Store b/.DS_Store index 20d5f5c0825fb6ccbed6c43f0e12fa550399253f..c3b162386e015bcb7ba930038abcbe6ddfa43eba 100644 GIT binary patch delta 37 tcmZp1XmOa}&nUDpU^hRb&}JTiR_4w3g@qV5uaSvhp4h;%nO)*9I{@e!3^4!z delta 71 zcmZp1XmOa}&nUbxU^hRb@Ma!?R%S-=$&-YY<&7DP81xuQ7;+g3Jah7slXCKt7#J7? b7#Nt+85kJ(Hn$1OGHxsqW8Taz@s}L{i>VP( diff --git a/app/code_page/device_interface.py b/app/code_page/device_interface.py index fc294c5..b99a9db 100644 --- a/app/code_page/device_interface.py +++ b/app/code_page/device_interface.py @@ -28,6 +28,10 @@ def get_available_bsp_devices(project_path, bsp_type, gpio_type=None): if gpio_type: configs = [cfg for cfg in configs if cfg.get('type', '').lower() == gpio_type.lower()] return [f"BSP_GPIO_{cfg['custom_name']}" for cfg in configs] + elif bsp_type == "pwm" and bsp_config.get("pwm", {}).get("enabled", False): + # PWM使用configs结构 + configs = bsp_config["pwm"].get("configs", []) + return [f"BSP_PWM_{cfg['custom_name']}" for cfg in configs] elif bsp_type in bsp_config and bsp_config[bsp_type].get('enabled', False): devices = bsp_config[bsp_type].get('devices', []) return [f"BSP_{bsp_type.upper()}_{device['name']}" for device in devices] diff --git a/assets/User_code/config.csv b/assets/User_code/config.csv index 42ee8c7..6d57c2e 100644 --- a/assets/User_code/config.csv +++ b/assets/User_code/config.csv @@ -1,4 +1,4 @@ bsp,can,dwt,gpio,i2c,mm,spi,uart,pwm,time component,ahrs,ballistics,capacity,cmd,crc8,crc16,error_detect,filter,FreeRTOS_CLI,limiter,mixer,pid,ui,user_math -device,dr16,bmi088,ist8310,motor,motor_rm,motor_vesc,motor_odrive,dm_imu +device,dr16,bmi088,ist8310,motor,motor_rm,motor_vesc,motor_lk,motor_lz,motor_odrive,dm_imu,servo,buzzer,led,ws2812 module, \ No newline at end of file diff --git a/assets/User_code/device/.DS_Store b/assets/User_code/device/.DS_Store index b711bf493418b6e5ef52fda5b8da278a6e0c2e65..96266418d89d5df716d0ac2f3facbf4da6b81218 100644 GIT binary patch delta 198 zcmZp1XmOa}C7U^hRb%4QycrEG!h48;to3`GoO4EYRt49T83`N>H+`AG~63<5yx p$iTo9_a6*^JO&0-)fuR&8GkY`FuvQoOpKLrGrPnp+L+D62mpleGzb6y delta 38 pcmZp1XmOa}I9U^hRb(q -#include "bsp\pwm.h" +#include "bsp/pwm.h" /* Exported constants ------------------------------------------------------- */ /* Exported macro ----------------------------------------------------------- */ /* Exported types ----------------------------------------------------------- */ /** - * @brief ??????? + * @brief */ typedef struct { BSP_PWM_Channel_t pwm_ch;