![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Versão do protegemed que calcula o tempo em ms da fuga, calcula o numero de onverflow (valores muito baixo) e underflow (valores muito altos). Além disso, calcula um valor médio a partir dos valores capturados e não apenas pela fft.
Dependencies: EthernetInterface mbed-rtos mbed
Diff: Codes/Capture.cpp
- Revision:
- 2:86c3cb25577b
- Parent:
- 1:917ca6b5d9d9
--- a/Codes/Capture.cpp Fri Jul 18 20:24:45 2014 +0000 +++ b/Codes/Capture.cpp Mon Jul 21 00:58:34 2014 +0000 @@ -8,8 +8,11 @@ Semaphore Capture::m_CaptureSemaphore(1); //used to alert the capture thread about a ready capture int Capture::m_BufferIndex; -dmaLinkedListNode Capture::m_Nodes[2] __attribute__((section("AHBSRAM0"))); //this list holds the buffer configuration for the DMA peripheral -unsigned short int Capture::m_AdcBuffers[2][NUMBER_OF_SAMPLES][NUMBER_OF_CHANNELS] __attribute__((section("AHBSRAM0"))); + +//extern char LargeBuffer[1024]; + +__attribute((section("AHBSRAM1"),aligned)) dmaLinkedListNode Capture::m_Nodes[2];// __attribute__((section("AHBSRAM0"))); //this list holds the buffer configuration for the DMA peripheral +__attribute((section("AHBSRAM1"),aligned)) unsigned short int Capture::m_AdcBuffers[2][NUMBER_OF_SAMPLES][NUMBER_OF_CHANNELS];// __attribute__((section("AHBSRAM0"))); //Serial rfid_serial(p28,p27); //This function prepares the capture buffers and starts the DMA peripheral @@ -36,6 +39,7 @@ //This function initializes the ADC and DMA peripherals void Capture::Initialize() { + //printf("0x%lx\n", LargeBuffer); init_adc(Settings::get_FreqBase()*NUMBER_OF_SAMPLES*NUMBER_OF_CHANNELS); select_channels(ADC_CH_0|ADC_CH_1|ADC_CH_2|ADC_CH_3|ADC_CH_4|ADC_CH_5); LPC_ADC->ADCR |= ADC_MODE_BURST;