增加显示电量的内容

This commit is contained in:
anod 2022-10-21 11:20:30 +08:00
parent c02aef0cb1
commit c7f0f4f342
2 changed files with 5 additions and 3 deletions

View File

@ -51,7 +51,7 @@ int main(void)
{
Result res = fMount(FS_DRIVE_SDMC);
if(res == RES_OK) res = oafParseConfigEarly();
GFX_init(GFX_RGB565, GFX_RGB565);
GFX_init(GFX_BGR8, GFX_RGB565);
setBacklight();
consoleInit(SCREEN_BOT, NULL);
//CODEC_init();

View File

@ -238,10 +238,12 @@ static atp_pageopt_t config_adjust( atp_callerdata_t, atp_counter_t index, atp_b
atp_error_t oaf_config_page()
{
u8 base[sizeof(g_oafConfig)];
char title[64];
memcpy( base, &g_oafConfig, sizeof(g_oafConfig) );
OafConfig *prev = (OafConfig*)&base[0];
atp_error_t res = atp_select( "参数配置", 4, config_item, config_adjust, NULL, 0, 0, NULL );
ee_snprintf(title, sizeof(title), "参数配置          电量%d%%", MCU_getBatteryLevel());
atp_error_t res = atp_select( title, 4, config_item, config_adjust, NULL, 0, 0, NULL );
if( res == ATP_NO_ACTION )
{
memcpy( &g_oafConfig, prev, sizeof(g_oafConfig) );
@ -682,7 +684,7 @@ static void gbaGfxHandler(void *args)
// 0x18180000 <----------> screen_top + 16*240*3 + 120 是正确对准左边对16求余为0右边为8
// 现在右边加上8是2|2/3个像素
GX_displayTransfer((u32*)(0x18180000 + 16*240*3), 368u<<16 | 240u,
GFX_getFramebuffer(SCREEN_TOP) + 16*240*2 + 80, 368u<<16 | 240u, 2u<<12 | 1u<<8);
GFX_getFramebuffer(SCREEN_TOP) + 16*240*3 + 96, 368u<<16 | 240u, 2u<<12 | 1u<<8);
}
else GX_displayTransfer((u32*)(0x18180000 + 16*240*3), 368u<<16 | 240u,
GFX_getFramebuffer(SCREEN_TOP) + 16*240*3, 368u<<16 | 240u, 1u<<12 | 1u<<8);