调整适配目录层级

This commit is contained in:
冯佳
2026-01-28 13:08:52 +08:00
parent 62345ccfdf
commit e879b18602
32 changed files with 901 additions and 904 deletions

View File

@ -32,24 +32,28 @@ hal_ret_t bsp_init(void) {
/* Initialize peripherals based on configuration */
/* Initialize LED */
if (board_config->led.enable && board_config->init_funcs.led_init != NULL) {
status = board_config->init_funcs.led_init(&board_config->led);
if (status != HAL_RET_OK) {
return status;
}
} else if (board_config->led.enable) {
/* Use default initialization if no function provided */
hal_gpio_config_t gpio_config = {
.port = board_config->led.port,
.pin = board_config->led.pin,
.mode = board_config->led.mode,
.speed = board_config->led.speed,
.pull = board_config->led.pull
};
status = hal_gpio_configure_pin(&gpio_config);
if (status != HAL_RET_OK) {
return status;
/* Initialize LEDs */
if (board_config->leds.enable) {
for (i = 0; i < board_config->leds.count; i++) {
if (board_config->init_funcs.led_init != NULL) {
status = board_config->init_funcs.led_init(&board_config->leds.leds[i]);
if (status != HAL_RET_OK) {
return status;
}
} else {
/* Use default initialization if no function provided */
hal_gpio_config_t gpio_config = {
.port = board_config->leds.leds[i].port,
.pin = board_config->leds.leds[i].pin,
.mode = board_config->leds.leds[i].mode,
.speed = board_config->leds.leds[i].speed,
.pull = board_config->leds.leds[i].pull
};
status = hal_gpio_configure_pin(&gpio_config);
if (status != HAL_RET_OK) {
return status;
}
}
}
}
@ -142,18 +146,20 @@ hal_ret_t bsp_gpio_init(void) {
hal_ret_t status = HAL_RET_OK;
uint8_t i;
/* Initialize LED GPIO */
if (board_config->led.enable) {
hal_gpio_config_t gpio_config = {
.port = board_config->led.port,
.pin = board_config->led.pin,
.mode = board_config->led.mode,
.speed = board_config->led.speed,
.pull = board_config->led.pull
};
status = hal_gpio_configure_pin(&gpio_config);
if (status != HAL_RET_OK) {
return status;
/* Initialize LED GPIOs */
if (board_config->leds.enable) {
for (i = 0; i < board_config->leds.count; i++) {
hal_gpio_config_t gpio_config = {
.port = board_config->leds.leds[i].port,
.pin = board_config->leds.leds[i].pin,
.mode = board_config->leds.leds[i].mode,
.speed = board_config->leds.leds[i].speed,
.pull = board_config->leds.leds[i].pull
};
status = hal_gpio_configure_pin(&gpio_config);
if (status != HAL_RET_OK) {
return status;
}
}
}