📄 ui_main.c
字号:
/****************************
* ui_main.c
****************************/
#include <string.h>
#include "api.h"
#include "lcd.h"
#include "common.h"
#include "ap_common.h"
#include "display.h"
#include "res.h"
#include "res_show.h"
#include "ui_main.h"
#include "batt.h"
#include "prefer.h"
INT16U charge_count=0;
void ui_show_data(UINT8 *buf, UINT8 x, UINT8 y)
{
while(1)
{
if(*buf!=0)bResShowPic(PRGNUM0+*buf-0x30, x, y);
else
break;
buf++;
x+=11;
}
}
void ui_show_data1(char *buf, UINT8 x, UINT8 y)
{
while(1)
{
if(*buf!=0)bResShowPic(TIMENUM0+*buf-0x30, x, y);
else
break;
buf++;
x+=5;
}
}
void ui_show_data2(char *buf, UINT8 x, UINT8 y)
{
while(1)
{
if(*buf!=0)bResShowPic(MNUM0+*buf-0x30, x, y);
else
break;
buf++;
x+=5;
}
}
void ui_show_a(UINT16 id)
{
bResShowPic(id, POSITION_A, POSITIONY_A);
}
void ui_show_b(UINT16 id)
{
bResShowPic(id, POSITION_B, POSITIONY_B);
}
void ui_show_c(UINT16 id)
{
bResShowPic(id, POSITION_C, POSITIONY_C);
}
#ifndef MUSICAP
void ui_show_cd(UINT8 *string, UINT8 part)//???
{
if(part == 0)
{
ui_show_data(string,POSITION_C+5, POSITIONY_D);
}
else
{
ui_show_data(string,POSITION_C+5, POSITIONY_D2);
}
}
#endif
void ui_show_d(UINT8 *string, UINT8 part)
{
if(part == 0)
{
ui_show_data(string,40, 114);
}
else
{
ui_show_data2(string,8, 124);
}
}
#ifndef MUSICAP
//id =0, clear the icon
void ui_show_e(UINT16 id)
{
bResShowPic(id, POSITION_E, POSITIONY_E);
}
#endif
void ui_show_h(UINT8 *string,UINT8 mode)
{
if(mode)
ui_show_data(string,POSITION_H, POSITIONY_H);
else
ui_show_data(string,POSITION_H1, POSITIONY_H1);
}
void ui_show_vol()
{
char temp[3];
my_sprintf(temp, "%02d", (UINT16)tUserPreference.u8Volume);
bResShowPic(MVOL,66,144);
bResShowPic(TVNUM0+temp[0]-0x30,86,147);
bResShowPic(TVNUM0+temp[1]-0x30,86+5,147);
}
void ui_show_j(UINT16 id)
{
bResShowPic(id, POSITION_J, POSITIONY_J);
}
#ifndef FMAP
void ui_show_spk(UINT8 mode)
{
// if(mode) bResShowPic(SPEAKERY, 110, POSITIONY_A);
// else bResShowPic(SPEAKERN, 110, POSITIONY_A);
}
#else
void ui_show_spk(UINT8 mode)
{
// if(mode) bResShowPic(SPEAKERY, 110, 112);
// else bResShowPic(SPEAKERN, 110, 112);
}
#endif
void OpenClose_spk(UINT8 mode)
{
}
void ui_show_batt()
{
INT8U u8b = api_u8GetBatteryRemain();
if(u8b-19<=4)
bResShowPic(BATTERY1+(u8b-19)*2,POS_BATTERY, POSY_BATTERY);
else
bResShowPic(BATTERY1+8,POS_BATTERY, POSY_BATTERY);
}
void ui_show_charge()
{
INT8U u8b = api_u8GetBatteryRemain();
{
if(charge_count<7)
{
charge_count++;
}
else
{
charge_count = 0;
}
bResShowPic(BATTERY1+charge_count,POS_BATTERY,POSY_BATTERY);
}
}
void ui_show_charge1()
{
INT8U u8b = api_u8GetBatteryRemain();
{
if(charge_count<7)
{
charge_count++;
}
else
{
charge_count = 0;
}
bResShowPic(BATTERY1+charge_count, POS_BATTERY,POSY_BATTERY);
}
}
void ui_show_lock(UINT8 islock)
{
// if(islock == 1)
// {
// bResShowPic(LOCK,11,9);
// }
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -