1
0
Fork 0
mirror of https://github.com/suchmememanyskill/TegraExplorer.git synced 2024-09-16 20:13:24 +01:00

Add charging icon

This commit is contained in:
suchmememanyskill 2021-01-08 19:32:06 +01:00
parent 99c2abeaf3
commit 981e5435ea
4 changed files with 22 additions and 10 deletions

View file

@ -121,6 +121,7 @@ static const u8 _gfx_font[] = {
0x00, 0x00, 0x00, 0x4C, 0x32, 0x00, 0x00, 0x00, // Char 126 (~)
0x00, 0x0C, 0x12, 0x7E, 0x42, 0x42, 0x7E, 0x00, // Char 127 (folder)
0x00, 0x0E, 0x12, 0x22, 0x22, 0x22, 0x3E, 0x00, // Char 128 (file)
0x00, 0x08, 0x0C, 0x0E, 0x7E, 0x70, 0x30, 0x10, // Char 129 (Charging)
};
u32 YLeftConfig = YLEFT;
@ -188,7 +189,7 @@ void gfx_putc(char c)
switch (gfx_con.fntsz)
{
case 16:
if (c >= 32 && c <= 128)
if (c >= 32 && c <= 129)
{
u8 *cbuf = (u8 *)&_gfx_font[8 * (c - 32)];
u32 *fb = gfx_ctxt.fb + gfx_con.x + gfx_con.y * gfx_ctxt.stride;
@ -265,7 +266,7 @@ void gfx_putc(char c)
break;
case 8:
default:
if (c >= 30 && c <= 126)
if (c >= 30 && c <= 129)
{
u8 *cbuf = (u8 *)&_gfx_font[8 * (c - 32)];
u32 *fb = gfx_ctxt.fb + gfx_con.x + gfx_con.y * gfx_ctxt.stride;

View file

@ -1,22 +1,30 @@
#include "gfx.h"
#include "gfxutils.h"
#include <power/max17050.h>
#include <power/max17050.h>
#include <power/bq24193.h>
#include "../hid/hid.h"
void gfx_clearscreen(){
void gfx_printTopInfo() {
int battery = 0;
max17050_get_property(MAX17050_RepSOC, &battery);
//gfx_clear_grey(0x1B);
gfx_boxGrey(0, 16, 1279, 703, 0x1b);
int current_charge_status = 0;
bq24193_get_property(BQ24193_ChargeStatus, &current_charge_status);
SETCOLOR(COLOR_DEFAULT, COLOR_WHITE);
gfx_con_setpos(0, 0);
gfx_printf("Tegraexplorer %d.%d.%d | Battery: %d%% %c\n", LP_VER_MJ, LP_VER_MN, LP_VER_BF, battery >> 8, ((current_charge_status) ? 129 : 32));
RESETCOLOR;
}
void gfx_clearscreen(){
gfx_boxGrey(0, 16, 1279, 703, 0x1b);
gfx_boxGrey(0, 703, 1279, 719, 0xFF);
gfx_boxGrey(0, 0, 1279, 15, 0xFF);
gfx_con_setpos(0, 0);
gfx_printf("Tegraexplorer %d.%d.%d | Battery: %3d%%\n", LP_VER_MJ, LP_VER_MN, LP_VER_BF, battery >> 8);
RESETCOLOR;
gfx_printTopInfo();
}
MenuEntry_t YesNoEntries[] = {

View file

@ -15,4 +15,5 @@
void gfx_clearscreen();
int MakeHorizontalMenu(MenuEntry_t *entries, int len, int spacesBetween, u32 bg, int startPos);
int MakeYesNoHorzMenu(int spacesBetween, u32 bg);
int MakeYesNoHorzMenu(int spacesBetween, u32 bg);
void gfx_printTopInfo();

View file

@ -160,8 +160,10 @@ int newMenu(Vector_t* vec, int startIndex, int screenLenX, int screenLenY, u8 op
break;
}
}
else
else {
holdTimer = 300;
gfx_printTopInfo();
}
}
lastPress = get_tmr_ms();