X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=src%2Fao_packet_master.c;h=5e13a91adecb3889727688e172e0f9a957458fb3;hp=f3a024caa78433696b156e03bfb1239638c3dbbc;hb=c4a8569f61eddf690d00337543462235ecbfbe54;hpb=036400a2db303f3db3be7cc0426f88359c6bd2b1 diff --git a/src/ao_packet_master.c b/src/ao_packet_master.c index f3a024ca..5e13a91a 100644 --- a/src/ao_packet_master.c +++ b/src/ao_packet_master.c @@ -18,7 +18,7 @@ #include "ao.h" static char -ao_packet_getchar(void) +ao_packet_getchar(void) __critical { char c; while ((c = ao_packet_pollchar()) == AO_READ_AGAIN) @@ -77,12 +77,14 @@ ao_packet_master(void) { uint8_t status; + ao_config_get(); ao_radio_set_packet(); ao_tx_packet.addr = ao_serial_number; ao_tx_packet.len = AO_PACKET_SYN; ao_packet_master_time = ao_time(); ao_packet_master_delay = AO_PACKET_MASTER_DELAY_SHORT; while (ao_packet_enable) { + memcpy(ao_tx_packet.callsign, ao_config.callsign, AO_MAX_CALLSIGN); ao_packet_send(); if (ao_tx_packet.len) ao_packet_master_busy(); @@ -100,6 +102,7 @@ ao_packet_master(void) ao_packet_master_sleeping = 0; } } + ao_radio_set_telemetry(); ao_exit(); } @@ -118,6 +121,10 @@ ao_packet_forward(void) __reentrant if (c == '\r') c = '\n'; ao_packet_putchar(c); } + + /* Wait for a second if there is any pending data */ + for (c = 0; (ao_packet_tx_used || ao_tx_packet.len) && c < 10; c++) + ao_delay(AO_MS_TO_TICKS(100)); ao_packet_enable = 0; ao_radio_abort(); while (ao_packet_echo_task.wchan || ao_packet_task.wchan) {