Hello,
I found the issue :-).
The problem is that you are using instead of the D4D_CHAR[] variable, complete internal D4D_STRING type, what is not targeted as a input parameter.
This is example of runtime changing, for preprocessor version change the D4D_BTN_FNT_PRTY_DEFAULT to your options in user config.
Just rewrite the code into this version:
D4D_CHAR str_cms[5] = {0};
D4D_DECLARE_TXT_RBUTTON(scrRadio_btnstation, str_cms,50, 50, 0, 0, 12, FONT_ARIALNARROW; NULL)
uint8_t StaBRadiobtnflag ;
static void ScreenRadio_OnInit()
{
D4D_SetFontProperties( &scrRadio_btnstation, D4D_FNT_PRTY_TRANSPARENT_NO_MASK);
D4D_SetTextProperties( &scrRadio_btnstation, D4D_TXT_PRTY_ALIGN_H_RIGHT_MASK);
}
static void ScrRadio_OnClickBtnback(D4D_OBJECT* pThis)
{
StaBRadiobtnflag = 1;
}
static void ScreenMain_OnMain()
{
if (StaBRadiobtnflag == 1)
{
StaBRadiobtnflag = 0;
RadioStation = radio_get_frequency();// get radio Frecuency
// there is two option how to do this
#if 0
u16toascii(RadioStation, &str_cms[0]); // convert to ascii
// Just invalidate object because you are already change the text in memory
D4D_InvalidateObject(&scrRadio_btnstation, D4D_FALSE);
#else
{
// prepare the text in temporary array and then call SetTxt function what itself copy the new string into object char array
D4D_CHAR tmp_char[5];
u16toascii(RadioStation, &tmp_char[0]); // convert to ascii
D4D_SetText(&scrRadio_btnstation,&tmp_char[0]); //display data
}
#endif
}
}
Petr