changes analog ports in

This commit is contained in:
Noah Piqué
2021-12-01 16:11:28 +01:00
parent 85d12f2da5
commit 53ec4e3f2b
2 changed files with 7 additions and 7 deletions

View File

@ -52,7 +52,7 @@
//=================================================================================================
#define ADC_RES (4096) // ADC resolution: 12 bits
#define NR_OF_ADCS 5 // number of internal adc channels
#define NR_OF_ADCS ANPI_eInNumberOfInputs // number of internal adc channels
#define INT_ADC_REF (3.2968f)// int. reference voltage for conversion
@ -240,8 +240,8 @@ VOID ANPI_vTask( PVOID arg )
{
U32 u32Flags;
U16 u16Offset;
FLOAT u_adc;
static U32 m_au32ADCRawData[ANPI_eInNumberOfInputs];
FLOAT flUadc;
U32 m_au32ADCRawData[ANPI_eInNumberOfInputs];
osDelay( 1 ); // Wait 1ms to have a Valid Value
@ -265,8 +265,8 @@ VOID ANPI_vTask( PVOID arg )
// multiply conversion factor and add the offset
for(U16 u16Cnt = 0; u16Cnt < ANPI_eInNumberOfInputs; u16Cnt++ )
{
u_adc = (FLOAT)m_au32ADCRawData[u16Cnt] / OVERSAMPLING_DIVISOR / ADC_RES * INT_ADC_REF;
m_aflValues[u16Cnt] = u_adc * m_aflConversionFactor[u16Cnt] - m_aflOffset[u16Cnt];
flUadc = (FLOAT)m_au32ADCRawData[u16Cnt] / OVERSAMPLING_DIVISOR / ADC_RES * INT_ADC_REF;
m_aflValues[u16Cnt] = flUadc * m_aflConversionFactor[u16Cnt] - m_aflOffset[u16Cnt];
}
osMutexRelease( m_pstMutexID ); // release mutex