Rev 683 | Rev 797 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 683 | Rev 686 | ||
|---|---|---|---|
| Line 102... | Line 102... | ||
| 102 | for ( i=0; i<nSensors; i++ ) { |
102 | for ( i=0; i<nSensors; i++ ) { |
| 103 | if ( DS18X20_read_meas( &gSensorIDs[i][0], &subzero, &cel, &cel_frac_bits) == DS18X20_OK ) { |
103 | if ( DS18X20_read_meas( &gSensorIDs[i][0], &subzero, &cel, &cel_frac_bits) == DS18X20_OK ) { |
| 104 | 104 | ||
| 105 | if (subzero) { |
105 | if (subzero) { |
| 106 | txMsg.Data.bytes[0] = -cel-1; |
106 | txMsg.Data.bytes[0] = -cel-1; |
| 107 | //txMsg.Data.bytes[1] = ~(cel_frac_bits<<4); noddan har fixat korrekt decimal |
- | |
| 108 | txMsg.Data.bytes[1] = ~(cel_frac_bits); |
107 | txMsg.Data.bytes[1] = ~(cel_frac_bits<<4); |
| 109 | }else{ |
108 | }else{ |
| 110 | txMsg.Data.bytes[0] = cel; |
109 | txMsg.Data.bytes[0] = cel; |
| 111 | //txMsg.Data.bytes[1] = (cel_frac_bits<<4); noddan har fixat korrekt decimal |
- | |
| 112 | txMsg.Data.bytes[1] = (cel_frac_bits); |
110 | txMsg.Data.bytes[1] = (cel_frac_bits<<4); |
| 113 | } |
111 | } |
| 114 | } |
112 | } |
| 115 | /* Delay */ |
113 | /* Delay */ |
| 116 | timeStamp_DS_del = Timebase_CurrentTime(); |
114 | timeStamp_DS_del = Timebase_CurrentTime(); |
| 117 | while(Timebase_PassedTimeMillis(timeStamp_DS_del) < DS_SEND_DELAY){} |
115 | while(Timebase_PassedTimeMillis(timeStamp_DS_del) < DS_SEND_DELAY){} |