Fixed Singularity target.
This commit is contained in:
parent
e95eee9a0d
commit
df9a0f186f
|
@ -100,7 +100,7 @@ static const uint32_t channelArray[RTC6705_BAND_MAX][RTC6705_CHANNEL_MAX] = {
|
||||||
* Send a command and return if good
|
* Send a command and return if good
|
||||||
* TODO chip detect
|
* TODO chip detect
|
||||||
*/
|
*/
|
||||||
static bool rtc6705IsReady()
|
static bool rtc6705IsReady(void)
|
||||||
{
|
{
|
||||||
// Sleep a little bit to make sure it has booted
|
// Sleep a little bit to make sure it has booted
|
||||||
delay(50);
|
delay(50);
|
||||||
|
@ -115,7 +115,8 @@ static bool rtc6705IsReady()
|
||||||
* This is easier for when generating the frequency to then
|
* This is easier for when generating the frequency to then
|
||||||
* reverse the bits afterwards
|
* reverse the bits afterwards
|
||||||
*/
|
*/
|
||||||
static uint32_t reverse32(uint32_t in) {
|
static uint32_t reverse32(uint32_t in)
|
||||||
|
{
|
||||||
uint32_t out = 0;
|
uint32_t out = 0;
|
||||||
|
|
||||||
for (uint8_t i = 0 ; i < 32 ; i++)
|
for (uint8_t i = 0 ; i < 32 ; i++)
|
||||||
|
@ -129,7 +130,7 @@ static uint32_t reverse32(uint32_t in) {
|
||||||
/**
|
/**
|
||||||
* Start chip if available
|
* Start chip if available
|
||||||
*/
|
*/
|
||||||
bool rtc6705Init()
|
bool rtc6705Init(void)
|
||||||
{
|
{
|
||||||
DISABLE_RTC6705;
|
DISABLE_RTC6705;
|
||||||
spiSetDivisor(RTC6705_SPI_INSTANCE, SPI_0_5625MHZ_CLOCK_DIVIDER);
|
spiSetDivisor(RTC6705_SPI_INSTANCE, SPI_0_5625MHZ_CLOCK_DIVIDER);
|
||||||
|
|
|
@ -33,6 +33,6 @@
|
||||||
#define RTC6705_FREQ_MIN 5600
|
#define RTC6705_FREQ_MIN 5600
|
||||||
#define RTC6705_FREQ_MAX 5950
|
#define RTC6705_FREQ_MAX 5950
|
||||||
|
|
||||||
bool rtc6705Init();
|
bool rtc6705Init(void);
|
||||||
void rtc6705SetChannel(uint8_t band, uint8_t channel);
|
void rtc6705SetChannel(uint8_t band, uint8_t channel);
|
||||||
void rtc6705SetFreq(uint16_t freq);
|
void rtc6705SetFreq(uint16_t freq);
|
|
@ -35,6 +35,8 @@
|
||||||
#include "drivers/timer.h"
|
#include "drivers/timer.h"
|
||||||
#include "drivers/pwm_rx.h"
|
#include "drivers/pwm_rx.h"
|
||||||
#include "drivers/serial.h"
|
#include "drivers/serial.h"
|
||||||
|
#include "drivers/vtx_rtc6705.h"
|
||||||
|
|
||||||
|
|
||||||
#include "sensors/sensors.h"
|
#include "sensors/sensors.h"
|
||||||
#include "sensors/gyro.h"
|
#include "sensors/gyro.h"
|
||||||
|
@ -72,7 +74,7 @@
|
||||||
|
|
||||||
static uint8_t locked = 0;
|
static uint8_t locked = 0;
|
||||||
|
|
||||||
void vtxInit()
|
void vtxInit(void)
|
||||||
{
|
{
|
||||||
rtc6705Init();
|
rtc6705Init();
|
||||||
if (masterConfig.vtx_mode == 0) {
|
if (masterConfig.vtx_mode == 0) {
|
||||||
|
@ -100,27 +102,27 @@ static void setChannelSaveAndNotify(uint8_t *bandOrChannel, uint8_t step, int32_
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void vtxIncrementBand()
|
void vtxIncrementBand(void)
|
||||||
{
|
{
|
||||||
setChannelSaveAndNotify(&(masterConfig.vtx_band), 1, RTC6705_BAND_MIN, RTC6705_BAND_MAX);
|
setChannelSaveAndNotify(&(masterConfig.vtx_band), 1, RTC6705_BAND_MIN, RTC6705_BAND_MAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
void vtxDecrementBand()
|
void vtxDecrementBand(void)
|
||||||
{
|
{
|
||||||
setChannelSaveAndNotify(&(masterConfig.vtx_band), -1, RTC6705_BAND_MIN, RTC6705_BAND_MAX);
|
setChannelSaveAndNotify(&(masterConfig.vtx_band), -1, RTC6705_BAND_MIN, RTC6705_BAND_MAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
void vtxIncrementChannel()
|
void vtxIncrementChannel(void)
|
||||||
{
|
{
|
||||||
setChannelSaveAndNotify(&(masterConfig.vtx_channel), 1, RTC6705_CHANNEL_MIN, RTC6705_CHANNEL_MAX);
|
setChannelSaveAndNotify(&(masterConfig.vtx_channel), 1, RTC6705_CHANNEL_MIN, RTC6705_CHANNEL_MAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
void vtxDecrementChannel()
|
void vtxDecrementChannel(void)
|
||||||
{
|
{
|
||||||
setChannelSaveAndNotify(&(masterConfig.vtx_channel), -1, RTC6705_CHANNEL_MIN, RTC6705_CHANNEL_MAX);
|
setChannelSaveAndNotify(&(masterConfig.vtx_channel), -1, RTC6705_CHANNEL_MIN, RTC6705_CHANNEL_MAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
void vtxUpdateActivatedChannel()
|
void vtxUpdateActivatedChannel(void)
|
||||||
{
|
{
|
||||||
if (ARMING_FLAG(ARMED)) {
|
if (ARMING_FLAG(ARMED)) {
|
||||||
locked = 1;
|
locked = 1;
|
||||||
|
@ -144,3 +146,4 @@ void vtxUpdateActivatedChannel()
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -17,8 +17,6 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "drivers/vtx_rtc6705.h"
|
|
||||||
|
|
||||||
#define VTX_BAND_MIN 1
|
#define VTX_BAND_MIN 1
|
||||||
#define VTX_BAND_MAX 5
|
#define VTX_BAND_MAX 5
|
||||||
#define VTX_CHANNEL_MIN 1
|
#define VTX_CHANNEL_MIN 1
|
||||||
|
@ -32,9 +30,10 @@ typedef struct vtxChannelActivationCondition_s {
|
||||||
channelRange_t range;
|
channelRange_t range;
|
||||||
} vtxChannelActivationCondition_t;
|
} vtxChannelActivationCondition_t;
|
||||||
|
|
||||||
void vtxInit();
|
void vtxInit(void);
|
||||||
void vtxIncrementBand();
|
void vtxIncrementBand(void);
|
||||||
void vtxDecrementBand();
|
void vtxDecrementBand(void);
|
||||||
void vtxIncrementChannel();
|
void vtxIncrementChannel(void);
|
||||||
void vtxDecrementChannel();
|
void vtxDecrementChannel(void);
|
||||||
void vtxUpdateActivatedChannel();
|
void vtxUpdateActivatedChannel(void);
|
||||||
|
|
||||||
|
|
|
@ -7,5 +7,6 @@ TARGET_SRC = \
|
||||||
drivers/light_ws2811strip.c \
|
drivers/light_ws2811strip.c \
|
||||||
drivers/light_ws2811strip_stm32f30x.c \
|
drivers/light_ws2811strip_stm32f30x.c \
|
||||||
drivers/serial_softserial.c \
|
drivers/serial_softserial.c \
|
||||||
drivers/vtx_rtc6705.c
|
drivers/vtx_rtc6705.c \
|
||||||
|
io/vtx.c
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue