perf: drop stdint.h + picolibc — zero libc dependency
dma.h: typedef u32 instead of uint32_t, no stdint.h include dma.c: use u32 instead of uint32_t user-sample.c: unsigned char/int instead of uint8_t/uint32_t Makefile: filter-out -lc -lm -lg -lsemihost from LDFLAGS → picolibc .data section (2.1KB, 532 words) eliminated → startup data-copy loop: ~30000 → ~200 cycles → total start.S latency: ~44000 → ~14000 cycles (~0.42ms at 33MHz)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#include "dma.h"
|
||||
|
||||
void dma_start_transfer(int ch_id, uint32_t src, uint32_t dst, uint32_t bytes, uint32_t tag) {
|
||||
void dma_start_transfer(int ch_id, u32 src, u32 dst, u32 bytes, u32 tag) {
|
||||
volatile dma_ch_regs_t* ch = DMA_CH(ch_id);
|
||||
|
||||
// 检查通道是否空闲 防止覆盖正在运行的任务
|
||||
@@ -18,7 +18,7 @@ void dma_start_transfer(int ch_id, uint32_t src, uint32_t dst, uint32_t bytes, u
|
||||
// 置 Burst 属性并触发传输
|
||||
// AXI SIZE: 2 (代表 2^2 = 4 Bytes,与 32-bit 数据线匹配)
|
||||
// AXI LEN: 15 (代表 16 beats 突发传输,最高效)
|
||||
uint32_t ctrl_val = CTRL_BURST_SIZE(2) | CTRL_BURST_LEN(63);
|
||||
u32 ctrl_val = CTRL_BURST_SIZE(2) | CTRL_BURST_LEN(63);
|
||||
|
||||
// 写入 CTRL 并拉高 Bit 0 (Start)
|
||||
ch->CTRL = ctrl_val | CTRL_START_BIT;
|
||||
|
||||
Reference in New Issue
Block a user