mirror of
https://github.com/EdgeTX/edgetx.git
synced 2025-07-23 00:05:13 +03:00
Add external modules handling for power and spektrum
This commit is contained in:
parent
c5793c93d5
commit
5fd70d7c8c
4 changed files with 74 additions and 28 deletions
|
@ -21,14 +21,10 @@
|
|||
#include "opentx.h"
|
||||
|
||||
extern void pxx2ModuleRequiredScreen(event_t event);
|
||||
extern uint8_t g_moduleIdx;
|
||||
|
||||
void menuRadioSpectrumAnalyser(event_t event)
|
||||
{
|
||||
if (!isModulePXX2(INTERNAL_MODULE)) {
|
||||
pxx2ModuleRequiredScreen(event);
|
||||
return;
|
||||
}
|
||||
|
||||
if (TELEMETRY_STREAMING()) {
|
||||
lcdDrawCenteredText(15, "Turn off receiver");
|
||||
return;
|
||||
|
@ -38,17 +34,23 @@ void menuRadioSpectrumAnalyser(event_t event)
|
|||
|
||||
if (menuEvent) {
|
||||
pausePulses();
|
||||
moduleSettings[INTERNAL_MODULE].mode = MODULE_MODE_NORMAL;
|
||||
moduleSettings[g_moduleIdx].mode = MODULE_MODE_NORMAL;
|
||||
/* wait 500ms off */
|
||||
watchdogSuspend(500);
|
||||
RTOS_WAIT_MS(500);
|
||||
resumePulses();
|
||||
/* wait 500ms to resume normal operation before leaving */
|
||||
watchdogSuspend(500);
|
||||
RTOS_WAIT_MS(500);
|
||||
return;
|
||||
}
|
||||
|
||||
if (moduleSettings[INTERNAL_MODULE].mode != MODULE_MODE_SPECTRUM_ANALYSER) {
|
||||
if (moduleSettings[g_moduleIdx].mode != MODULE_MODE_SPECTRUM_ANALYSER) {
|
||||
memclear(reusableBuffer.spectrumAnalyser.bars, sizeof(reusableBuffer.spectrumAnalyser.bars));
|
||||
moduleSettings[INTERNAL_MODULE].mode = MODULE_MODE_SPECTRUM_ANALYSER;
|
||||
reusableBuffer.spectrumAnalyser.span = 40000000; // 40MHz
|
||||
reusableBuffer.spectrumAnalyser.freq = 2440000000; // 2440MHz
|
||||
reusableBuffer.spectrumAnalyser.step = reusableBuffer.spectrumAnalyser.span / LCD_W;
|
||||
moduleSettings[g_moduleIdx].mode = MODULE_MODE_SPECTRUM_ANALYSER;
|
||||
}
|
||||
|
||||
uint8_t peak_y = 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue