static const char *binding_string_cb(guiObject_t *obj, void *data) { (void)data; u32 crc = Crc(tempstring, strlen(tempstring)); if (obj && crc == dialogcrc) return tempstring; u32 bind_time = PROTOCOL_Binding(); tempstring_cpy(_tr("Binding is in progress...\nMake sure model is on!\n\nPressing OK will NOT cancel binding procedure\nbut will allow full control of Tx.")); u32 len = strlen(tempstring); if (bind_time != 0xFFFFFFFF && len < sizeof(tempstring)) { snprintf(tempstring + len, sizeof(tempstring) - len, _tr("\n\nBinding will end in %d seconds..."), (int)bind_time / 1000); } return tempstring; }
static const char *binding_string_cb(guiObject_t *obj, void *data) { (void)data; u32 crc = Crc(tempstring, strlen(tempstring)); if (obj && crc == dialogcrc) return tempstring; u32 bind_time = PROTOCOL_Binding(); char tmp[10]; snprintf(tmp, 10, "%s", Model.name); snprintf(tempstring, sizeof(tempstring), _tr("Binding %s...\nPress ENT to stop"), tmp); if (bind_time != 0xFFFFFFFF ) { int len = strlen(tempstring); snprintf(tempstring + len, sizeof(tempstring) - len, _tr("\n%d seconds left"), (int)bind_time / 1000); } return tempstring; }
void PROTOCOL_CheckDialogs() { if (proto_state & PROTO_MODULEDLG) { if(! PAGE_DialogVisible()) { //Dialog was dismissed, proceed proto_state &= ~PROTO_MODULEDLG; PROTOCOL_Init(0); } return; } if (PROTOCOL_WaitingForSafe()) { PAGE_ShowSafetyDialog(); } else { if (PROTOCOL_Binding()) { PAGE_ShowBindingDialog(proto_state & PROTO_BINDDLG); proto_state |= PROTO_BINDDLG; } else if (proto_state & PROTO_BINDDLG) { PAGE_CloseBindingDialog(); MUSIC_Play(MUSIC_DONE_BINDING); proto_state &= ~PROTO_BINDDLG; } } }