#include "A2000.h"
#define SPEECH_1 0
#define DAC1 1
#define DAC2 2
#define Ramp_UpDn_Off 0
#define Ramp_UpDn_On 3
#define Manual 0
#define Auto 1
#define Full 1
#define Empty 2
#define Mode 1
//=============================================================================================== http://www.siliconray.com/robots/l293-quadruple-half-h-motor-driver-module.html
//===============================================================================================
main()
{
extern long RES_WW_24K_SA,RES_WW_24K_EA; //
long int Addr; //
int Ret = 0; //
if(Mode == 1) //
{
SACM_A2000_Initial(1); //
SACM_A2000_Play(SPEECH_1,DAC1,Ramp_UpDn_On); //
while(1){
F_ClearWatchdog();
SACM_A2000_ServiceLoop();} //
}
if(Mode == 0) //
{
Addr=RES_WW_24K_SA; //
SACM_A2000_Initial(0); //
SACM_A2000_InitDecoder(DAC1); //
while(SACM_A2000_TestQueue()!=Full) //
{
Ret=SP_GetResource(Addr); //
SACM_A2000_FillQueue(Ret); //
Addr++;
}
while(1)
{
if(SACM_A2000_TestQueue()!=Full)
{
Ret =SP_GetResource(Addr);
SACM_A2000_FillQueue(Ret);
Addr++;
}
if(Addr< RES_WW_24K_EA )
SACM_A2000_Decoder();
else
SACM_A2000_Stop(); //
F_ClearWatchdog();
}
}
}
没有评论:
发表评论