From: Mikko Rasa Date: Thu, 7 Nov 2013 23:34:04 +0000 (+0200) Subject: Add a delay after MFX packets X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=188391bc43da8330aa4f9642bb1a23ef180d66e2;p=model-railway-devices.git Add a delay after MFX packets --- diff --git a/arducontrol/mfx.c b/arducontrol/mfx.c index 95de445..6e843aa 100644 --- a/arducontrol/mfx.c +++ b/arducontrol/mfx.c @@ -22,7 +22,7 @@ static OutputPacket *mfx_create_packet(MfxEncodingState *state) OutputPacket *packet = output_create_packet(); packet->bit_duration = 4; packet->repeat_count = 1; - packet->final_delay = 0; + packet->final_delay = 128; packet->length = 10; packet->data[0] = 0x9B; packet->data[1] = 0; @@ -212,6 +212,7 @@ static void mfx_finish_packet_feedback(OutputPacket *packet, MfxEncodingState *s mfx_encode_bits8_raw(packet, state, state->crc8, 8); mfx_encode_flag_pairs(packet, 11); mfx_encode_bits8_raw(packet, state, 0x3, 4); + packet->final_delay = 0; uint8_t fill = (1-mfx_get_output_level(packet))*0xFF; for(uint8_t i=0; i<2; ++i) @@ -231,6 +232,7 @@ static void mfx_finish_packet_feedback(OutputPacket *packet, MfxEncodingState *s } mfx_ensure_low_level(packet); + packet->final_delay = 128; } static void mfx_receive_feedback()