Fixes for X7
This commit is contained in:
@@ -79,7 +79,9 @@ enum MenuRadioIndexes
|
||||
MENU_RADIO_SWITCHES_TEST,
|
||||
MENU_RADIO_ANALOGS_TEST,
|
||||
MENU_RADIO_HARDWARE,
|
||||
#if defined(RADIO_SPECTRUM)
|
||||
MENU_RADIO_SPECTRUM,
|
||||
#endif
|
||||
MENU_RADIO_CALIBRATION,
|
||||
MENU_RADIO_PAGES_COUNT
|
||||
};
|
||||
@@ -104,7 +106,9 @@ static const MenuHandlerFunc menuTabGeneral[] = {
|
||||
menuRadioDiagKeys,
|
||||
menuRadioDiagAnalogs,
|
||||
menuRadioHardware,
|
||||
#if defined(RADIO_SPECTRUM)
|
||||
menuRadioSpectrum,
|
||||
#endif
|
||||
menuRadioCalibration
|
||||
};
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
void menuRadioSpectrum(event_t event)
|
||||
{
|
||||
MENU("SPECTRUM ANALYSER", menuTabGeneral, MENU_RADIO_SPECTRUM, HEADER_LINE, { HEADER_LINE_COLUMNS });
|
||||
SIMPLE_MENU("SPECTRUM ANALYSER", menuTabGeneral, MENU_RADIO_SPECTRUM, 1);
|
||||
|
||||
if (menuEvent) {
|
||||
moduleSettings[INTERNAL_MODULE].mode = MODULE_MODE_NORMAL;
|
||||
|
||||
@@ -46,3 +46,24 @@ uint8_t createCrossfireChannelsFrame(uint8_t * frame, int16_t * pulses)
|
||||
*buf++ = crc8(crc_start, 23);
|
||||
return buf - frame;
|
||||
}
|
||||
|
||||
void setupPulsesCrossfire(uint8_t module)
|
||||
{
|
||||
if (telemetryProtocol == PROTOCOL_TELEMETRY_CROSSFIRE) {
|
||||
uint8_t * crossfire = modulePulsesData[module].crossfire.pulses;
|
||||
uint8_t len;
|
||||
#if defined(LUA)
|
||||
if (outputTelemetryBufferTrigger != 0x00 && outputTelemetryBufferSize > 0) {
|
||||
memcpy(crossfire, outputTelemetryBuffer, outputTelemetryBufferSize);
|
||||
len = outputTelemetryBufferSize;
|
||||
outputTelemetryBufferTrigger = 0x00;
|
||||
outputTelemetryBufferSize = 0;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
len = createCrossfireChannelsFrame(crossfire, &channelOutputs[g_model.moduleData[module].channelsStart]);
|
||||
}
|
||||
sportSendBuffer(crossfire, len);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ void setupPulsesPXX2(uint8_t module)
|
||||
{
|
||||
if (module == INTERNAL_MODULE) {
|
||||
if (modulePulsesData[module].pxx2.setupFrame(module)) {
|
||||
intmoduleSendNextFrame();
|
||||
intmoduleSendNextPXX2Frame();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ void enablePulses(uint8_t port, uint8_t protocol)
|
||||
}
|
||||
}
|
||||
|
||||
void sendPulses(uint8_t port, uint8_t protocol)
|
||||
void setupPulses(uint8_t port, uint8_t protocol)
|
||||
{
|
||||
switch (protocol) {
|
||||
case PROTOCOL_CHANNELS_PXX:
|
||||
@@ -270,23 +270,7 @@ void sendPulses(uint8_t port, uint8_t protocol)
|
||||
|
||||
#if defined(CROSSFIRE)
|
||||
case PROTOCOL_CHANNELS_CROSSFIRE:
|
||||
if (telemetryProtocol == PROTOCOL_TELEMETRY_CROSSFIRE) {
|
||||
uint8_t * crossfire = modulePulsesData[port].crossfire.pulses;
|
||||
uint8_t len;
|
||||
#if defined(LUA)
|
||||
if (outputTelemetryBufferTrigger != 0x00 && outputTelemetryBufferSize > 0) {
|
||||
memcpy(crossfire, outputTelemetryBuffer, outputTelemetryBufferSize);
|
||||
len = outputTelemetryBufferSize;
|
||||
outputTelemetryBufferTrigger = 0x00;
|
||||
outputTelemetryBufferSize = 0;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
len = createCrossfireChannelsFrame(crossfire, &channelOutputs[g_model.moduleData[port].channelsStart]);
|
||||
}
|
||||
sportSendBuffer(crossfire, len);
|
||||
}
|
||||
setupPulsesCrossfire(port);
|
||||
scheduleNextMixerCalculation(port, CROSSFIRE_PERIOD);
|
||||
break;
|
||||
#endif
|
||||
@@ -328,7 +312,7 @@ void setupPulses(uint8_t module)
|
||||
enablePulses(module, required_protocol);
|
||||
}
|
||||
else {
|
||||
sendPulses(module, required_protocol);
|
||||
setupPulses(module, required_protocol);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -161,12 +161,13 @@ union TrainerPulsesData {
|
||||
|
||||
extern TrainerPulsesData trainerPulsesData;
|
||||
|
||||
void setupPulses(uint8_t port);
|
||||
void setupPulsesDSM2(uint8_t port);
|
||||
void setupPulsesMultimodule(uint8_t port);
|
||||
void setupPulsesSbus(uint8_t port);
|
||||
void setupPulsesPXX(uint8_t port);
|
||||
void setupPulsesPPMModule(uint8_t port);
|
||||
void setupPulses(uint8_t module);
|
||||
void setupPulsesDSM2(uint8_t module);
|
||||
void setupPulsesCrossfire(uint8_t module);
|
||||
void setupPulsesMultimodule(uint8_t module);
|
||||
void setupPulsesSbus(uint8_t module);
|
||||
void setupPulsesPXX(uint8_t module);
|
||||
void setupPulsesPPMModule(uint8_t module);
|
||||
void setupPulsesPPMTrainer();
|
||||
void sendByteDsm2(uint8_t b);
|
||||
void putDsm2Flush();
|
||||
|
||||
@@ -94,7 +94,7 @@ extern "C" void INTMODULE_USART_IRQHandler(void)
|
||||
}
|
||||
}
|
||||
|
||||
void intmoduleSendNextFrame()
|
||||
void intmoduleSendNextPXX2Frame()
|
||||
{
|
||||
if (moduleSettings[INTERNAL_MODULE].protocol == PROTOCOL_CHANNELS_PXX2) {
|
||||
DMA_InitTypeDef DMA_InitStructure;
|
||||
|
||||
@@ -116,6 +116,7 @@ elseif(PCB STREQUAL XLITES)
|
||||
set(FONTS_TARGET 9x_fonts_1bit)
|
||||
set(LCD_DRIVER lcd_driver_spi.cpp)
|
||||
set(GVAR_SCREEN model_gvars.cpp)
|
||||
set(RADIO_SPECTRUM YES)
|
||||
endif()
|
||||
|
||||
if(PCB STREQUAL XLITE OR PCB STREQUAL XLITES)
|
||||
@@ -168,14 +169,15 @@ endif()
|
||||
add_definitions(-DPCBTARANIS)
|
||||
add_definitions(-DAUDIO -DVOICE -DRTCLOCK)
|
||||
|
||||
set(GUI_SRC ${GUI_SRC}
|
||||
set(GUI_SRC
|
||||
${GUI_SRC}
|
||||
model_input_edit.cpp
|
||||
model_mix_edit.cpp
|
||||
model_display.cpp
|
||||
radio_diagkeys.cpp
|
||||
radio_diaganas.cpp
|
||||
radio_hardware.cpp
|
||||
radio_spectrum.cpp
|
||||
|
||||
view_channels.cpp
|
||||
view_telemetry.cpp
|
||||
view_about.cpp
|
||||
@@ -183,6 +185,14 @@ set(GUI_SRC ${GUI_SRC}
|
||||
../screenshot.cpp
|
||||
)
|
||||
|
||||
if(RADIO_SPECTRUM)
|
||||
add_definitions(-DRADIO_SPECTRUM)
|
||||
set(GUI_SRC
|
||||
${GUI_SRC}
|
||||
radio_spectrum.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if(PCB STREQUAL X7 OR PCB STREQUAL XLITE OR PCB STREQUAL XLITES)
|
||||
set(LED_DRIVER led_driver.cpp)
|
||||
endif()
|
||||
|
||||
@@ -184,7 +184,7 @@ void init_no_pulses(uint8_t module);
|
||||
void disable_no_pulses(uint8_t module);
|
||||
void init_ppm(uint8_t module);
|
||||
void disable_ppm(uint8_t module);
|
||||
void intmoduleSendNextFrame();
|
||||
void intmoduleSendNextPXX2Frame();
|
||||
void init_pxx2(uint8_t module);
|
||||
void disable_pxx2(uint8_t module);
|
||||
void init_pxx(uint8_t module);
|
||||
|
||||
@@ -92,6 +92,16 @@ void intmoduleSendNextFrame()
|
||||
}
|
||||
}
|
||||
|
||||
void intmodulePxx2Start()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void intmoduleSendNextPXX2Frame()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void intmodulePxxStart()
|
||||
{
|
||||
INTERNAL_MODULE_ON();
|
||||
|
||||
Reference in New Issue
Block a user