From 4f5d1ba26b3c09dd574f41b15d9578426b3b0ef2 Mon Sep 17 00:00:00 2001 From: pascallanger Date: Thu, 3 Mar 2016 16:26:17 +0100 Subject: [PATCH] Correct serial init --- Multiprotocol/Multiprotocol.ino | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Multiprotocol/Multiprotocol.ino b/Multiprotocol/Multiprotocol.ino index f7393da..5dc6e62 100644 --- a/Multiprotocol/Multiprotocol.ino +++ b/Multiprotocol/Multiprotocol.ino @@ -138,6 +138,9 @@ void setup() Servo_data[THROTTLE]=PPM_MIN_100; memcpy((void *)PPM_data,Servo_data, sizeof(Servo_data)); + //Wait for every component to start + delay(100); + // Read status of bind button if( (PINB & _BV(5)) == 0x00 ) BIND_BUTTON_FLAG_on; // If bind button pressed save the status for protocol id reset under hubsan @@ -594,12 +597,13 @@ static void Mprotocol_serial_init() #include UBRR0H = UBRRH_VALUE; UBRR0L = UBRRL_VALUE; + UCSR0A = 0 ; // Clear X2 bit //Set frame format to 8 data bits, even parity, 2 stop bits - UCSR0C |= (1<