mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-01 19:16:29 -04:00
Enable Sample Rate to be spec'd in .ini file for Weather & SubGhzDecoder apps (#1659)
This commit is contained in:
parent
36e1b9a36e
commit
19a66fac20
10 changed files with 28 additions and 26 deletions
|
@ -88,8 +88,7 @@ SubGhzDView::SubGhzDView(NavigationView& nav)
|
|||
recent_entries_view.on_select = [this](const SubGhzDRecentEntry& entry) {
|
||||
nav_.push<SubGhzDRecentEntryDetailView>(entry);
|
||||
};
|
||||
baseband::set_subghzd(0); // am
|
||||
receiver_model.set_sampling_rate(4'000'000);
|
||||
baseband::set_subghzd_config(0, receiver_model.sampling_rate()); // 0=am
|
||||
receiver_model.enable();
|
||||
signal_token_tick_second = rtc_time::signal_tick_second += [this]() {
|
||||
on_tick_second();
|
||||
|
|
|
@ -115,8 +115,7 @@ WeatherView::WeatherView(NavigationView& nav)
|
|||
recent_entries_view.on_select = [this](const WeatherRecentEntry& entry) {
|
||||
nav_.push<WeatherRecentEntryDetailView>(entry);
|
||||
};
|
||||
baseband::set_weather();
|
||||
receiver_model.set_sampling_rate(4'000'000); // needed too
|
||||
baseband::set_subghzd_config(0, receiver_model.sampling_rate()); // 0=am
|
||||
receiver_model.enable();
|
||||
signal_token_tick_second = rtc_time::signal_tick_second += [this]() {
|
||||
on_tick_second();
|
||||
|
@ -233,4 +232,4 @@ void RecentEntriesTable<ui::WeatherRecentEntries>::draw(
|
|||
painter.draw_string(target_rect.location(), style, line);
|
||||
}
|
||||
|
||||
} // namespace ui
|
||||
} // namespace ui
|
||||
|
|
|
@ -100,8 +100,8 @@ class WeatherView : public View {
|
|||
NavigationView& nav_;
|
||||
RxRadioState radio_state_{
|
||||
433'920'000 /* frequency */,
|
||||
2'500'000 /* bandwidth max283x*/,
|
||||
4'000'000 /* sampling rate */,
|
||||
1'750'000 /* bandwidth */,
|
||||
2'000'000 /* sampling rate */,
|
||||
ReceiverModel::Mode::AMAudio};
|
||||
app_settings::SettingsManager settings_{
|
||||
"rx_weather",
|
||||
|
|
|
@ -319,13 +319,8 @@ void set_spectrum_painter_config(const uint16_t width, const uint16_t height, bo
|
|||
send_message(&message);
|
||||
}
|
||||
|
||||
void set_weather() {
|
||||
const SubGhzFPRxConfigureMessage message{0};
|
||||
send_message(&message);
|
||||
}
|
||||
|
||||
void set_subghzd(uint8_t modulation = 0) {
|
||||
const SubGhzFPRxConfigureMessage message{modulation};
|
||||
void set_subghzd_config(uint8_t modulation = 0, uint32_t sampling_rate = 0) {
|
||||
const SubGhzFPRxConfigureMessage message{modulation, sampling_rate};
|
||||
send_message(&message);
|
||||
}
|
||||
|
||||
|
|
|
@ -88,8 +88,7 @@ void set_spectrum(const size_t sampling_rate, const size_t trigger);
|
|||
void set_siggen_tone(const uint32_t tone);
|
||||
void set_siggen_config(const uint32_t bw, const uint32_t shape, const uint32_t duration);
|
||||
void set_spectrum_painter_config(const uint16_t width, const uint16_t height, bool update, int32_t bw);
|
||||
void set_weather();
|
||||
void set_subghzd(uint8_t modulation);
|
||||
void set_subghzd_config(uint8_t modulation, uint32_t sampling_rate);
|
||||
void request_beep();
|
||||
|
||||
void run_image(const portapack::spi_flash::image_tag_t image_tag);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue