add first rev of eeprom

and ref voltage in varhandler
This commit is contained in:
2022-12-13 14:30:40 +01:00
parent bf7cde9730
commit 7cadcdbc28
47 changed files with 30486 additions and 1377 deletions

View File

@ -52,8 +52,6 @@
#define ADC_RES (4096) // ADC resolution: 12 bits
#define NR_OF_ADCS ANPI_eInNumberOfInputs // number of internal adc channels
#define INT_ADC_REF (3.3f)// int. reference voltage for conversion
#define BUFFER_SIZE NR_OF_ADCS * 2
#define BUFFER_HALF_SIZE NR_OF_ADCS
@ -95,8 +93,6 @@ LOCAL osThreadId_t m_pstThreadID = NULL;
LOCAL osEventFlagsId_t m_pstEventID = NULL;
LOCAL osMutexId_t m_pstMutexID = NULL;
LOCAL FLOAT flRefVoltage = INT_ADC_REF;
//=================================================================================================
// Section: LOCAL CONSTANTS
// Description: Definition of local constants (visible by this module only).
@ -200,17 +196,6 @@ BOOL ANPI_boInitializeModule( VOID )
return( boOK );
}
//-------------------------------------------------------------------------------------------------
// Function: ANPI_vSetRefVoltage
// Description: Sets the Reference Voltage for calculating the Voltage
// Parameters: FLOAT flVoltage -> The Ref Voltage measured with an DMM for example
// Returns: None
//-------------------------------------------------------------------------------------------------
VOID ANPI_vSetRefVoltage( FLOAT flVoltage )
{
flRefVoltage = flVoltage;
}
//-------------------------------------------------------------------------------------------------
// Function: ANPI_vTask
// Description: ANPI_vTask
@ -244,6 +229,8 @@ VOID vTask( PVOID arg )
for( U16 u16Cnt = 0; u16Cnt < BUFFER_HALF_SIZE; u16Cnt++ )
au32ADCRawData[ u16Cnt ] = m_au16ADCDataBuffer[u16Cnt + u16Offset];
FLOAT flRefVoltage = VARH_flGetVariableData(VARH_eRef_U);
// multiply conversion factor and add the offset
for( U16 u16Cnt = 0; u16Cnt < ANPI_eInNumberOfInputs; u16Cnt++ )
{