mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-01-13 05:23:41 +00:00
Add second tick handler for CaptureThread.
This commit is contained in:
parent
8188b44439
commit
11d15ec5b5
@ -25,6 +25,7 @@
|
|||||||
using namespace portapack;
|
using namespace portapack;
|
||||||
|
|
||||||
#include "file.hpp"
|
#include "file.hpp"
|
||||||
|
#include "time.hpp"
|
||||||
|
|
||||||
#include "utility.hpp"
|
#include "utility.hpp"
|
||||||
|
|
||||||
@ -77,9 +78,14 @@ CaptureAppView::CaptureAppView(NavigationView& nav) {
|
|||||||
});
|
});
|
||||||
receiver_model.set_baseband_bandwidth(baseband_bandwidth);
|
receiver_model.set_baseband_bandwidth(baseband_bandwidth);
|
||||||
receiver_model.enable();
|
receiver_model.enable();
|
||||||
|
|
||||||
|
signal_token_tick_second = time::signal_tick_second += [this]() {
|
||||||
|
this->on_tick_second();
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
CaptureAppView::~CaptureAppView() {
|
CaptureAppView::~CaptureAppView() {
|
||||||
|
time::signal_tick_second -= signal_token_tick_second;
|
||||||
receiver_model.disable();
|
receiver_model.disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,6 +123,11 @@ void CaptureAppView::on_record() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CaptureAppView::on_tick_second() {
|
||||||
|
if( capture_thread ) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CaptureAppView::on_tuning_frequency_changed(rf::Frequency f) {
|
void CaptureAppView::on_tuning_frequency_changed(rf::Frequency f) {
|
||||||
receiver_model.set_tuning_frequency(f);
|
receiver_model.set_tuning_frequency(f);
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#include "bitmap.hpp"
|
#include "bitmap.hpp"
|
||||||
|
|
||||||
#include "capture_thread.hpp"
|
#include "capture_thread.hpp"
|
||||||
|
#include "signal.hpp"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@ -57,7 +58,10 @@ private:
|
|||||||
|
|
||||||
std::unique_ptr<CaptureThread> capture_thread;
|
std::unique_ptr<CaptureThread> capture_thread;
|
||||||
|
|
||||||
|
SignalToken signal_token_tick_second;
|
||||||
|
|
||||||
void on_record();
|
void on_record();
|
||||||
|
void on_tick_second();
|
||||||
|
|
||||||
void on_tuning_frequency_changed(rf::Frequency f);
|
void on_tuning_frequency_changed(rf::Frequency f);
|
||||||
void on_lna_changed(int32_t v_db);
|
void on_lna_changed(int32_t v_db);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user