Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
BrushlessPower authored Mar 12, 2019
1 parent 7505318 commit e11a3e4
Showing 1 changed file with 12 additions and 19 deletions.
31 changes: 12 additions & 19 deletions Futaba_Telemetry/SBUS_usart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,16 +242,12 @@ ISR (USART_RX_vect)
frame_ready = false;
TCNT2 = 0; //Reset Timer 2 for new usart time of char
//enable Timer2 Control Reg B: for receive timeout this is done here because we can only start the timeout after first bye is received
if(F_CPU == 16000000UL){
TCCR2B = 0x04; // 16MHz clock
}
else if(F_CPU == 8000000UL){
TCCR2B = 0x03; // 8MHz Clock
}
else{
TCCR2B = 0x00; // Disable Timer
}


#if F_CPU == 16000000L
TCCR2B = 0x04; // 16MHz clock
#elif F_CPU == 8000000L
TCCR2B = 0x03; // 8MHz clock
#endif

cdata = UDR0;
rxbuf[buffer_index] = cdata;
Expand Down Expand Up @@ -342,15 +338,12 @@ void start_transmit_sequencer(uint8_t frame_number)
timer_ISR = (volatile void (*)())ISR_transmit;

OCR2A = transmit_sequence_timer[0]; //set first delay value
if(F_CPU == 16000000UL){
TCCR2B = 0x04; // 16MHz clock
}
else if(F_CPU == 8000000UL){
TCCR2B = 0x03; // 8MHz Clock
}
else{
TCCR2B = 0x00; // Disable Timer
}

#if F_CPU == 16000000L
TCCR2B = 0x04; // 16MHz clock
#elif F_CPU == 8000000L
TCCR2B = 0x03; // 8MHz clock
#endif

gl_current_frame = frame_number;
}
Expand Down

0 comments on commit e11a3e4

Please sign in to comment.