example_a.dsp

来自「uCOS的移植代码,移植到ad21xx系列单片机.」· DSP 代码 · 共 75 行

DSP
75
字号
{*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*				   ADSP-21xx Specific Code version 1.0	
*
* File : EXAMPLE_A.DSP
* By   : Jaap de Jong (jdj@nedap.nl)
*	 Nedap Retail Support
*	 Parallelweg 2d
*	 Postbox 102
*	 7140 AC Groenlo
*	 Netherlands
* Based on 'ADSP-21065L SHARC Specific Code version 1.0' by Bertrand Hurst, Francois Veuve, Cedric Bornand
*********************************************************************************************************
*}
.module _example_a_;		{ extra assembly stuff... }


{  Functions defined hereunder  }
.global timer_irqon_;		{ enable timerinterrupts }
.global toggle1_;		{ toggle 1 }
.global toggle2_;		{ toggle 2 }


{*
*********************************************************************************************************
*                                           ENABLE TIMER INTERRUPTS
*
* Description : This function is used to turn on timerinterrupts
* Arguments   : none
* Note(s)     :	none
*********************************************************************************************************
*}
timer_irqon_:
	ay0 = imask; 
	ar = 1;
	ar = ar or ay0; 
	imask = ar;
	rts;


{*
*********************************************************************************************************
*                                           TOGGLE 1 & 2
*
* Description : These two functions are used to toggle two outputs
* Arguments   : none
* Note(s)     :	Use the outputs you like...
*********************************************************************************************************
*}
toggle1_:
	ay0 = 4;
	jump toggleX;
	
toggle2_:
	ay0 = 8;

toggleX:
	ar = 0x0c; 		{ direction pfdata }
	dm(0x3fe6) = ar;

	ax0 = imask;		{ store interrupts }
	imask = 0;		{ disable interrupts }
	ar = dm(0x3fe5); 	{ toggle.. }
	ar = ar xor ay0; 
	dm(0x3fe5) = ar; 
	imask = ax0;		{ restore interrupts }
	
	rts;


.endmod;
{********************************** End of file *********************************************************}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?