Savestate ! RDS (only PSN) tx

This commit is contained in:
furrtek
2015-08-23 05:08:38 +02:00
parent 14ada9e132
commit 8e0210f944
24 changed files with 459 additions and 45 deletions
+1
View File
@@ -36,6 +36,7 @@ enum class Direction {
};
buffer_t wait_for_rx_buffer();
buffer_t wait_for_tx_buffer();
} /* namespace baseband */
+21
View File
@@ -28,6 +28,8 @@ using namespace portapack;
#include "ch.h"
#include <complex>
namespace lcd {
namespace {
@@ -239,6 +241,25 @@ void ILI9341::fill_rectangle(ui::Rect r, const ui::Color c) {
}
}
void ILI9341::draw_line(const ui::Point start, const ui::Point end, const ui::Color color) {
int x0 = start.x;
int y0 = start.y;
int x1 = end.x;
int y1 = end.y;
int dx = std::abs(x1-x0), sx = x0<x1 ? 1 : -1;
int dy = std::abs(y1-y0), sy = y0<y1 ? 1 : -1;
int err = (dx>dy ? dx : -dy)/2, e2;
for(;;){
draw_pixel({static_cast<ui::Coord>(x0), static_cast<ui::Coord>(y0)}, color);
if (x0==x1 && y0==y1) break;
e2 = err;
if (e2 >-dx) { err -= dy; x0 += sx; }
if (e2 < dy) { err += dx; y0 += sy; }
}
}
void ILI9341::fill_circle(
const ui::Point center,
const ui::Dim radius,
+1
View File
@@ -45,6 +45,7 @@ public:
void shutdown();
void fill_rectangle(ui::Rect r, const ui::Color c);
void draw_line(const ui::Point start, const ui::Point end, const ui::Color color);
void fill_circle(
const ui::Point center,
const ui::Dim radius,
+9
View File
@@ -164,6 +164,15 @@ public:
AudioStatistics statistics;
};
/*enum bbmode {
RxNBAM = 1,
RxNBFM = 2,
RxWBFM = 3,
RxFSK = 4,
TxRDS = 15,
BBOff = 255
};*/
struct BasebandConfiguration {
int32_t mode;
uint32_t sampling_rate;
@@ -38,6 +38,10 @@ struct SharedMemory {
// TODO: M0 should directly configure and control DMA channel that is
// acquiring ADC samples.
TouchADCFrame touch_adc_frame;
int test;
uint32_t rdsdata[16];
};
extern SharedMemory& shared_memory;
+1
View File
@@ -282,6 +282,7 @@ struct TouchEvent {
Point point;
Type type;
Point rawpoint;
};
} /* namespace ui */
+10 -1
View File
@@ -356,14 +356,23 @@ void Button::set_text(const std::string value) {
set_dirty();
}
void Button::set_style(const Style* new_style) {
if( new_style != style_ ) {
style_ = new_style;
set_dirty();
}
}
std::string Button::text() const {
return text_;
}
void Button::paint(Painter& painter) {
const auto r = screen_rect();
if (style_ == nullptr) style_ = &style();
const auto paint_style = (has_focus() || flags.highlighted) ? style().invert() : style();
const auto paint_style = (has_focus() || flags.highlighted) ? style_->invert() : *(style_);
painter.draw_rectangle(r, style().foreground);
+2
View File
@@ -228,6 +228,7 @@ public:
}
void set_text(const std::string value);
void set_style(const Style* new_style);
std::string text() const;
void paint(Painter& painter) override;
@@ -237,6 +238,7 @@ public:
private:
std::string text_;
const Style* style_ { nullptr };
};
class OptionsField : public Widget {