From be40d76b2cd938b6a57b267fd0e75b0aacad4762 Mon Sep 17 00:00:00 2001 From: midelic Date: Wed, 31 Aug 2016 16:29:45 +0100 Subject: [PATCH] updates --- Multiprotocol/Multiprotocol.h | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index b419312..e0c6f49 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -271,11 +271,17 @@ struct PPM_Parameters #define IS_LED_on ( (PORTB & _BV(5)) != 0x00 ) #endif -// TX -#define TX_ON PORTD |= _BV(1) -#define TX_OFF PORTD &= ~_BV(1) -#define TX_TOGGLE PORTD ^= _BV(1) -#define TX_SET_OUTPUT DDRD |= _BV(1) +#ifdef DEBUG_TX + #define TX_ON PORTD |= _BV(1) + #define TX_OFF PORTD &= ~_BV(1) + #define TX_TOGGLE PORTD ^= _BV(1) + #define TX_SET_OUTPUT DDRD |= _BV(1) +#else + #define TX_ON + #define TX_OFF + #define TX_TOGGLE + #define TX_SET_OUTPUT +#endif // Macros #define NOP() __asm__ __volatile__("nop") @@ -328,6 +334,15 @@ struct PPM_Parameters #define RX_MISSED_BUFF_on protocol_flags2 |= _BV(2) #define IS_RX_MISSED_BUFF_on ( ( protocol_flags2 & _BV(2) ) !=0 ) +#define TX_MAIN_PAUSE_off protocol_flags2 &= ~_BV(3) +#define TX_MAIN_PAUSE_on protocol_flags2 |= _BV(3) +#define IS_TX_MAIN_PAUSE_on ( ( protocol_flags2 & _BV(3) ) !=0 ) + +#define TX_RX_PAUSE_off protocol_flags2 &= ~_BV(4) +#define TX_RX_PAUSE_on protocol_flags2 |= _BV(4) +#define IS_TX_RX_PAUSE_on ( ( protocol_flags2 & _BV(4) ) !=0 ) + +#define IS_TX_PAUSE_on ( ( protocol_flags2 & (_BV(4)|_BV(3)) ) !=0 ) #define BLINK_BIND_TIME 100 #define BLINK_SERIAL_TIME 500