Backup before extended trims function merge
This commit is contained in:
+62
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* frsky.cpp original authors - Bryan J.Rentoul (Gruvin) <gruvin@gmail.com> and Philip Moss Adapted from jeti.cpp code by Karl
|
||||
* Szmutny <shadow@privy.de>*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef FRSKY_H
|
||||
#define FRSKY_H
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
// .20 seconds
|
||||
#define FRSKY_TIMEOUT10ms 20
|
||||
|
||||
enum AlarmLevel {
|
||||
alarm_off = 0,
|
||||
alarm_yellow = 1,
|
||||
alarm_orange = 2,
|
||||
alarm_red = 3
|
||||
};
|
||||
|
||||
#define ALARM_GREATER(channel, alarm) ((g_model.frsky.channels[channel].alarms_greater >> alarm) & 1)
|
||||
#define ALARM_LEVEL(channel, alarm) ((g_model.frsky.channels[channel].alarms_level >> (2*alarm)) & 3)
|
||||
|
||||
struct FrskyData {
|
||||
uint8_t value;
|
||||
uint8_t min;
|
||||
uint8_t max;
|
||||
void set(uint8_t value);
|
||||
};
|
||||
|
||||
// Global Fr-Sky telemetry data variables
|
||||
extern uint8_t frskyStreaming; // >0 (true) == data is streaming in. 0 = nodata detected for some time
|
||||
extern uint8_t FrskyAlarmSendState;
|
||||
extern FrskyData frskyTelemetry[2];
|
||||
extern FrskyData frskyRSSI[2];
|
||||
|
||||
void FRSKY_Init(void);
|
||||
void FRSKY10mspoll(void);
|
||||
|
||||
inline void FRSKY_setModelAlarms(void)
|
||||
{
|
||||
FrskyAlarmSendState = 4 ;
|
||||
}
|
||||
|
||||
bool FRSKY_alarmRaised(uint8_t idx);
|
||||
|
||||
void resetTelemetry();
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user