Skip to content

Commit 2dc4404

Browse files
committed
REMAINING_CAPACITY_ALARM_FLAG Bug - thanks to 1yura
1 parent d5d12ae commit 2dc4404

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# SMB - Smart Battery Module (Laptop Battery Pack) Info
2-
32
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
43

54
Prints SBM controller info
@@ -130,3 +129,8 @@ Remaining Capacity: 5099 mAh
130129
Minutes remaining until empty: 2913 min
131130
Average minutes remaining until empty: 2913 min
132131
```
132+
133+
134+
<a href="https://github.com/ArminJo">
135+
<img src="https://hitcounter.pythonanywhere.com/count/tag.svg?url=https%3A%2F%2Fgithub.com%2FArminJo%2FSmart-Battery-Module-Info_For_Arduino" alt="Hits">
136+
</a>

src/SBMInfo/SBMInfo.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ const char StringCapacityModePower[] = "0 mW"; // 10mWh
7979
* Bits of BatteryStatus
8080
*/
8181
// Alarm Bits
82-
#define OVER_CHARGED_ALARM 0x8000
83-
#define TERMINATE_CHARGE_ALARM 0x4000
84-
#define OVER_TEMP_ALARM 0x1000
85-
#define TERMINATE_DISCHARGE_ALARM 0x0800
82+
#define OVER_CHARGED_ALARM__FLAG 0x8000
83+
#define TERMINATE_CHARGE_ALARM_FLAG 0x4000
84+
#define OVER_TEMP_ALARM_FLAG 0x1000
85+
#define TERMINATE_DISCHARGE_ALARM_FLAG 0x0800
8686
#define REMAINING_CAPACITY_ALARM_FLAG 0x0200
8787
#define REMAINING_TIME_ALARM_FLAG 0x0100
8888

src/SBMInfo/SBMInfo.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -573,19 +573,19 @@ void printBatteryStatus(struct SBMFunctionDescriptionStruct * aDescription, uint
573573
/*
574574
* Error Bits
575575
*/
576-
if (aStatus & OVER_CHARGED_ALARM) {
576+
if (aStatus & OVER_CHARGED_ALARM__FLAG) {
577577
Serial.println(F("- OVER_CHARGED_ALARM"));
578578
}
579-
if (aStatus & TERMINATE_CHARGE_ALARM) {
579+
if (aStatus & TERMINATE_CHARGE_ALARM_FLAG) {
580580
Serial.println(F("- TERMINATE_CHARGE_ALARM"));
581581
}
582-
if (aStatus & OVER_TEMP_ALARM) {
582+
if (aStatus & OVER_TEMP_ALARM_FLAG) {
583583
Serial.println(F("- OVER_TEMP_ALARM"));
584584
}
585-
if (aStatus & TERMINATE_DISCHARGE_ALARM) {
585+
if (aStatus & TERMINATE_DISCHARGE_ALARM_FLAG) {
586586
Serial.println(F("- TERMINATE_DISCHARGE_ALARM"));
587587
}
588-
if (aStatus & REMAINING_CAPACITY_ALARM) {
588+
if (aStatus & REMAINING_CAPACITY_ALARM_FLAG) {
589589
Serial.println(F("- REMAINING_CAPACITY_ALARM"));
590590
}
591591
if (aStatus & REMAINING_TIME_ALARM_FLAG) {

0 commit comments

Comments
 (0)