Added 4msps, and fixes

This commit is contained in:
HTotoo 2023-12-08 22:38:48 +01:00
parent 049acdea9b
commit a75932644c
4 changed files with 7 additions and 5 deletions

View File

@ -85,6 +85,7 @@ SubGhzDView::SubGhzDView(NavigationView& nav)
nav_.push<SubGhzDRecentEntryDetailView>(entry);
};
baseband::set_subghzd(0); // am
receiver_model.set_sampling_rate(4'000'000);
receiver_model.enable();
signal_token_tick_second = rtc_time::signal_tick_second += [this]() {
on_tick_second();
@ -98,7 +99,7 @@ void SubGhzDView::on_tick_second() {
recent_entries_view.set_dirty();
}
void SubGhzDView::on_data(const WeatherDataMessage* data) {
void SubGhzDView::on_data(const SubGhzDDataMessage* data) {
SubGhzDRecentEntry key{data->sensorType, data->id};
auto matching_recent = find(recent, key.key());
if (matching_recent != std::end(recent)) {

View File

@ -80,7 +80,7 @@ class SubGhzDView : public View {
private:
void on_tick_second();
void on_data(const WeatherDataMessage* data); // TODO
void on_data(const SubGhzDDataMessage* data); // TODO
NavigationView& nav_;
RxRadioState radio_state_{
@ -123,9 +123,9 @@ class SubGhzDView : public View {
SubGhzDRecentEntriesView recent_entries_view{columns, recent};
MessageHandlerRegistration message_handler_packet{
Message::ID::WeatherData,
Message::ID::SubGhzDData,
[this](Message* const p) {
const auto message = static_cast<const WeatherDataMessage*>(p);
const auto message = static_cast<const SubGhzDDataMessage*>(p);
this->on_data(message);
}};
};

View File

@ -116,6 +116,7 @@ WeatherView::WeatherView(NavigationView& nav)
nav_.push<WeatherRecentEntryDetailView>(entry);
};
baseband::set_weather();
receiver_model.set_sampling_rate(4'000'000);
receiver_model.enable();
signal_token_tick_second = rtc_time::signal_tick_second += [this]() {
on_tick_second();

View File

@ -42,7 +42,7 @@ class WeatherProcessor : public BasebandProcessor {
private:
static constexpr size_t baseband_fs = 4'000'000; // it works, I think we need to write that master clock in the baseband_threat , even later we decimate it.
static constexpr uint32_t nsPerDecSamp = 500 * 8; // In current sw , we do not scale it due to clock. We scaled it due to less array buffer sampes due to /8 decimation.
static constexpr uint32_t nsPerDecSamp = 250 * 8; // In current sw , we do not scale it due to clock. We scaled it due to less array buffer sampes due to /8 decimation.
// TODO , Pending to investigate , why ticks are not proportional to the SR clock, 500 nseg (2Mhz) , 250 nseg (4Mhz) ??? ;previous comment : "we nees ms to has to divide by 1000"
/* Array Buffer aux. used in decim0 and decim1 IQ c16 signed data ; (decim0 defines the max length of the array) */