Restoring jammer and RDS functionalities, please wait...

Started work on frequency manager and numbers station simulator
This commit is contained in:
furrtek
2016-12-05 12:56:41 +01:00
parent ef0feae62b
commit d18b6d135d
43 changed files with 1083 additions and 734 deletions
+1 -1
View File
@@ -295,7 +295,7 @@ void ILI9341::drawBMP(const ui::Point p, const uint8_t * bitmap, const bool tran
uint32_t data_idx;
uint8_t by, c, count, transp_idx = 0;
ui::Color line_buffer[240];
ui::Coord px = 0, py;
uint16_t px = 0, py;
ui::Color palette[16];
// Abort if bad depth or no RLE
+2 -2
View File
@@ -539,13 +539,13 @@ public:
class RDSConfigureMessage : public Message {
public:
constexpr RDSConfigureMessage(
const uint32_t length
const uint16_t length
) : Message { ID::RDSConfigure },
length(length)
{
}
const uint32_t length = 0;
const uint16_t length = 0;
};
class RetuneMessage : public Message {
+5 -8
View File
@@ -28,9 +28,9 @@
#include "message_queue.hpp"
struct JammerRange {
bool active;
int64_t center;
int64_t width;
bool enabled;
uint64_t center;
uint32_t width;
uint32_t duration;
};
@@ -46,12 +46,9 @@ struct SharedMemory {
MessageQueue app_local_queue { app_local_queue_data, app_local_queue_k };
char m4_panic_msg[32] { 0 };
size_t bit_length;
JammerRange jammer_ranges[16];
char tx_data[512] { 0 };
// struct tx_data union for 9x JammerRange ?
uint8_t tx_data[512] { 0 };
};
extern SharedMemory& shared_memory;
+30 -1
View File
@@ -103,7 +103,7 @@ void Widget::hidden(bool hide) {
if( hide ) {
// TODO: Instead of dirtying parent entirely, dirty only children
// that overlap with this widget.
parent()->dirty_overlapping_children_in_rect(parent_rect);
dirty_overlapping_children_in_rect(parent_rect);
/* TODO: Notify self and all non-hidden children that they're
* now effectively hidden?
*/
@@ -1116,6 +1116,35 @@ SymField::SymField(
set_focusable(true);
}
SymField::SymField(
Point parent_pos,
size_t length,
bool hex
) : Widget { { parent_pos, { static_cast<ui::Dim>(8 * length), 16 } } },
length_ { length },
hex_ { hex }
{
uint8_t c;
// Hex field auto-init
for (c = 0; c < length; c++)
set_symbol_list(c, "0123456789ABCDEF");
set_focusable(true);
}
uint64_t SymField::value_hex_u64() {
uint8_t c;
uint64_t v = 0;
if (hex_) {
for (c = 0; c < length_; c++)
v += values_[c] << (4 * (length_ - 1 - c));
return v;
} else
return 0;
}
uint32_t SymField::value(const uint32_t index) {
if (index >= length_) return 0;
+3
View File
@@ -447,6 +447,7 @@ public:
std::function<void()> on_change;
SymField(Point parent_pos, size_t length);
SymField(Point parent_pos, size_t length, bool hex);
SymField(const SymField&) = delete;
SymField(SymField&&) = delete;
@@ -455,6 +456,7 @@ public:
void set_value(const uint32_t index, const uint32_t new_value);
void set_length(const uint32_t new_length);
void set_symbol_list(const uint32_t index, const std::string symbol_list);
uint64_t value_hex_u64();
void paint(Painter& painter) override;
@@ -468,6 +470,7 @@ private:
uint32_t selected_ = 0;
size_t length_, prev_length_;
bool erase_prev_ = false;
bool hex_ = false;
int32_t clip_value(const uint32_t index, const uint32_t value);
};