RSC: Fixing static analysis issues

Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
This commit is contained in:
Abhishek Malik
2017-04-03 21:53:27 -07:00
parent dc7c012c24
commit 356f0348ed
3 changed files with 14 additions and 16 deletions

View File

@@ -137,10 +137,7 @@ string RSC::getPressureType()
uint8_t *RSC::getInitialADCState()
{
uint8_t initialState[4]={0,0,0,0};
if(rsc_get_initial_adc_values(m_rsc, initialState) != UPM_SUCCESS) {
throw std::runtime_error(std::string(__FUNCTION__) +
": Unable to read the ADC state from the eeprom");
}
rsc_get_initial_adc_values(m_rsc, initialState);
int cnt = 0;
for (cnt = 0; cnt<4; cnt++)
m_adc_coeff[cnt]=initialState[cnt];
@@ -176,16 +173,10 @@ float RSC::getPressure()
void RSC::setMode(RSC_MODE mode)
{
if(rsc_set_mode(m_rsc, mode) != UPM_SUCCESS){
throw std::runtime_error(std::string(__FUNCTION__) +
": Unable to set the ADC mode");
}
rsc_set_mode(m_rsc, mode);
}
void RSC::setDataRate(RSC_DATA_RATE dr)
{
if(rsc_set_data_rate(m_rsc, dr) != UPM_SUCCESS) {
throw std::runtime_error(std::string(__FUNCTION__) +
": Unable to set the ADC data rate");
}
rsc_set_data_rate(m_rsc, dr);
}