AFSK RX works (only Bell202 for now)

AFSK RX always logs to file
Removed frequency and bw settings from modem setup view
Updated binary
Bugfix: Binary display shifted one bit
Bugfix: Frequency manager views freezing if SD card not present
Bugfix: Menuview blinking arrow not showing up at the right position
Bugfix: Freeze if console written to while it's hidden
Broken: LCR TX, needs UI update
This commit is contained in:
furrtek
2017-09-02 08:28:29 +01:00
parent 42439d1885
commit 950bc2b1d2
29 changed files with 428 additions and 206 deletions
+34 -16
View File
@@ -26,9 +26,22 @@
#include "ui.hpp"
#include "ui_navigation.hpp"
#include "ui_receiver.hpp"
#include "ui_widget.hpp"
#include "log_file.hpp"
#include "utility.hpp"
class AFSKLogger {
public:
Optional<File::Error> append(const std::string& filename) {
return log_file.append(filename);
}
void log_raw_data(const std::string& data);
private:
LogFile log_file { };
};
namespace ui {
class AFSKRxView : public View {
@@ -41,7 +54,11 @@ public:
std::string title() const override { return "AFSK RX (beta)"; };
private:
void on_data(uint_fast8_t byte);
void on_data(uint32_t value, bool is_data);
uint8_t console_color { 0 };
uint32_t prev_value { 0 };
std::string str_log { "" };
RFAmpField field_rf_amp {
{ 13 * 8, 0 * 16 }
@@ -60,33 +77,34 @@ private:
};
FrequencyField field_frequency {
{ 0 * 8, 0 * 8 },
{ 0 * 8, 0 * 16 },
};
OptionsField options_bitrate {
{ 12 * 8, 21 },
7,
{
{ "600bps ", 600 },
{ "1200bps", 1200 },
{ "2400bps", 2400 }
}
Text text_debug {
{ 0 * 8, 1 * 16, 10 * 8, 16 },
"DEBUG"
};
Button button_modem_setup {
{ 12 * 8, 1 * 16, 96, 24 },
"Modem setup"
};
Console console {
{ 0, 4 * 16, 240, 240 }
{ 0, 3 * 16, 240, 240 }
};
void update_freq(rf::Frequency f);
void on_bitrate_changed(const uint32_t new_bitrate);
void on_data_afsk(const AFSKDataMessage& message);
std::unique_ptr<AFSKLogger> logger { };
MessageHandlerRegistration message_handler_packet {
Message::ID::AFSKData,
[this](Message* const p) {
const auto message = static_cast<const AFSKDataMessage*>(p);
this->on_data(message->byte);
this->on_data(message->value, message->is_data);
}
};
};