📄 main.c
字号:
//=======================================================================
// The information contained herein is the exclusive property of
// Sunnnorth Technology Co. And shall not be distributed, reproduced,
// or disclosed in whole in part without prior written permission.
// (C) COPYRIGHT 2003 SUNNORTH TECHNOLOGY CO.
// ALL RIGHTS RESERVED
// The entire notice above must be reproduced on all authorized copies.
//=======================================================================
//=======================================================================
// 工程名称:S240.scs
//
// 功能描述:S240只有自动播放方式,在中断FIQ的FIQ_TMA中断源中通过主程序
// 的SACM_S480_ServiceLoop()对语音数据进行解码,然后将其送入
// DAC通道播放
//
// 文件来源:《SPCE061A单片机实验指导书》
// " 语音实验部分 实验三 SACM-240 "
//
// IDE 环境:SUNPLUS u'nSP IDE 1.8.0
//
// 涉及的库:SACMV25.lib
//
// 组成文件: main.c
// hardware.asm/ISR.asm/Resource.asm
// Resource.inc/S240.h
//
// 日期: 2003-6-20
//=======================================================================
#include "hardware.h"
#include "s240.h"
#define DAC1 1
#define DAC2 2
#define Ramp_UpDn_Off 0
#define Ramp_Up_On 1
#define Ramp_Dn_On 2
#define Ramp_UpDn_On 3
#define MaxSpeechNum 3 //播放语音的最大个数
#define Auto 1
main()
{
int SpeechIndex = 0; // 选择第一首语音
while(1)
{
SACM_S240_Initial(Auto);
SACM_S240_Play(SpeechIndex,DAC1+DAC2, Ramp_UpDn_On); // 播放第一首
while(SACM_S240_Status()&0x01) //判断第一首是否播完
SACM_S240_ServiceLoop();
SpeechIndex++;
SACM_S240_Play(SpeechIndex,DAC1+DAC2, Ramp_UpDn_On); //播放第二首
while(SACM_S240_Status()&0x01) //判断第二首是否播完
SACM_S240_ServiceLoop();
SpeechIndex++;
SACM_S240_Play(SpeechIndex,DAC1+DAC2, Ramp_UpDn_On); //播放第三首
while(1)
SACM_S240_ServiceLoop(); //停
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -