修正一些bug

Signed-off-by: kevin <kevin@lmve.net>
This commit is contained in:
2022-03-12 01:44:25 +08:00
parent 983a3c51fc
commit 6523c0a0c4
5 changed files with 6471 additions and 6630 deletions
+15 -14
View File
@@ -19,7 +19,9 @@ char push_key=0,last_key=1;
uint32_t morse_t=0;
uint32_t morse_time_out=0;
uint16_t morse_temp;
char morse_input_buff[65];
#define morse_input_buff_num 128
char morse_input_buff[morse_input_buff_num+1];
int morse_input_flag=0;
int morse_char_flag=0;
int morse_x,morse_y;
@@ -240,7 +242,7 @@ void APP_morsecode_loop()
morse_x=morsecode_window->x;
morse_y=morsecode_window->y+16;
for(int a=0;a<64;a++)
for(int a=0;a<morse_input_buff_num;a++)
{
morse_input_buff[a]='\0';
if(morse_x>=(morsecode_window->x+morsecode_window->width))
@@ -282,18 +284,15 @@ void APP_morsecode_loop()
//-
morse_input_buff[morse_input_flag]='-';
morse_letter_temp|=(0x80>>morse_letter_flag);
morse_input_flag++;
morse_letter_flag++;
if(morse_input_flag>=morse_char_flag+8){morse_input_flag=morse_char_flag;morse_letter_flag=0;}
}else
{
//.
morse_input_buff[morse_input_flag]='.';
morse_input_flag++;
morse_letter_flag++;
if(morse_input_flag>=morse_char_flag+8){morse_input_flag=morse_char_flag;morse_letter_flag=0;}
}
}
morse_input_flag++;
morse_letter_flag++;
//if(morse_input_flag>=morse_char_flag+8){morse_input_flag=morse_char_flag;morse_letter_flag=0;}
play_ones(0,0);
}
@@ -372,6 +371,7 @@ void APP_morsecode_loop()
if(morse_flah==1)
{
morse_input_buff[morse_char_flag]=' ';
/*
morse_x=morsecode_window->x;
morse_y=morsecode_window->y+16;
for(int a=0;a<morse_char_flag;a++)
@@ -389,6 +389,7 @@ void APP_morsecode_loop()
morse_x+=8;
}
LCD_ShowChar(morse_x,morse_y,morse_input_buff[morse_char_flag],16,CYAN,RED);
*/
morse_char_flag+=1;
morse_input_flag=morse_char_flag;
morse_flah=0;
@@ -399,7 +400,7 @@ void APP_morsecode_loop()
morse_x=morsecode_window->x;
morse_y=morsecode_window->y+16;
for(int a=0;a<64;a++)
for(int a=0;a<morse_input_buff_num;a++)
{
if(morse_input_buff[a]=='\0')
@@ -411,10 +412,10 @@ void APP_morsecode_loop()
{
morse_x=morsecode_window->x;
morse_y+=16;
if(morse_y>=(morsecode_window->y+morsecode_window->high))
{
morse_y=morsecode_window->y+16;
}
//if(morse_y>=(morsecode_window->y+morsecode_window->high))
//{
//morse_y=morsecode_window->y+16;
//}
}
LCD_ShowChar(morse_x,morse_y,morse_input_buff[a],16,CYAN,RED);