mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-02-06 08:42:12 +08:00
fix - 1 优化中断中打印日志问题;2 优化SPI写外部FLASH慢的问题 (#10009)
Some checks failed
pkgs_test / change (push) Has been skipped
AutoTestCI / components/cpp11 (push) Has been cancelled
AutoTestCI / kernel/atomic (push) Has been cancelled
AutoTestCI / kernel/atomic/riscv64 (push) Has been cancelled
AutoTestCI / kernel/atomic_c11 (push) Has been cancelled
AutoTestCI / kernel/atomic_c11/riscv64 (push) Has been cancelled
AutoTestCI / kernel/device (push) Has been cancelled
AutoTestCI / kernel/ipc (push) Has been cancelled
AutoTestCI / kernel/irq (push) Has been cancelled
AutoTestCI / kernel/mem (push) Has been cancelled
AutoTestCI / kernel/mem/riscv64 (push) Has been cancelled
AutoTestCI / kernel/thread (push) Has been cancelled
AutoTestCI / kernel/timer (push) Has been cancelled
AutoTestCI / rtsmart/aarch64 (push) Has been cancelled
AutoTestCI / rtsmart/arm (push) Has been cancelled
AutoTestCI / rtsmart/riscv64 (push) Has been cancelled
AutoTestCI / components/utest (push) Has been cancelled
RT-Thread BSP Static Build Check / ESP32C3 (push) Has been cancelled
RT-Thread BSP Static Build Check / Infineon_TI_microchip (push) Has been cancelled
RT-Thread BSP Static Build Check / RT-Thread Online Packages (STM32F407 RT-Spark) (push) Has been cancelled
RT-Thread BSP Static Build Check / RTduino/Arduino Libraries (Raspberry Pico) (push) Has been cancelled
RT-Thread BSP Static Build Check / RTduino/Arduino Libraries (STM32F412 Nucleo) (push) Has been cancelled
RT-Thread BSP Static Build Check / aarch64 (push) Has been cancelled
RT-Thread BSP Static Build Check / gd32_n32_apm32 (push) Has been cancelled
RT-Thread BSP Static Build Check / hpmicro (push) Has been cancelled
RT-Thread BSP Static Build Check / i386-unknown (push) Has been cancelled
RT-Thread BSP Static Build Check / llvm-arm (push) Has been cancelled
RT-Thread BSP Static Build Check / mips (push) Has been cancelled
RT-Thread BSP Static Build Check / nordic(yml) (push) Has been cancelled
RT-Thread BSP Static Build Check / nuvoton (push) Has been cancelled
RT-Thread BSP Static Build Check / nxp_renesas (push) Has been cancelled
RT-Thread BSP Static Build Check / others_at32_hc32_ht32 (push) Has been cancelled
RT-Thread BSP Static Build Check / riscv-none (push) Has been cancelled
RT-Thread BSP Static Build Check / riscv64-unknown (push) Has been cancelled
RT-Thread BSP Static Build Check / simulator (push) Has been cancelled
RT-Thread BSP Static Build Check / stm32_f2_f4 (push) Has been cancelled
RT-Thread BSP Static Build Check / stm32_f7_g0_h7_mp15_u5_h5_wb5 (push) Has been cancelled
RT-Thread BSP Static Build Check / stm32l4_f0_f1 (push) Has been cancelled
BSP compilation with more drivers / BSP Compilation with More Drivers (push) Has been cancelled
Some checks failed
pkgs_test / change (push) Has been skipped
AutoTestCI / components/cpp11 (push) Has been cancelled
AutoTestCI / kernel/atomic (push) Has been cancelled
AutoTestCI / kernel/atomic/riscv64 (push) Has been cancelled
AutoTestCI / kernel/atomic_c11 (push) Has been cancelled
AutoTestCI / kernel/atomic_c11/riscv64 (push) Has been cancelled
AutoTestCI / kernel/device (push) Has been cancelled
AutoTestCI / kernel/ipc (push) Has been cancelled
AutoTestCI / kernel/irq (push) Has been cancelled
AutoTestCI / kernel/mem (push) Has been cancelled
AutoTestCI / kernel/mem/riscv64 (push) Has been cancelled
AutoTestCI / kernel/thread (push) Has been cancelled
AutoTestCI / kernel/timer (push) Has been cancelled
AutoTestCI / rtsmart/aarch64 (push) Has been cancelled
AutoTestCI / rtsmart/arm (push) Has been cancelled
AutoTestCI / rtsmart/riscv64 (push) Has been cancelled
AutoTestCI / components/utest (push) Has been cancelled
RT-Thread BSP Static Build Check / ESP32C3 (push) Has been cancelled
RT-Thread BSP Static Build Check / Infineon_TI_microchip (push) Has been cancelled
RT-Thread BSP Static Build Check / RT-Thread Online Packages (STM32F407 RT-Spark) (push) Has been cancelled
RT-Thread BSP Static Build Check / RTduino/Arduino Libraries (Raspberry Pico) (push) Has been cancelled
RT-Thread BSP Static Build Check / RTduino/Arduino Libraries (STM32F412 Nucleo) (push) Has been cancelled
RT-Thread BSP Static Build Check / aarch64 (push) Has been cancelled
RT-Thread BSP Static Build Check / gd32_n32_apm32 (push) Has been cancelled
RT-Thread BSP Static Build Check / hpmicro (push) Has been cancelled
RT-Thread BSP Static Build Check / i386-unknown (push) Has been cancelled
RT-Thread BSP Static Build Check / llvm-arm (push) Has been cancelled
RT-Thread BSP Static Build Check / mips (push) Has been cancelled
RT-Thread BSP Static Build Check / nordic(yml) (push) Has been cancelled
RT-Thread BSP Static Build Check / nuvoton (push) Has been cancelled
RT-Thread BSP Static Build Check / nxp_renesas (push) Has been cancelled
RT-Thread BSP Static Build Check / others_at32_hc32_ht32 (push) Has been cancelled
RT-Thread BSP Static Build Check / riscv-none (push) Has been cancelled
RT-Thread BSP Static Build Check / riscv64-unknown (push) Has been cancelled
RT-Thread BSP Static Build Check / simulator (push) Has been cancelled
RT-Thread BSP Static Build Check / stm32_f2_f4 (push) Has been cancelled
RT-Thread BSP Static Build Check / stm32_f7_g0_h7_mp15_u5_h5_wb5 (push) Has been cancelled
RT-Thread BSP Static Build Check / stm32l4_f0_f1 (push) Has been cancelled
BSP compilation with more drivers / BSP Compilation with More Drivers (push) Has been cancelled
* 1. 优化中断中打印日志问题;2 优化SPI写外部FLASH慢的问题 * 2. 在spi驱动中有在中断中打印调试信息的问题,增加ISR log判断进行 * 3. spi+DMA 写外部flash,由于spi速度很快,不进行delay就可以;同时,仿照Linux的驱动框架进行优化,数据小不使用DMA
This commit is contained in:
@@ -358,7 +358,9 @@ static void hc32_eth_irq_handle(stc_eth_handle_t *eth_handle)
|
||||
result = eth_device_ready(&(hc32_eth_device.parent));
|
||||
if (result != RT_EOK)
|
||||
{
|
||||
#if defined (RT_USING_ULOG) || defined (ULOG_USING_ISR_LOG)
|
||||
LOG_I("eth rx complete callback err = %d", result);
|
||||
#endif
|
||||
}
|
||||
/* Clear the Eth DMA Rx IT pending bits */
|
||||
ETH_DMA_ClearStatus(ETH_DMA_FLAG_RIS | ETH_DMA_FLAG_NIS);
|
||||
@@ -465,7 +467,9 @@ static void eth_phy_irq_handler(void *args)
|
||||
rt_uint16_t status = 0;
|
||||
|
||||
ETH_PHY_ReadReg(&EthHandle, PHY_IISDR, &status);
|
||||
#if defined (RT_USING_ULOG) || defined (ULOG_USING_ISR_LOG)
|
||||
LOG_D("phy interrupt status reg is 0x%X", status);
|
||||
#endif
|
||||
#endif
|
||||
hc32_phy_link_change();
|
||||
}
|
||||
|
||||
@@ -473,8 +473,6 @@ static int32_t hc32_spi_dma_trans(struct hc32_spi_config *spi_config, const uint
|
||||
while ((RESET == DMA_GetTransCompleteStatus(DmaInstance, DmaFlag)) &&
|
||||
(u32TimeoutCnt < spi_config->timeout))
|
||||
{
|
||||
rt_thread_mdelay(1);
|
||||
u32TimeoutCnt++;
|
||||
}
|
||||
if (u32TimeoutCnt >= spi_config->timeout)
|
||||
{
|
||||
@@ -544,7 +542,7 @@ static rt_ssize_t hc32_spi_xfer(struct rt_spi_device *device, struct rt_spi_mess
|
||||
if (message->send_buf && message->recv_buf)
|
||||
{
|
||||
hc32_spi_set_trans_mode(spi_instance, SPI_FULL_DUPLEX);
|
||||
if ((spi_drv->spi_dma_flag & RT_DEVICE_FLAG_DMA_TX) && (spi_drv->spi_dma_flag & RT_DEVICE_FLAG_DMA_RX))
|
||||
if ((spi_drv->spi_dma_flag & RT_DEVICE_FLAG_DMA_TX) && (spi_drv->spi_dma_flag & RT_DEVICE_FLAG_DMA_RX) && (send_length > 32))
|
||||
{
|
||||
state = hc32_spi_dma_trans(spi_drv->config, send_buf, recv_buf, send_length);
|
||||
}
|
||||
@@ -557,7 +555,7 @@ static rt_ssize_t hc32_spi_xfer(struct rt_spi_device *device, struct rt_spi_mess
|
||||
else if (message->send_buf)
|
||||
{
|
||||
hc32_spi_set_trans_mode(spi_instance, SPI_SEND_ONLY);
|
||||
if (spi_drv->spi_dma_flag & RT_DEVICE_FLAG_DMA_TX)
|
||||
if ((spi_drv->spi_dma_flag & RT_DEVICE_FLAG_DMA_TX) && (send_length > 32))
|
||||
{
|
||||
state = hc32_spi_dma_trans(spi_drv->config, send_buf, RT_NULL, send_length);
|
||||
}
|
||||
@@ -601,8 +599,6 @@ static rt_ssize_t hc32_spi_xfer(struct rt_spi_device *device, struct rt_spi_mess
|
||||
while ((RESET == SPI_GetStatus(spi_instance, SPI_FLAG_IDLE)) &&
|
||||
(u32TimeoutCnt < spi_drv->config->timeout))
|
||||
{
|
||||
rt_thread_mdelay(1);
|
||||
u32TimeoutCnt++;
|
||||
}
|
||||
if (u32TimeoutCnt >= spi_drv->config->timeout)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user