mirror of
https://github.com/opentx/opentx.git
synced 2025-07-25 01:05:10 +03:00
Spectrum analyser working
This commit is contained in:
parent
2fc96cf14d
commit
485472f7c9
7 changed files with 10 additions and 8 deletions
|
@ -167,7 +167,7 @@ void check_submenu_simple(event_t event, uint8_t maxrow);
|
|||
void title(const char * s);
|
||||
#define TITLE(str) title(str)
|
||||
|
||||
#define MENU_TAB(...) const uint8_t mstate_tab[] = __VA_ARGS__
|
||||
#define MENU_TAB(...) const uint8_t mstate_tab[] = __VA_ARGS__
|
||||
|
||||
#if defined(PCBX7)
|
||||
#define MENU_CHECK(tab, menu, lines_count) \
|
||||
|
|
|
@ -24,9 +24,12 @@ void menuRadioSpectrum(event_t event)
|
|||
{
|
||||
MENU("SPECTRUM", menuTabGeneral, MENU_RADIO_SPECTRUM, HEADER_LINE, { HEADER_LINE_COLUMNS });
|
||||
|
||||
if (event == EVT_ENTRY) {
|
||||
if (menuEvent) {
|
||||
moduleSettings[INTERNAL_MODULE].mode = MODULE_MODE_NORMAL;
|
||||
}
|
||||
else if (event == EVT_ENTRY) {
|
||||
memclear(reusableBuffer.spectrum.bars, sizeof(reusableBuffer.spectrum.bars));
|
||||
moduleSettings[INTERNAL_MODULE].mode = MODULE_MODE_SPECTRUM;
|
||||
moduleSettings[INTERNAL_MODULE].mode = MODULE_MODE_SPECTRUM_ANALYSER;
|
||||
}
|
||||
|
||||
for (uint8_t i=0; i<LCD_W; i++) {
|
||||
|
|
|
@ -373,7 +373,6 @@ void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t
|
|||
|
||||
menuCalibrationState = 0;
|
||||
drawScreenIndex(curr, menuTabSize, attr);
|
||||
|
||||
}
|
||||
|
||||
DISPLAY_PROGRESS_BAR(menuTab ? lcdLastRightPos-2*FW-((curr+1)/10*FWNUM)-2 : 20*FW+1);
|
||||
|
|
|
@ -293,7 +293,7 @@ void sendPulses(uint8_t port, uint8_t protocol)
|
|||
|
||||
case PROTOCOL_CHANNELS_PXX2:
|
||||
setupPulsesPXX2(port);
|
||||
scheduleNextMixerCalculation(port, moduleSettings[port].mode == MODULE_MODE_SPECTRUM ? 1 : PXX2_PERIOD);
|
||||
scheduleNextMixerCalculation(port, moduleSettings[port].mode == MODULE_MODE_SPECTRUM_ANALYSER ? 1 : PXX2_PERIOD);
|
||||
break;
|
||||
|
||||
#if defined(MULTIMODULE)
|
||||
|
|
|
@ -74,7 +74,7 @@ enum ModuleSettingsMode
|
|||
MODULE_MODE_RANGECHECK,
|
||||
MODULE_MODE_BIND,
|
||||
MODULE_MODE_REGISTER,
|
||||
MODULE_MODE_SPECTRUM,
|
||||
MODULE_MODE_SPECTRUM_ANALYSER,
|
||||
};
|
||||
|
||||
PACK(struct ModuleSettings {
|
||||
|
|
|
@ -136,7 +136,7 @@ bool Pxx2Pulses::setupFrame(uint8_t module)
|
|||
result = setupRegisterFrame(module);
|
||||
else if (mode == MODULE_MODE_BIND)
|
||||
result = setupBindFrame(module);
|
||||
else if (mode == MODULE_MODE_SPECTRUM)
|
||||
else if (mode == MODULE_MODE_SPECTRUM_ANALYSER)
|
||||
result = setupSpectrumAnalyser(module);
|
||||
else
|
||||
setupChannelsFrame(module);
|
||||
|
|
|
@ -132,7 +132,7 @@ void processBindFrame(uint8_t module, uint8_t * frame)
|
|||
|
||||
void processSpectrumFrame(uint8_t module, uint8_t * frame)
|
||||
{
|
||||
if (moduleSettings[module].mode != MODULE_MODE_SPECTRUM) {
|
||||
if (moduleSettings[module].mode != MODULE_MODE_SPECTRUM_ANALYSER) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue