@@ -1,5 +1,6 @@
/*
* Copyright (C) Kevin van Hecke
* 2015 Freek van Tienen <freek.v.tienen@gmail.com>
*
* This file is part of paparazzi
*
@@ -31,22 +32,14 @@

#include "mcu_periph/gpio.h"

void spektrum_soft_bind_init(void)
{

}

void received_spektrum_soft_bind(void)
{

//power cycle the spektrum
// Power cycle the radio's
RADIO_CONTROL_POWER_OFF(RADIO_CONTROL_POWER, RADIO_CONTROL_POWER_PIN);
sys_time_usleep(100000);
RADIO_CONTROL_POWER_ON(RADIO_CONTROL_POWER, RADIO_CONTROL_POWER_PIN);

//put to bind mode
RADIO_CONTROL_BIND_IMPL_FUNC(); //basically = radio_control_spektrum_try_bind()

SpektrumUartInit();

}
@@ -125,22 +125,6 @@ void intermcu_send_status(uint8_t mode)
&electrical.current);
}

void intermcu_blink_fbw_led(uint16_t dv)
{
#ifdef FBW_MODE_LED
static uint16_t idv = 0;
if (!autopilot_motors_on) {
if (!(dv % (PERIODIC_FREQUENCY))) {
if (!(idv++ % 3)) { LED_OFF(FBW_MODE_LED);} else {LED_TOGGLE(FBW_MODE_LED);}
}
} else {
LED_TOGGLE(FBW_MODE_LED); // toggle makes random blinks if intermcu comm problem!
}
#else
(void)dv;
#endif
}

#pragma GCC diagnostic ignored "-Wcast-align"
static void intermcu_parse_msg(void (*commands_frame_handler)(void))
{
@@ -34,7 +34,6 @@ extern pprz_t intermcu_commands[COMMANDS_NB];
void intermcu_on_rc_frame(uint8_t fbw_mode);
void intermcu_send_status(uint8_t mode);
void InterMcuEvent(void (*frame_handler)(void));
void intermcu_blink_fbw_led(uint16_t dv);


/* We need radio defines for the Autopilot */