aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-16 19:45:51 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-16 19:45:51 +0200
commit29835759655b94e7f45b68489ee14e3b4308570d (patch)
tree556235c481c64209de6a743570fa6c427a8d7439 /src
parentHex, removed lowbat bin (diff)
downloadlowbat-bsd-29835759655b94e7f45b68489ee14e3b4308570d.tar.gz
lowbat-bsd-29835759655b94e7f45b68489ee14e3b4308570d.tar.bz2
lowbat-bsd-29835759655b94e7f45b68489ee14e3b4308570d.tar.xz
lowbat-bsd-29835759655b94e7f45b68489ee14e3b4308570d.tar.zst
lowbat-bsd-29835759655b94e7f45b68489ee14e3b4308570d.zip
Now getting percent
Diffstat (limited to 'src')
-rw-r--r--src/jo_lowbat.h1
-rw-r--r--src/jo_main.c6
2 files changed, 6 insertions, 1 deletions
diff --git a/src/jo_lowbat.h b/src/jo_lowbat.h
index b39243e..9a3b9e3 100644
--- a/src/jo_lowbat.h
+++ b/src/jo_lowbat.h
@@ -22,5 +22,6 @@ enum
};
int8_t jo_f_status(void);
+int8_t jo_f_percent(void);
#endif
diff --git a/src/jo_main.c b/src/jo_main.c
index e5576b3..7ee0c83 100644
--- a/src/jo_main.c
+++ b/src/jo_main.c
@@ -22,10 +22,14 @@ int
main(void)
{
int8_t status;
+ int8_t percent;
if ((status = jo_f_status()) < 0) {
return (JO_RET_RD_FAILED);
}
- printf("status: %d\n", status);
+ if ((percent = jo_f_percent()) < 0) {
+ return (JO_RET_RD_FAILED);
+ }
+ printf("status: %hhd, %hhd%%\n", status, percent);
return (JO_RET_FINE);
}