Ejemplo n.º 1
0
//****************************************************************************
//! Main function
//!
//! \param none
//! 
//! \return None.
//
//****************************************************************************
void main()
{
    // Initialize the board
    BoardInit();
    // Configure the pinmux settings for the peripherals exercised
    PinMuxConfig();

	#ifndef NOTERM
		// Configuring UART
		InitTerm();
		ClearTerm();
	#endif

    // Start the TCPServer task
    long lRetVal = osi_TaskCreate(InfiniteLoopTask,
                    (const signed char *)"Infinite Loop Task",
                    OSI_STACK_SIZE, 
                    NULL, 
                    1, 
                    NULL );
    if(lRetVal < 0)
    {
        ERR_PRINT(lRetVal);

        while(1);
    }

    // Start the task scheduler
    osi_start();

    TimerDeinitStop();
}
Ejemplo n.º 2
0
//this function accepts a pointer to a buffer
//and the number of seconds of recording is desired
//and fills the buffer with microphone data
//it returns the number of bytes of data stored in the buffer.
//The current system is set up to record 10000 samples per second.
//this corresponds to 20000 bytes per second
// some common values of numSeconds
// milSec = 1000 -> 20000 bytes
uint32_t GetAudio(char * buf, int milSec){

	uint32_t numSamples = milSec * (SAMPLE_RATE / 1000);
	TimerConfigNStart(numSamples, buf);
	//TimerConfigNStart(1000, buf);

	while(!RecordingDone){
	}
	TimerDeinitStop();
	return MIC_SAMPLE_SIZE*CurrentSamples;

}