进一步迭代优化统一管理

This commit is contained in:
冯佳
2026-01-23 14:35:51 +08:00
parent 988cc7ad4a
commit 075e8299cf
36 changed files with 6146 additions and 1590 deletions

View File

@ -17,7 +17,7 @@
* @return true if successful, false otherwise
*/
static bool w25qxx_spi_send(const uint8_t *data, uint16_t size) {
return hal_spi_transmit(W25QXX_SPI_INSTANCE, data, size);
return hal_spi_transmit(W25QXX_SPI_INSTANCE, data, size) == HAL_RET_OK;
}
/**
@ -27,7 +27,7 @@ static bool w25qxx_spi_send(const uint8_t *data, uint16_t size) {
* @return true if successful, false otherwise
*/
static bool w25qxx_spi_receive(uint8_t *data, uint16_t size) {
return hal_spi_receive(W25QXX_SPI_INSTANCE, data, size);
return hal_spi_receive(W25QXX_SPI_INSTANCE, data, size) == HAL_RET_OK;
}
/**
@ -38,7 +38,7 @@ static bool w25qxx_spi_receive(uint8_t *data, uint16_t size) {
* @return true if successful, false otherwise
*/
static bool w25qxx_spi_transceive(const uint8_t *tx_data, uint8_t *rx_data, uint16_t size) {
return hal_spi_transmit_receive(W25QXX_SPI_INSTANCE, tx_data, rx_data, size);
return hal_spi_transmit_receive(W25QXX_SPI_INSTANCE, tx_data, rx_data, size) == HAL_RET_OK;
}
/**
@ -96,7 +96,7 @@ bool bsp_w25qxx_init(void) {
.databits = HAL_SPI_DATABITS_8
};
if (!hal_spi_init(W25QXX_SPI_INSTANCE, &spi_config)) {
if (hal_spi_init(W25QXX_SPI_INSTANCE, &spi_config) != HAL_RET_OK) {
return false;
}