mirror of
https://github.com/clockworkpi/DevTerm.git
synced 2026-03-20 10:52:45 +01:00
add check_battery
This commit is contained in:
@@ -423,29 +423,6 @@ int glob_file(char*av) {
|
||||
|
||||
#endif
|
||||
|
||||
int bat_cap_to_pts(CONFIG*cfg) {
|
||||
int pts;
|
||||
long ret;
|
||||
char c[12];
|
||||
FILE *fptr;
|
||||
if ((fptr = fopen(BAT_CAP, "r")) == NULL) {
|
||||
printf("Error! Battery File cannot be opened\n");
|
||||
// Program exits if the file pointer returns NULL.
|
||||
return 0;
|
||||
}
|
||||
|
||||
fscanf(fptr, "%[^\n]", c);
|
||||
//printf("Data from the file:%s\n", c);
|
||||
fclose(fptr);
|
||||
|
||||
ret = strtol(c, NULL, 10);
|
||||
|
||||
pts = (int)round( (float)ret/10.0 ) + 1;
|
||||
return pts;
|
||||
}
|
||||
|
||||
|
||||
|
||||
uint8_t print_lines8(CONFIG*cfg) {
|
||||
uint8_t i,j,k;
|
||||
int8_t w;
|
||||
@@ -477,8 +454,6 @@ uint8_t print_lines8(CONFIG*cfg) {
|
||||
row = 0;
|
||||
rv = IsPaper();
|
||||
|
||||
cfg->max_pts = bat_cap_to_pts(cfg);
|
||||
|
||||
data = (uint8_t*)malloc(sizeof(uint8_t)*(pad+1));
|
||||
i=0;
|
||||
|
||||
@@ -607,7 +582,7 @@ uint8_t print_image8(CONFIG*cfg){
|
||||
addr = 0;
|
||||
|
||||
rv = IsPaper();
|
||||
cfg->max_pts = bat_cap_to_pts(cfg);
|
||||
|
||||
while(y < height )
|
||||
{
|
||||
x=0;
|
||||
|
||||
Reference in New Issue
Block a user