?? read_flash.c
字號:
#include "Sample Playback.h"
//This subroutine reads one 16-bit audio sample from FLASH using
//core accesses of the PP. It fetches this sample from a byte address
//that is passed in as the argument bAddr.
void read_flash_samples (void)
{
Csample* P2Sample;
int temp;
P2Sample = FirstSample;
while(P2Sample){
//configure general PP settings
(*pPPCTL) = PPBHC|PPDUR20;
(*pEIPP) = P2Sample->CurrentAddr; //External Index
(*pEMPP) = 1; //External Modify
//and then or in bit's to initiate DMA
(*pPPCTL) |= (PPEN);
// (with PPEN = 1 and PPDEN =0 core read's of the RXPP buffer cause
// the PP to fetch 32bits of data based on EIPP and EMPP.)
//----CONDITION SAMPLE -----------------------
// PP fetches 32bits, but only 16 msb's of data are valid (signed integer).
// To convert to float, shift it right by 16 (first cast to int to maintain sign bit)
//P2Sample->CurrentVal = (float)( (int)(*pRXPP) >> 16 );
// To be clear for this example, above instr. is equivalent
// to these:
#if 1
temp = (*pRXPP); //fetch sample
temp = temp >> 16; //shift to lsb's
P2Sample->CurrentVal = (float)temp; //convert in to float
#endif
P2Sample=P2Sample->Next;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -