fix error handling temp
This commit is contained in:
parent
4e3b086afd
commit
a237949da4
@ -146,7 +146,7 @@ PRIVATE VOID vTask( PVOID arg )
|
||||
UNUSED( arg );
|
||||
|
||||
BOOL boOK = TRUE;
|
||||
U8 u8error;
|
||||
U8 u8error = 0;
|
||||
U16 u16ADC_data;
|
||||
FLOAT flTempData[ADCD_eNumberOfTemps];
|
||||
|
||||
@ -161,16 +161,21 @@ PRIVATE VOID vTask( PVOID arg )
|
||||
flTempData[ADCD_eWater] = flConvertADCData( u16ADC_data );
|
||||
} else {
|
||||
if( (u8error & ADCD_STATUS_DATA_ERROR) == ADCD_STATUS_DATA_ERROR ){
|
||||
flTempData[ADCD_eWater] = -273.16f;
|
||||
|
||||
|
||||
/** @todo call error handler temp data */
|
||||
} else if( (u8error & ADCD_SPI_FAILURE) == ADCD_SPI_FAILURE ){
|
||||
flTempData[ADCD_eWater] = -273.16f;
|
||||
|
||||
|
||||
/** @todo call error handler onchip spi failure */
|
||||
}
|
||||
flTempData[ADCD_eWater] = -273.16f;
|
||||
|
||||
u8error = 0;
|
||||
boOK = TRUE;
|
||||
}
|
||||
|
||||
|
||||
boOK &= ADCD_boReadData( ADCD_eModule, &u8error, &u16ADC_data );
|
||||
|
||||
if( boOK )
|
||||
@ -178,21 +183,27 @@ PRIVATE VOID vTask( PVOID arg )
|
||||
flTempData[ADCD_eModule] = flConvertADCData( u16ADC_data );
|
||||
} else {
|
||||
if( (u8error & ADCD_STATUS_DATA_ERROR) == ADCD_STATUS_DATA_ERROR ){
|
||||
flTempData[ADCD_eModule] = -273.16f;
|
||||
|
||||
|
||||
/** @todo call error handler temp data */
|
||||
} else if( (u8error & ADCD_SPI_FAILURE) == ADCD_SPI_FAILURE ){
|
||||
flTempData[ADCD_eModule] = -273.16f;
|
||||
|
||||
|
||||
/** @todo call error handler onchip spi failure */
|
||||
}
|
||||
|
||||
flTempData[ADCD_eModule] = -273.16f;
|
||||
|
||||
u8error = 0;
|
||||
boOK = TRUE;
|
||||
}
|
||||
|
||||
|
||||
VARH_vSetVariableDataFromSystemFloat( VARH_eTemp_Water, flTempData[ADCD_eWater] );
|
||||
VARH_vSetVariableDataFromSystemFloat( VARH_eTemp_Module, flTempData[ADCD_eModule] );
|
||||
VARH_vSetVariableDataFromSystemFloat( VARH_eTemp_Diff, flTempData[ADCD_eWater] - flTempData[ADCD_eModule] );
|
||||
|
||||
boOK = TRUE;
|
||||
|
||||
osDelay(REFRESH_MS);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user