Тесты фильтрования
Оно добавляют задержку и сдвиг по фазе надо чет думать
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef __STATIC_FORCEINLINE
|
||||
#define __STATIC_FORCEINLINE static __forceinline
|
||||
#define __STATIC_FORCEINLINE //static __forceinline
|
||||
#endif
|
||||
|
||||
#ifndef __NO_RETURN
|
||||
|
||||
@@ -311,21 +311,6 @@ uint32_t ADC_Get_Sequence_Channel(ADC_TypeDef* ADCx, uint32_t rank)
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////---DMA FUNCTIONS---///////////////////////////////
|
||||
void ADC_DMA_Sim_Transfer(ADC_TypeDef* ADCx, struct ADC_Sim* ADCS)
|
||||
{
|
||||
if (!ADCS->dma_buffer || ADCS->dma_buffer_size == 0) return;
|
||||
|
||||
ADCS->dma_buffer[ADCS->dma_current_index] = ADCx->DR;
|
||||
ADCS->dma_current_index++;
|
||||
|
||||
if (ADCS->dma_current_index >= ADCS->dma_buffer_size) {
|
||||
if (ADCS->dma_circular) {
|
||||
ADCS->dma_current_index = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////---CHANNEL FUNCTIONS---///////////////////////////
|
||||
void ADC_Set_Channel_Value(ADC_TypeDef* ADCx, uint32_t channel, double voltage)
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef STM32F4
|
||||
#define ADC_NOISE_LSB 10 // Шум в LSB (квантах АЦП)
|
||||
#define ADC_NOISE_LSB 20 // Шум в LSB (квантах АЦП)
|
||||
#endif
|
||||
|
||||
/////////////////////////////---STRUCTURES---///////////////////////////
|
||||
@@ -23,12 +23,6 @@ struct ADC_Sim
|
||||
double channel_values[19];
|
||||
uint8_t channel_connected[19];
|
||||
|
||||
// DMA
|
||||
uint32_t* dma_buffer;
|
||||
uint32_t dma_buffer_size;
|
||||
uint32_t dma_current_index;
|
||||
uint8_t dma_circular;
|
||||
|
||||
// Timing
|
||||
double simulation_step;
|
||||
double adc_clock_freq;
|
||||
|
||||
@@ -65,6 +65,9 @@ void Overflow_Check(TIM_TypeDef* TIMx, struct TIM_Sim* TIMS)
|
||||
else if (TIMS->tx_cnt < 0)
|
||||
TIMS->tx_cnt += TIMS->RELOAD+1;
|
||||
|
||||
if(TIMS->tx_step > TIMS->RELOAD)
|
||||
TIMS->tx_cnt = 0;
|
||||
|
||||
TIM_Call_IRQHandller(TIMx); // call HANDLER
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user