X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fdrivers%2Fao_packet_master.c;h=a44b34cf0acdd84cd0905f745066dec630f6a08b;hb=refs%2Fheads%2Fmaster;hp=e67dd27fb1111bbb5898209a3080fc3ee52b8c47;hpb=c11427819ca24bb77523496309b5b6f699d126c5;p=fw%2Faltos diff --git a/src/drivers/ao_packet_master.c b/src/drivers/ao_packet_master.c index e67dd27f..688ab6db 100644 --- a/src/drivers/ao_packet_master.c +++ b/src/drivers/ao_packet_master.c @@ -45,14 +45,14 @@ ao_packet_echo(void) while (ao_packet_enable) { c = ao_packet_getchar(); if (c != AO_READ_AGAIN) - putchar(c); + putchar((char) c); } ao_exit(); } static struct ao_task ao_packet_echo_task; -static uint16_t ao_packet_master_delay; -static uint16_t ao_packet_master_time; +static AO_TICK_TYPE ao_packet_master_delay; +static AO_TICK_TYPE ao_packet_master_time; #define AO_PACKET_MASTER_DELAY_SHORT AO_MS_TO_TICKS(100) #define AO_PACKET_MASTER_DELAY_LONG AO_MS_TO_TICKS(1000) @@ -74,10 +74,10 @@ ao_packet_master_busy(void) static void ao_packet_master_check_busy(void) { - int16_t idle; + AO_TICK_SIGNED idle; if (ao_packet_master_delay != AO_PACKET_MASTER_DELAY_SHORT) return; - idle = (int16_t) (ao_time() - ao_packet_master_time); + idle = (AO_TICK_SIGNED) (ao_time() - ao_packet_master_time); if (idle > AO_PACKET_MASTER_DELAY_TIMEOUT) ao_packet_master_delay = AO_PACKET_MASTER_DELAY_LONG; @@ -87,13 +87,13 @@ static void ao_packet_master(void) { ao_config_get(); - ao_tx_packet.addr = ao_serial_number; + ao_tx_packet.addr = (uint8_t) 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) { uint8_t r; - ao_xmemcpy(ao_tx_packet.callsign, ao_config.callsign, AO_MAX_CALLSIGN); + memcpy(ao_tx_packet.callsign, ao_config.callsign, AO_MAX_CALLSIGN); ao_packet_send(); if (ao_tx_packet.len) ao_packet_master_busy();