1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-25 01:05:21 +03:00
inav/src/main/telemetry/telemetry.c
Dominic Clifton 1e098bf199 Delete MSP telemetry. Saves ~350 bytes of code space on F1 targets and
reduces ram usage. MSP telemetry was not used by many people.  MSP is
not considered a good telemetry protocol - it is bandwidth heavy when
compared to LTM, Mavlink, etc.  Closes #1106.
2015-12-14 20:08:22 +01:00

87 lines
2.2 KiB
C

/*
* This file is part of Cleanflight.
*
* Cleanflight is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Cleanflight is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include "platform.h"
#ifdef TELEMETRY
#include "drivers/gpio.h"
#include "drivers/timer.h"
#include "drivers/serial.h"
#include "drivers/serial_softserial.h"
#include "io/serial.h"
#include "rx/rx.h"
#include "io/rc_controls.h"
#include "config/runtime_config.h"
#include "config/config.h"
#include "telemetry/telemetry.h"
#include "telemetry/frsky.h"
#include "telemetry/hott.h"
#include "telemetry/smartport.h"
static telemetryConfig_t *telemetryConfig;
void telemetryUseConfig(telemetryConfig_t *telemetryConfigToUse)
{
telemetryConfig = telemetryConfigToUse;
}
void telemetryInit(void)
{
initFrSkyTelemetry(telemetryConfig);
initHoTTTelemetry(telemetryConfig);
initSmartPortTelemetry(telemetryConfig);
telemetryCheckState();
}
bool telemetryDetermineEnabledState(portSharing_e portSharing)
{
bool enabled = portSharing == PORTSHARING_NOT_SHARED;
if (portSharing == PORTSHARING_SHARED) {
if (telemetryConfig->telemetry_switch)
enabled = IS_RC_MODE_ACTIVE(BOXTELEMETRY);
else
enabled = ARMING_FLAG(ARMED);
}
return enabled;
}
void telemetryCheckState(void)
{
checkFrSkyTelemetryState();
checkHoTTTelemetryState();
checkSmartPortTelemetryState();
}
void telemetryProcess(rxConfig_t *rxConfig, uint16_t deadband3d_throttle)
{
handleFrSkyTelemetry(rxConfig, deadband3d_throttle);
handleHoTTTelemetry();
handleSmartPortTelemetry();
}
#endif