mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-07-01 10:17:53 +00:00
Core: stop transmitting if serial or ppm signal disappears
This commit is contained in:
parent
54dd562d88
commit
8f0ecac842
@ -11,7 +11,7 @@
|
||||
#include <avr/interrupt.h>
|
||||
|
||||
static void protocol_init(void) ;
|
||||
static void update_aux_flags(void) ;
|
||||
static void update_channels_aux(void) ;
|
||||
static uint32_t random_id(uint16_t adress, uint8_t create_new) ;
|
||||
static void update_serial_data(void) ;
|
||||
static void Mprotocol_serial_init(void) ;
|
||||
|
@ -411,7 +411,10 @@ void loop()
|
||||
{
|
||||
TX_MAIN_PAUSE_on;
|
||||
tx_pause();
|
||||
next_callback=remote_callback();
|
||||
if(IS_INPUT_SIGNAL_on)
|
||||
next_callback=remote_callback();
|
||||
else
|
||||
next_callback=2000; // No PPM/serial signal check again in 2ms...
|
||||
TX_MAIN_PAUSE_off;
|
||||
tx_resume();
|
||||
while(next_callback>4000)
|
||||
@ -520,8 +523,8 @@ static void update_channels_aux(void)
|
||||
static void update_led_status(void)
|
||||
{
|
||||
if(IS_INPUT_SIGNAL_on)
|
||||
if(millis()-last_signal>50)
|
||||
INPUT_SIGNAL_off; //no valid signal (PPM or Serial) received for 50ms
|
||||
if(millis()-last_signal>70)
|
||||
INPUT_SIGNAL_off; //no valid signal (PPM or Serial) received for 70ms
|
||||
if(blink<millis())
|
||||
{
|
||||
if(IS_INPUT_SIGNAL_off)
|
||||
|
@ -42,7 +42,7 @@ uint8_t frame[18];
|
||||
|
||||
#ifdef BASH_SERIAL
|
||||
// For bit-bashed serial output
|
||||
struct t_serial_bash
|
||||
volatile struct t_serial_bash
|
||||
{
|
||||
uint8_t head ;
|
||||
uint8_t tail ;
|
||||
|
Loading…
x
Reference in New Issue
Block a user