X-Git-Url: http://git.smho.de/gw/?p=owSlave2.git;a=blobdiff_plain;f=DS18B20_CDM7160%2FDS18B20_CDM7160.c;fp=DS18B20_CDM7160%2FDS18B20_CDM7160.c;h=1c18216e07fe4d83181eab1e9fe76a0555f1e7fe;hp=b46797cceb74c6ad8fc2d5989da6ab537da9df94;hb=2490e261a78b2a98ee2a9b8fc19cb3f20225926b;hpb=45806622c08cded7d77c9c9735c433de5f7fa027 diff --git a/DS18B20_CDM7160/DS18B20_CDM7160.c b/DS18B20_CDM7160/DS18B20_CDM7160.c index b46797c..1c18216 100644 --- a/DS18B20_CDM7160/DS18B20_CDM7160.c +++ b/DS18B20_CDM7160/DS18B20_CDM7160.c @@ -47,7 +47,7 @@ extern void EXTERN_SLEEP(); uint8_t owid[8]={0x28, 0xA2, 0xD9, 0x84, 0x00, 0x16, 0x77, 0x6B};/**/ -uint8_t config_info[26]={10,13, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x02,16,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; +uint8_t config_info[26]={10,21, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x02,16,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; #if (owid>128) #error "Variable not correct" @@ -76,7 +76,7 @@ uint8_t max_adr=0; typedef union { volatile uint8_t bytes[8]; struct { - uint16_t temp; //0 + int16_t temp; //0 uint8_t TH; //2 uint8_t TL; //3 uint8_t config; //4 @@ -95,6 +95,8 @@ volatile pack_t pack; int main(void){ + PORTB&=~(1<(PBR+1)) { wdcounter=0; //PORTB|=(1<>4; - uint8_t af=0; + volatile int16_t l=(int16_t)CDM7160getCO2()-1280; + int16_t w=l; + int8_t t8=w/16; + int8_t af=0; if (t8>pack.TH) af=1; if (t8<=pack.TL) af=1; cli();