]> git.tdb.fi Git - model-railway-devices.git/commitdiff
Add a delay after MFX packets
authorMikko Rasa <tdb@tdb.fi>
Thu, 7 Nov 2013 23:34:04 +0000 (01:34 +0200)
committerMikko Rasa <tdb@tdb.fi>
Thu, 7 Nov 2013 23:34:04 +0000 (01:34 +0200)
arducontrol/mfx.c

index 95de44523110d0e1a83805cb4ee6f91b83ce85a9..6e843aa288baae240120ccfb0d527bfe278e148d 100644 (file)
@@ -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()