为了在资源有限的设备上实时切换数据传输通道,研究了Wavedev2驱动,在驱动双DMA(直接内存存取)数据传输框架下,提出了中断轮询通道切换算法。结合中断探测的准确性和循环探测的实时性,实现了空闲时不占用CPU的数据通道切换功能,并把它应用于录音回放通道切换和耳机探测问题中。算法分析及实验对比结果表明,该算法在实用性上优于通用的循环探测算法和IST(中断服务线程)探测算法。
To switching the data transmission channel on limited resources equipment at real time, first do research on Wavedev2 driver, then an interrupt polling algorithm under the double DMA (Direct Memory Access) data transmission framework is proposed. The method synthesis of the accuracy of interrupt detection and the real time of cycle detection, the channel switch function which not occupy CPU on free time. The feasibility of the method is validated by applying it in the recording and playback channel switching and headphones detection. Results of the algorithm analysis and the experiments indicate the proposed method is better than the general cycling detection algorithm and the IST (interrupt server thread) detection algorithm in practicability.