Skip to content

Commit

Permalink
Fix the return value of Get_Temperature in ad26.c
Browse files Browse the repository at this point in the history
Returning FALSE for a double doesn't do a good job of indicating an
error. Use -999.0 instead.
  • Loading branch information
bcl committed Jul 25, 2017
1 parent c5dcdfd commit bd68ae9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions userial/ad26.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,10 @@ float Volt_Reading(int portnum, int vdd, int *cad)

}

/* Return the temperature (in C) or -999.0 if there was a problem */
double Get_Temperature(int portnum)
{
double ret=-1.0;
double ret=-999.0;
uchar send_block[50];
int send_cnt=0;
int i;
Expand All @@ -294,7 +295,7 @@ double Get_Temperature(int portnum)
send_block[send_cnt++] = 0x00;

if(!owBlock(portnum,FALSE,send_block,send_cnt))
return FALSE;
return ret;

send_cnt = 0;
}
Expand Down

0 comments on commit bd68ae9

Please sign in to comment.