Update to last Pascal mod.

This commit is contained in:
midelic 2016-09-01 14:13:24 +01:00 committed by GitHub
parent 9df79e400f
commit 2c3b64cde8

View File

@ -21,7 +21,7 @@
along with Multiprotocol. If not, see <http://www.gnu.org/licenses/>. along with Multiprotocol. If not, see <http://www.gnu.org/licenses/>.
*/ */
#define STM32_board #define STM32_board
#undef __cplusplus //#undef __cplusplus
#if defined STM32_board #if defined STM32_board
#include "Multiprotocol_STM32.h" #include "Multiprotocol_STM32.h"
#include <EEPROM.h> #include <EEPROM.h>
@ -1392,7 +1392,6 @@ void loop()
ISR(USARTC0_RXC_vect) ISR(USARTC0_RXC_vect)
#else #else
#if defined STM32_board #if defined STM32_board
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -1407,6 +1406,9 @@ void loop()
#ifdef XMEGA #ifdef XMEGA
if((USARTC0.STATUS & 0x1C)==0) // Check frame error, data overrun and parity error if((USARTC0.STATUS & 0x1C)==0) // Check frame error, data overrun and parity error
#else #else
#ifndef STM32_board
UCSR0B &= ~_BV(RXCIE0) ; // RX interrupt disable
#endif
sei(); sei();
#if defined STM32_board #if defined STM32_board
if(USART2_BASE->SR & USART_SR_RXNE) { if(USART2_BASE->SR & USART_SR_RXNE) {
@ -1461,7 +1463,6 @@ void loop()
rx_buff[(idx++)-1]=USART2_BASE->DR&0xff; // Store received byte rx_buff[(idx++)-1]=USART2_BASE->DR&0xff; // Store received byte
#else #else
rx_buff[(idx++)-1]=UDR0; // Store received byte rx_buff[(idx++)-1]=UDR0; // Store received byte
#endif #endif
#endif #endif
@ -1475,7 +1476,7 @@ void loop()
} }
else else
RX_MISSED_BUFF_on; // notify that rx_buff is good RX_MISSED_BUFF_on; // notify that rx_buff is good
idx=0; // start again discard_frame=1; // start again
} }
} }
} }
@ -1502,11 +1503,20 @@ void loop()
detachInterrupt(2);//disable interrupt on ch2 detachInterrupt(2);//disable interrupt on ch2
#else #else
TIMSK1 &=~(1<<OCIE1B); // disable interrupt on compare B match TIMSK1 &=~(1<<OCIE1B); // disable interrupt on compare B match
#endif #endif
#endif #endif
#ifndef STM32_board
#ifndef XMEGA
TX_RX_PAUSE_off;
tx_resume();
#endif
#endif
} }
#ifndef STM32_board)
cli() ;
UCSR0B |= _BV(RXCIE0) ; // RX interrupt enable
#endif
#if defined STM32_board //If activated telemetry it doesn't work activated #if defined STM32_board //If activated telemetry it doesn't work activated
} }
#endif #endif
@ -1539,6 +1549,9 @@ void loop()
TIMSK1 &=~(1<<OCIE1B); // Disable interrupt on compare B match TIMSK1 &=~(1<<OCIE1B); // Disable interrupt on compare B match
#endif #endif
#endif #endif
#ifndef STM32_board
tx_resume();
#endif
} }