?? volume.c
字號:
/*
* Copyright 1999 by Texas Instruments Incorporated.
* All rights reserved. Property of Texas Instruments Incorporated.
* Restricted rights to use, duplicate or disclose this code are
* granted through contract.
* U.S. Patent Nos. 5,283,900 5,392,448
*/
/* "@(#) BIOS-C54x 3.01b 09-07-99 (bios54x-b15)" */
/***************************************************************************/
/* */
/* V O L U M E . C */
/* */
/* Audio gain processing using CLK ISR as data source, and a software */
/* interrupt for processing routine. */
/* */
/***************************************************************************/
#include <std.h>
#include <log.h>
#include <swi.h>
#include <clk.h>
#include <prd.h>
#include <stdio.h>
#define BUFSIZE 100
#define MINGAIN 1
#define BASELOAD 6
/* Global declarations */
int inp_buffer[BUFSIZE]; /* processing data buffers */
int out_buffer[BUFSIZE];
int gain = MINGAIN; /* volume control variable */
unsigned processingLoad = BASELOAD; /* processing routine load value */
/* Objects created by the Configuration Tool */
extern LOG_Obj trace;
extern SWI_Obj processing_SWI;
/* Functions */
extern void load(unsigned loadValue);
int processing(int *input, int *output);
void dataIO();
void test();
int i;
/*
* ======== main ========
*/
void main()
{
LOG_printf(&trace,"new volume example started\n");
for(i=0;i>=100;i++)
{
inp_buffer[i]=i;
}
/* fall into DSP/BIOS idle loop */
return;
}
/*
* ======== processing ========
*
* FUNCTION: Called from processing_SWI to apply signal processing
* transform to input signal.
*
* PARAMETERS: address of input and output buffers.
*
* RETURN VALUE: TRUE.
*/
int processing(Int *input, Int *output)
{
int size;
size = BUFSIZE;
while(size--){
*output++ = *input++ * gain;
}
LOG_printf(&trace,"input interrrupt\n");
/* additional processing load */
load(processingLoad);
return(1);
}
/*
* ======== dataIO ========
*
* FUNCTION: Called from timer ISR to fake a periodic hardware interrupt that
* reads in the input signal and outputs the processed signal.
*
* PARAMETERS: none.
*
* RETURN VALUE: none.
*/
void test()
{
return;
}
void dataIO()
{
SWI_dec(&processing_SWI);
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -