static void phy_start_tx(void) { // Schalte UP4DAR auf Senden um send_cmd(tx_on, 1); // Bereite einen Header vor header[0] = 0x20; header[1] = (SETTING_CHAR(C_DV_DIRECT) == 1) ? 0 : // "1st control byte" (1 << 6) // Setze den Repeater-Flag ; char* urcall = getURCALL(); header[2] = 0x0; // "2nd control byte" header[3] = 0x0; // "3rd control byte" for (short i=0; i<CALLSIGN_LENGTH; ++i){ if (SETTING_CHAR(C_DV_DIRECT) == 1) { header[4+i] = direct_callsign[i]; } else { header[4+i] = settings.s.rpt2[ ((SETTING_CHAR(C_DV_USE_RPTR_SETTING) - 1)*CALLSIGN_LENGTH) + i]; } } for (short i=0; i<CALLSIGN_LENGTH; ++i){ if (SETTING_CHAR(C_DV_DIRECT) == 1) { header[12+i] = direct_callsign[i]; } else { header[12+i] = settings.s.rpt1[ ((SETTING_CHAR(C_DV_USE_RPTR_SETTING) - 1)*CALLSIGN_LENGTH) + i]; } } for (short i=0; i<CALLSIGN_LENGTH; ++i){ header[20+i] = urcall[i]; } for (short i=0; i<CALLSIGN_LENGTH; ++i){ header[28+i] = settings.s.my_callsign[i]; } for (short i=0; i<CALLSIGN_EXT_LENGTH; ++i){ header[36+i] = settings.s.my_ext[i]; } // Bis zu 70ms kann man sich Zeit lassen, bevor die Header-Daten uebergeben werden. // Die genaue Wartezeit ist natruerlich von TX-DELAY abhaengig. //usleep(70000); // vTaskDelay (50); // 50ms send_cmd(header, 40); // phy_frame_counter = 0; txmsg_counter = 0; }
void tx_info_on(void) { if ((!tx_info) && (!r2cs_flag) && (current_app->screen_num == VDISP_MAIN_LAYER)) { char str[22]; lcd_show_menu_layer(help_layer); help_layer_timer = 0; // display permanent vd_clear_rect(help_layer, 0, 12, 146, 43); for (int i = 8; i < 66; i++) { vd_set_pixel(help_layer, i, 19, 0, 1, 1); vd_set_pixel(help_layer, i, 30, 0, 1, 1); vd_set_pixel(help_layer, i + 1, 31, 0, 1, 1); } for (int i = 19; i < 30; i++) { vd_set_pixel(help_layer, 8, i, 0, 1, 1); vd_set_pixel(help_layer, 65, i, 0, 1, 1); vd_set_pixel(help_layer, 66, i + 1, 0, 1, 1); } for (int i = 8; i < 112; i++) { vd_set_pixel(help_layer, i, 37, 0, 1, 1); vd_set_pixel(help_layer, i, 48, 0, 1, 1); vd_set_pixel(help_layer, i + 1, 49, 0, 1, 1); } for (int i = 37; i < 49; i++) { vd_set_pixel(help_layer, 8, i, 0, 1, 1); vd_set_pixel(help_layer, 112, i, 0, 1, 1); vd_set_pixel(help_layer, 113, i + 1, 0, 1, 1); } memset(str, '\0', 22); memcpy(str, getURCALL(), CALLSIGN_LENGTH); vd_prints_xy(help_layer, 10, 21, VDISP_FONT_5x8, 0, "ur"); vd_prints_xy(help_layer, 20, 21, VDISP_FONT_5x8, 0, str); vd_prints_xy(help_layer, 70, 18, VDISP_FONT_4x6, 0, "R1"); vd_prints_xy(help_layer, 70, 26, VDISP_FONT_4x6, 0, "R2"); if (SETTING_CHAR(C_DV_DIRECT) != 1) { memset(str, '\0', 22); memcpy(str, settings.s.rpt1 + ((SETTING_CHAR(C_DV_USE_RPTR_SETTING) - 1)*CALLSIGN_LENGTH), CALLSIGN_LENGTH); vd_prints_xy(help_layer, 80, 18, VDISP_FONT_4x6, 0, str); memset(str, '\0', 22); memcpy(str, settings.s.rpt2 + ((SETTING_CHAR(C_DV_USE_RPTR_SETTING) - 1)*CALLSIGN_LENGTH), CALLSIGN_LENGTH); vd_prints_xy(help_layer, 80, 26, VDISP_FONT_4x6, 0, str); } else { vd_prints_xy(help_layer, 80, 18, VDISP_FONT_4x6, 0, "DIRECT "); vd_prints_xy(help_layer, 80, 26, VDISP_FONT_4x6, 0, "DIRECT "); } memset(str, '\0', 22); memcpy(str, settings.s.txmsg, TXMSG_LENGTH); vd_prints_xy(help_layer, 10, 40, VDISP_FONT_5x8, 0, str); tx_info = true; } }