Mercurial > public > ostc4
comparison Discovery/Src/logbook.c @ 617:4eba86129d35
Development bugfix: Low battery warning was interpretated as marker:
The previous version checked event bit 1 and 2 and returned a marker in case both were set. The indication for a battery low warning is that the 3 LSBit of the event byte are set => not intended marker in case of low battery situation. To fix this an additional check for bit0 has been added.
| author | Ideenmodellierer |
|---|---|
| date | Wed, 27 Jan 2021 22:03:11 +0100 |
| parents | ae7f8333c900 |
| children | 1b995079c045 |
comparison
equal
deleted
inserted
replaced
| 616:a594a778c883 | 617:4eba86129d35 |
|---|---|
| 737 bytesRead ++; | 737 bytesRead ++; |
| 738 | 738 |
| 739 length--; | 739 length--; |
| 740 | 740 |
| 741 /* marker */ | 741 /* marker */ |
| 742 if(eventByte1.ub.bit1 && eventByte1.ub.bit2 && event != NULL) | 742 if((eventByte1.ub.bit1 && eventByte1.ub.bit2 && !eventByte1.ub.bit0) && (event != NULL)) /* 3 lsb low bit means battery low */ |
| 743 { | 743 { |
| 744 *event = 1; | 744 *event = 1; |
| 745 } | 745 } |
| 746 | 746 |
| 747 //second event byte | 747 //second event byte |
