mirror of
https://github.com/goldenfishs/MRobot.git
synced 2025-09-14 12:54:33 +08:00
修改一些代码
This commit is contained in:
parent
79f7671a9f
commit
fcd97c1392
@ -28,6 +28,10 @@ def get_available_bsp_devices(project_path, bsp_type, gpio_type=None):
|
|||||||
if gpio_type:
|
if gpio_type:
|
||||||
configs = [cfg for cfg in configs if cfg.get('type', '').lower() == gpio_type.lower()]
|
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]
|
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):
|
elif bsp_type in bsp_config and bsp_config[bsp_type].get('enabled', False):
|
||||||
devices = bsp_config[bsp_type].get('devices', [])
|
devices = bsp_config[bsp_type].get('devices', [])
|
||||||
return [f"BSP_{bsp_type.upper()}_{device['name']}" for device in devices]
|
return [f"BSP_{bsp_type.upper()}_{device['name']}" for device in devices]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
bsp,can,dwt,gpio,i2c,mm,spi,uart,pwm,time
|
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
|
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,
|
module,
|
|
BIN
assets/User_code/device/.DS_Store
vendored
BIN
assets/User_code/device/.DS_Store
vendored
Binary file not shown.
@ -7,14 +7,14 @@ extern "C" {
|
|||||||
/* Includes ----------------------------------------------------------------- */
|
/* Includes ----------------------------------------------------------------- */
|
||||||
#include <cmsis_os2.h>
|
#include <cmsis_os2.h>
|
||||||
|
|
||||||
#include "bsp\pwm.h"
|
#include "bsp/pwm.h"
|
||||||
|
|
||||||
/* Exported constants ------------------------------------------------------- */
|
/* Exported constants ------------------------------------------------------- */
|
||||||
/* Exported macro ----------------------------------------------------------- */
|
/* Exported macro ----------------------------------------------------------- */
|
||||||
/* Exported types ----------------------------------------------------------- */
|
/* Exported types ----------------------------------------------------------- */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief ???????
|
* @brief
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
BSP_PWM_Channel_t pwm_ch;
|
BSP_PWM_Channel_t pwm_ch;
|
||||||
|
Loading…
Reference in New Issue
Block a user