Skip to content

Commit

Permalink
fix: failing DEBUG simulator build for radios without customisable sw…
Browse files Browse the repository at this point in the history
…itches (#5086)
  • Loading branch information
philmoz committed May 30, 2024
1 parent 5ca9880 commit 93bd54b
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions radio/src/gui/colorlcd/radio_diagcustswitches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,15 @@
* GNU General Public License for more details.
*/

#if defined(FUNCTION_SWITCHES)

#include "opentx.h"
#include "radio_diagcustswitches.h"
#include "libopenui.h"
#include "board.h"

#include "hal/rotary_encoder.h"

static EnumKeys get_ith_key(uint8_t i)
{
auto supported_keys = keysGetSupported();
for (uint8_t k = 0; k < MAX_KEYS; k++) {
if (supported_keys & (1 << k)) {
if (i-- == 0) return (EnumKeys)k;
}
}

// should not get here,
// we assume: i < keysGetMaxKeys()
return (EnumKeys)0;
}

class RadioCustSwitchesDiagsWindow : public Window
{
public:
Expand Down Expand Up @@ -95,3 +83,5 @@ RadioCustSwitchesDiagsPage::RadioCustSwitchesDiagsPage() :
buildBody(&body);
// setFocus(SET_FOCUS_DEFAULT);
}

#endif

0 comments on commit 93bd54b

Please sign in to comment.