|
u8 Test_Communication_DSP(void)
{
u8 failedMessage = 0;
u16 cntTr0_ = 0;
static __flash u8 ftxt_tUART0_perc[] = "%#5.2f";
u8 txt_tUART0_perc[8];
u8 String_float[20];
strcpy_P(txt_tUART0_perc,ftxt_tUART0_perc);
Draw_Menu(pTxt_MenuUART0);
Delay_ms(DelayMenu_norm);
cntTr0_= cntTr0;
TC1_100ms[0] = 10*TimeWaitMenu;
setBit(TC1_WE_100ms,0);
while ( conditionMenuWork )
{
if ( cntTr0_ != cntTr0)
{
cntTr0_ = cntTr0;
if ( Rx0_error & 0x07 ) failedMessage++;
else failedMessage = 0;
}
if ( failedMessage > 16 )
{
failedMessage = 17;
GLCD_Locate(0,1);
GLCD_Printf(Txt_tUART0_1_no,&Font_System5x8);
GLCD_ClearLine(7);
GLCD_Locate(0,7);
if ( tstBit(Rx0_error,2) ) GLCD_Printf(Txt_tUART0_7_2,&Font_System5x8);
else
if ( tstBit(Rx0_error,1) ) GLCD_Printf(Txt_tUART0_7_1,&Font_System5x8);
else GLCD_Printf(Txt_tUART0_7_0,&Font_System5x8);
}
else
{
GLCD_Locate(0,1);
GLCD_Printf(Txt_tUART0_1_yes,&Font_System5x8);
GLCD_ClearLine(7);
}
GLCD_Locate(0,3);
GLCD_Printf(Txt_tUART0_3,&Font_System5x8);
GLCD_DisplayValue_u32_withSpace(cntTr0, 5, 0);
GLCD_Locate(0,5);
GLCD_Printf(Txt_tUART0_3,&Font_System5x8);
GLCD_DisplayValue_u32_withSpace(cntRe0, 5, 0);
GLCD_Locate(0,6);
GLCD_Printf(Txt_tUART0_6,&Font_System5x8);
sprintf(String_float,txt_tUART0_perc,100.0*cntRe0/cntTr0); // ругается здесь
//sprintf_P(String_float,ftxt_tUART0_perc,100.0*cntRe0/cntTr0);
GLCD_Printf(String_float,&Font_System5x8);
if ( tstBit(kbr_E,kbr_Copy) || (cntTr0 == 65535) )
{
__disable_interrupt();
cntTr0 = 0;
cntRe0 = 0;
cntTr0_= 0;
__enable_interrupt();
}
if ( tstBit(kbr_E,kbr_Copy) )
{
__disable_interrupt();
Rx0_error = 0;
failedMessage = 0;
__enable_interrupt();
}
Delay_ms(100);
}
Delay_ms(DelayMenu_norm);
if ( tstBit(SCW_0,0) ) return 1;
else return 0;
}
E-mail: info@telesys.ru