From 7534dda3b69026df6dc40b3d907b825a0078617b Mon Sep 17 00:00:00 2001
From: chenlh <2008get@163.com>
Date: 星期四, 21 八月 2025 20:14:01 +0800
Subject: [PATCH] Signed-off-by: chenlh <2008get@163.com>

---
 drv/sport.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drv/sport.c b/drv/sport.c
index cb74950..bc1b6e9 100644
--- a/drv/sport.c
+++ b/drv/sport.c
@@ -49,7 +49,6 @@
 	 void * buffer;
 };
 
-unsigned int SAMPLE_NUM = 32;
 static AudioCodec mAudioCodec[16];
 static u32 mCodecNum = 0;
 static struct DMA_Desc sp_desc[32];//0a_ping,0a_pong,0b_ping,0b_pong,...
@@ -68,14 +67,14 @@
 	return 0;
 }
 
-void sport_config(volatile SportRegsDef* regs , struct SportDef *  config)
+void sport_config(volatile SportRegsDef* regs , struct SportDef *  config, unsigned int sample_num)
 {
 	u32 i;
 
 	volatile DMARegsDef* dma = get_dma_regs(config->spid);
 	struct DMA_Desc* desca_0 = &sp_desc[config->spid*2 + 0];
 	struct DMA_Desc* desca_1 = &sp_desc[config->spid*2 + 1];
-	u32 dmaBufferLen = config->slots*SAMPLE_NUM;
+	u32 dmaBufferLen = config->slots * sample_num;
 	s32* dmaBuffer_ping, *dmaBuffer_pong;
 
 	if(config->enable_sec) {

--
Gitblit v1.9.3