比较优雅的设置页面

Signed-off-by: kevin <kevin@lmve.net>
This commit is contained in:
2022-08-11 18:54:35 +08:00
parent c47fb33163
commit f2feab9cbb
35 changed files with 3421 additions and 3218 deletions
+51 -11
View File
@@ -26,7 +26,7 @@ button B1,TACKA,TACKB;//创建一个按钮
encoder E1;//创建一个编码器
int mode=0;
uint32_t run_tick=0,jump_tick=0;
char str[16];
char str[32];
uint16_t fps=0,fps_=0;
char sys_lan=0;
@@ -37,8 +37,8 @@ int test_code=0;
menu menu_main=
{
0,0,
"Back\nInput mode\nBuzzer\nDisplay\nLanguage\nAbout",
"返回\n输入模式\n蜂鸣器\n显示\n语言\n关于",5,
"Main GUI\nInput mode\nBuzzer\nDisplay\nLanguage\nAbout",
"主页\n输入模式\n蜂鸣器\n显示\n语言\n关于",5,
NULL
@@ -67,7 +67,7 @@ word turnoff=
};
int SHOW_MENU(menu *m,int encoder,char button,char lan)
int SHOW_MENU(menu *m,int encoder,char button,char lan,char dismode)
{
int return_code=-1;
const char *list;
@@ -99,8 +99,17 @@ int SHOW_MENU(menu *m,int encoder,char button,char lan)
OLED_Str_list(0,0,16,list,m->list_dis_top,4,1);
if(m->r_sw_list!=NULL)
{
OLED_Str_list(96,0,16,m->r_sw_list,m->list_dis_top,4,1);
}
if(dismode==1)
{
sprintf(temp,"%d/%d",m->sele,m->list_const);
OLED_Str(96,56,8,temp,0,1);
}
OLED_square(0,(m->sele-m->list_dis_top)*16,128,((m->sele-m->list_dis_top)*16)+16,2);
@@ -175,14 +184,13 @@ void mymain()
{
jump_tick=HAL_GetTick()+10000;
if(mode==2)
{
if(config_buzzer_for_sele_change==1)
if(config_buzzer_for_sele_change==1&&(mode==2||mode==3))
{
BUZZER_PLAY_NOTES(1000,50,50);
BUZZER_PLAY_NOTES(0,0,0);
}
}
}
@@ -230,7 +238,7 @@ void mymain()
case 2:
//菜单界面
switch(SHOW_MENU(&menu_main,encode_c,B1.code,sys_lan))
switch(SHOW_MENU(&menu_main,encode_c,B1.code,sys_lan,1))
{
case 0:
//jump to main GUI
@@ -248,11 +256,43 @@ void mymain()
case 3:
//buzzer setting
switch(SHOW_MENU(&buzzer_setting,encode_c,B1.code,sys_lan))
buzzer_setting.r_sw_list=&str;
sprintf(str,"../");
if(config_buzzer_for_button_pass)
{
sprintf(str,"%s%s",str,"\non");
}else
{
sprintf(str,"%s%s",str,"\nof");
}
if(config_buzzer_for_button_longpass)
{
sprintf(str,"%s%s",str,"\non");
}else
{
sprintf(str,"%s%s",str,"\nof");
}
if(config_buzzer_for_sele_change)
{
sprintf(str,"%s%s",str,"\non");
}else
{
sprintf(str,"%s%s",str,"\nof");
}
switch(SHOW_MENU(&buzzer_setting,encode_c,B1.code,sys_lan,0))
{
case 0:
//jump to main GUI
mode=1;
mode=2;
break;
case 1:
if(config_buzzer_for_button_pass){config_buzzer_for_button_pass=0;}else{config_buzzer_for_button_pass=1;}
break;
case 2:
if(config_buzzer_for_button_longpass){config_buzzer_for_button_longpass=0;}else{config_buzzer_for_button_longpass=1;}
break;
case 3:
if(config_buzzer_for_sele_change){config_buzzer_for_sele_change=0;}else{config_buzzer_for_sele_change=1;}
break;
}
File diff suppressed because one or more lines are too long
+1 -2
View File
@@ -10,7 +10,7 @@
<TargetName>f103c8t6_KEIL</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>6180000::V6.18::ARMCLANG</pCCUsed>
<pCCUsed>6160000::V6.16::ARMCLANG</pCCUsed>
<uAC6>1</uAC6>
<TargetOption>
<TargetCommonOption>
@@ -186,7 +186,6 @@
<RvdsVP>0</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<nBranchProt>0</nBranchProt>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
Binary file not shown.
Binary file not shown.
@@ -3,29 +3,29 @@
<pre>
<h1>µVision Build Log</h1>
<h2>Tool Versions:</h2>
IDE-Version: µVision V5.37.0.0
Copyright (C) 2022 ARM Ltd and ARM Germany GmbH. All rights reserved.
IDE-Version: ¦ÌVision V5.36.0.0
Copyright (C) 2021 ARM Ltd and ARM Germany GmbH. All rights reserved.
License Information: 1 1, 1, LIC=----
Tool Versions:
Toolchain: MDK-Lite Version: 5.37.0.0
Toolchain: MDK-Lite Version: 5.36.0.0
Toolchain Path: C:\Keil_v5\ARM\ARMCLANG\Bin
C Compiler: ArmClang.exe V6.18
Assembler: Armasm.exe V6.18
Linker/Locator: ArmLink.exe V6.18
Library Manager: ArmAr.exe V6.18
Hex Converter: FromElf.exe V6.18
CPU DLL: SARMCM3.DLL V5.37.0.0
Dialog DLL: DCM.DLL V1.17.5.0
C Compiler: ArmClang.exe V6.16
Assembler: Armasm.exe V6.16
Linker/Locator: ArmLink.exe V6.16
Library Manager: ArmAr.exe V6.16
Hex Converter: FromElf.exe V6.16
CPU DLL: SARMCM3.DLL V5.36.0.0
Dialog DLL: DCM.DLL V1.17.3.0
Target DLL: STLink\ST-LINKIII-KEIL_SWO.dll V3.0.9.0
Dialog DLL: TCM.DLL V1.56.1.0
Dialog DLL: TCM.DLL V1.53.0.0
<h2>Project:</h2>
C:\Users\wuwen\morse_code_trainer\f103c8t6_keil\MDK-ARM\f103c8t6_KEIL.uvprojx
Project File Date: 08/08/2022
C:\Users\kevin\Desktop\morse_code_trainer\f103c8t6_keil\MDK-ARM\f103c8t6_KEIL.uvprojx
Project File Date: 08/11/2022
<h2>Output:</h2>
*** Using Compiler 'V6.18', folder: 'C:\Keil_v5\ARM\ARMCLANG\Bin'
*** Using Compiler 'V6.16', folder: 'C:\Keil_v5\ARM\ARMCLANG\Bin'
Build target 'f103c8t6_KEIL'
MYDEIVERS/mymain.c(100): warning: passing 'const char *' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
OLED_Str_list(0,0,16,list,m->list_dis_top,4,1);
@@ -33,24 +33,27 @@ MYDEIVERS/mymain.c(100): warning: passing 'const char *' to parameter of type 'c
./MYDEIVERS/oled.h(33): note: passing argument to parameter 'str' here
void OLED_Str_list(unsigned char x,unsigned char y,unsigned char size,char *str,unsigned char lenstard,unsigned char lenconst,unsigned char type);
^
MYDEIVERS/mymain.c(102): warning: implicitly declaring library function 'sprintf' with type 'int (char *, const char *, ...)' [-Wimplicit-function-declaration]
MYDEIVERS/mymain.c(109): warning: implicitly declaring library function 'sprintf' with type 'int (char *, const char *, ...)' [-Wimplicit-function-declaration]
sprintf(temp,"%d/%d",m->sele,m->list_const);
^
MYDEIVERS/mymain.c(102): note: include the header <stdio.h> or explicitly provide a declaration for 'sprintf'
2 warnings generated.
MYDEIVERS/mymain.c(109): note: include the header <stdio.h> or explicitly provide a declaration for 'sprintf'
MYDEIVERS/mymain.c(259): warning: incompatible pointer types assigning to 'char *' from 'char (*)[32]' [-Wincompatible-pointer-types]
buzzer_setting.r_sw_list=&str;
^~~~~
3 warnings generated.
compiling mymain.c...
linking...
Program Size: Code=14748 RO-data=4012 RW-data=64 ZI-data=4200
Program Size: Code=15508 RO-data=4024 RW-data=64 ZI-data=4216
FromELF: creating hex file...
"f103c8t6_KEIL\f103c8t6_KEIL.axf" - 0 Error(s), 2 Warning(s).
"f103c8t6_KEIL\f103c8t6_KEIL.axf" - 0 Error(s), 3 Warning(s).
<h2>Software Packages used:</h2>
Package Vendor: ARM
http://www.keil.com/pack/ARM.CMSIS.5.9.0.pack
ARM.CMSIS.5.9.0
http://www.keil.com/pack/ARM.CMSIS.5.8.0.pack
ARM.CMSIS.5.8.0
CMSIS (Common Microcontroller Software Interface Standard)
* Component: CORE Version: 5.6.0
* Component: CORE Version: 5.5.0
Package Vendor: Keil
http://www.keil.com/pack/Keil.STM32F1xx_DFP.2.4.0.pack
@@ -58,14 +61,14 @@ Package Vendor: Keil
STMicroelectronics STM32F1 Series Device Support, Drivers and Examples
<h2>Collection of Component include folders:</h2>
./RTE/_f103c8t6_KEIL
C:/Users/wuwen/AppData/Local/Arm/Packs/ARM/CMSIS/5.9.0/CMSIS/Core/Include
C:/Users/wuwen/AppData/Local/Arm/Packs/Keil/STM32F1xx_DFP/2.4.0/Device/Include
.\RTE\_f103c8t6_KEIL
C:\Users\kevin\AppData\Local\Arm\Packs\ARM\CMSIS\5.8.0\CMSIS\Core\Include
C:\Users\kevin\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.4.0\Device\Include
<h2>Collection of Component Files used:</h2>
* Component: ARM::CMSIS:CORE:5.6.0
Include file: CMSIS/Core/Include/tz_context.h
* Component: ARM::CMSIS:CORE:5.5.0
Include file: CMSIS\Core\Include\tz_context.h
Build Time Elapsed: 00:00:01
</pre>
</body>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.