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

View file

@ -20,9 +20,13 @@
*/
#include "ui_setup.hpp"
#include "touch.hpp"
#include "portapack_persistent_memory.hpp"
#include "lpc43xx_cpp.hpp"
#include <math.h>
using namespace lpc43xx;
namespace ui {
@ -157,11 +161,34 @@ void AboutView::focus() {
button_ok.focus();
}
SetTouchCalibView::SetTouchCalibView(NavigationView& nav) {
add_children({{
&text_title,
&text_debugx,
&text_debugy,
&button_ok
}});
button_ok.on_select = [&nav](Button&){ nav.pop(); };
}
void SetTouchCalibView::focus() {
button_ok.focus();
}
bool SetTouchCalibView::on_touch(const TouchEvent event) {
if (event.type == ui::TouchEvent::Type::Start) {
text_debugx.set(to_string_dec_uint(round(event.rawpoint.x), 4));
text_debugy.set(to_string_dec_uint(round(event.rawpoint.y), 4));
}
return true;
}
SetupMenuView::SetupMenuView(NavigationView& nav) {
add_items<3>({ {
{ "Date/Time", [&nav](){ nav.push(new SetDateTimeView { nav }); } },
{ "Frequency Correction", [&nav](){ nav.push(new SetFrequencyCorrectionView { nav }); } },
{ "Touch", [&nav](){ nav.push(new NotImplementedView { nav }); } },
{ "Touch", [&nav](){ nav.push(new SetTouchCalibView { nav }); } },
} });
on_left = [&nav](){ nav.pop(); };
}