Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix wrong cast in morse app #2436

Merged
merged 2 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions firmware/application/external/morse_tx/ui_morse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,8 @@ MorseView::MorseView(
set_foxhunt(foxhunt_code);
};

options_modulation.on_change = [this](size_t i, int32_t value) {
(void)i; // avoid unused warning
mode_cw = (bool)value;
options_modulation.on_change = [this](size_t, OptionsField::value_t v) {
mode_cw = (bool)v;
};

options_loop.on_change = [this](size_t i, uint32_t value) {
Expand Down
9 changes: 7 additions & 2 deletions firmware/application/external/morse_tx/ui_morse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ using namespace morse;

namespace ui::external_app::morse_tx {

enum Modulation {
FM = 0,
CW = 1
};

class MorseView : public View {
public:
MorseView(NavigationView& nav);
Expand Down Expand Up @@ -137,8 +142,8 @@ class MorseView : public View {
OptionsField options_modulation{
{15 * 8, 10 * 8},
2,
{{"CW", true},
{"FM", false}}};
{{"CW", Modulation::CW},
{"FM", Modulation::FM}}};

OptionsField options_loop{
{9 * 8, 12 * 8},
Expand Down
Loading