summaryrefslogtreecommitdiffstats
path: root/FFT_Test/main.hcc
blob: 088305a22053fe1a12fa50878be803cef16a98ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/****************************************************************
*                                                               *
* Copyright (C) 1991-2003 Celoxica Ltd. All rights reserved.    *
*                                                               *
*****************************************************************
*                                                               *
* Project   :   PAL                                             *
* Date      :   31 JAN 2003                                     *
* File      :   reverb.hcc                                      *
* Author    :   Matthew Aubury (MA)                             *
* Contributors:                                                 *
*                                                               *
* Description:                                                  *
*    Simple audio reverb.                                       *
*                                                               *
* Date         Version  Author  Reason for change               *
*                                                               *
* 29 OCT 2002    1.00    MA     Created                         *
*                                                               *
****************************************************************/
#define PAL_TARGET_CLOCK_RATE 25175000
 

#include <stdlib.hch>
#include "pal_master.hch"

#include "runfft.hch"
#include "debug.hch"

/*
 * Forward declarations
 */

static macro expr ClockRate = PAL_ACTUAL_CLOCK_RATE;

/*
 * Main program
 */
void main(void)
{
    macro expr AudioIn  = PalAudioInCT  (0);
    macro expr AudioOut = PalAudioOutCT (0);
    
    /*
     * Check we've got everything we need
     */
    PalVersionRequire  (1, 2);
    PalAudioInRequire  (1);
    PalAudioOutRequire (1);
    PalDataPortRequire (1);

    
    /*
     * Run
     */
    par
    {
        PalAudioInRun  (AudioIn,  ClockRate);
        PalAudioOutRun (AudioOut, ClockRate);
	PalDataPortRun (PalRS232PortCT(0), PAL_ACTUAL_CLOCK_RATE );

        
        seq
        {
            par
            {
                PalAudioInEnable  (AudioIn);
                PalAudioOutEnable (AudioOut);
		PalDataPortEnable (PalRS232PortCT(0));
			
            }
	    RC200AudioInSetInput(RC200AudioInLineIn);
	    RC200AudioInSetGain(0,6,6);
            PalAudioInSetSampleRate  (AudioIn,  44100);
            PalAudioOutSetSampleRate (AudioOut, 44100);

	    RunFFT(AudioIn, AudioOut);		
        }
    }
}