ome fixes

This commit is contained in:
andreask 2020-09-05 18:12:04 +02:00
parent d39bd6b8b0
commit 616a3af2c0
2 changed files with 9 additions and 4 deletions

View file

@ -93,7 +93,7 @@
#endif
#ifdef HAS_MANNLCOUNTER
volatile uint8_t count_min = 0;
volatile uint16_t count_min = 0;
volatile uint32_t count_all = 0;
volatile unsigned long alteZeit=0, entprellZeit=20; //ms
#endif
@ -309,7 +309,7 @@ void loop()
#elif defined HAS_MANNLCOUNTER
struct lora_data {
uint8_t bat;
uint8_t count_min;
uint16_t count_min;
uint32_t count_all;
} __attribute__ ((packed)) data;
#elif defined HAS_ALARM
@ -388,6 +388,11 @@ void loop()
alarm = false;
#endif
#ifdef HAS_MANNLCOUNTER
data.count_all=count_all;
data.count_min=count_min;
#endif
#if defined DS18B20_PIN
#ifdef DS18B20_POWER

View file

@ -24,9 +24,9 @@ function Decoder(bytes, port) {
return decoded;
}
// Mannl-counter
if (bytes.length == 8){
if (bytes.length == 7){
decoded.countmin = ((bytes[1]) | (bytes[2] << 8 ));
decoded.countall = ((bytes[1]) | (bytes[2] << 8 ) | (bytes[3] << 16 ) | (bytes[4] << 24));
decoded.countall = ((bytes[3]) | (bytes[4] << 8 ) | (bytes[5] << 16 ) | (bytes[6] << 24));
return decoded;
}