1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-26 01:35:21 +03:00

Compilation fixes

This commit is contained in:
Bertrand Songis 2019-04-16 21:23:09 +02:00
parent e47603dcf7
commit 6676e98a92
6 changed files with 18 additions and 13 deletions

View file

@ -70,8 +70,6 @@ const uint8_t modn12x3[] = {
3, 1, 2, 0, 3, 1, 2, 0,
3, 2, 1, 0 }; 3, 2, 1, 0 };
volatile tmr10ms_t g_tmr10ms;
volatile uint8_t rtc_count = 0; volatile uint8_t rtc_count = 0;
uint32_t watchdogTimeout = 0; uint32_t watchdogTimeout = 0;

View file

@ -311,12 +311,6 @@ void memswap(void * a, void * b, uint8_t size);
#include "fifo.h" #include "fifo.h"
#include "io/frsky_sport.h" #include "io/frsky_sport.h"
extern volatile tmr10ms_t g_tmr10ms;
static inline tmr10ms_t get_tmr10ms()
{
return g_tmr10ms;
}
#if defined(CLI) #if defined(CLI)
#include "cli.h" #include "cli.h"
#endif #endif

View file

@ -290,10 +290,10 @@ class TelemetryData {
void setSwr(uint8_t module, uint8_t value) void setSwr(uint8_t module, uint8_t value)
{ {
if (module == EXTERNAL_MODULE) if (module == 0)
swrExternal.set(value);
else
swrInternal.set(value); swrInternal.set(value);
else
swrExternal.set(value);
} }
}; };

View file

@ -22,6 +22,7 @@
#define _TELEMETRY_HOLDERS_H_ #define _TELEMETRY_HOLDERS_H_
#include <inttypes.h> #include <inttypes.h>
#include "../timers.h"
#define TELEMETRY_AVERAGE_COUNT 3 // we actually average one more reading! #define TELEMETRY_AVERAGE_COUNT 3 // we actually average one more reading!
#define RAW_FRSKY_MINMAX(v) v.values[TELEMETRY_AVERAGE_COUNT-1] #define RAW_FRSKY_MINMAX(v) v.values[TELEMETRY_AVERAGE_COUNT-1]

View file

@ -21,6 +21,8 @@
#include "opentx.h" #include "opentx.h"
#include "timers.h" #include "timers.h"
volatile tmr10ms_t g_tmr10ms;
#if TIMERS > MAX_TIMERS #if TIMERS > MAX_TIMERS
#error "Timers cannot exceed " .. MAX_TIMERS #error "Timers cannot exceed " .. MAX_TIMERS
#endif #endif

View file

@ -21,6 +21,8 @@
#ifndef _TIMERS_H_ #ifndef _TIMERS_H_
#define _TIMERS_H_ #define _TIMERS_H_
#include "opentx_types.h"
#define TMR_OFF 0 #define TMR_OFF 0
#define TMR_RUNNING 1 #define TMR_RUNNING 1
#define TMR_NEGATIVE 2 #define TMR_NEGATIVE 2
@ -41,15 +43,23 @@ struct TimerState {
uint8_t val_10ms; uint8_t val_10ms;
}; };
#if defined(TIMERS)
extern TimerState timersStates[TIMERS]; extern TimerState timersStates[TIMERS];
#endif
void timerReset(uint8_t idx); void timerReset(uint8_t idx);
void timerSet(int idx, int val); void timerSet(int idx, int val);
void saveTimers(); void saveTimers();
void restoreTimers(); void restoreTimers();
void evalTimers(int16_t throttle, uint8_t tick10ms); void evalTimers(int16_t throttle, uint8_t tick10ms);
extern volatile tmr10ms_t g_tmr10ms;
static inline tmr10ms_t get_tmr10ms()
{
return g_tmr10ms;
}
#endif // _TIMERS_H_ #endif // _TIMERS_H_