ads1x15: fixed case logic in getThresh() function

Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
Mihai Tudor Panu 2017-05-30 15:14:09 -07:00
parent 8186d093ec
commit c64d04d084
2 changed files with 3 additions and 3 deletions

View File

@ -116,7 +116,7 @@ ADS1X15::setContinuous(bool mode){
float
ADS1X15::getThresh(ADSTHRESH reg){
if( THRESH_HIGH && THRESH_LOW) return getLastSample(reg);
if(reg == THRESH_HIGH || reg == THRESH_LOW) return getLastSample(reg);
else return 0.0;
}

View File

@ -390,7 +390,7 @@ namespace upm {
* @param reg ADSTHRES enum value.
* Returns 0.0 unless THRESH_HIGH or THRESH_LOW requested.
*/
float getThresh(ADSTHRESH reg = THRESH_LOW);
float getThresh(ADSTHRESH reg = THRESH_DEFAULT);
/**
* Sets threshold levels or configures for conversion ready