Merged remote-tracking branch 'upstream/master'

This commit is contained in:
furrtek 2015-11-18 22:01:48 +01:00
commit 835d581e6c
135 changed files with 8512 additions and 7734 deletions

View file

@ -31,45 +31,10 @@
#include "radio.hpp"
#include "hackrf_hal.hpp"
using namespace hackrf::one;
namespace ui {
FRESULT fr; /* FatFs function common result code */
/* BasebandStatsView *****************************************************/
BasebandStatsView::BasebandStatsView() {
add_children({ {
&text_used,
&text_idle,
} });
}
void BasebandStatsView::on_show() {
context().message_map[Message::ID::BasebandStatistics] = [this](const Message* const p) {
this->on_statistics_update(static_cast<const BasebandStatisticsMessage*>(p)->statistics);
};
}
void BasebandStatsView::on_hide() {
context().message_map[Message::ID::BasebandStatistics] = nullptr;
}
static std::string ticks_to_percent_string(const uint32_t ticks) {
const uint32_t percent_x100 = ticks / (base_m4_clk_f / 10000);
return
to_string_dec_uint(percent_x100 / 100, 3) + "." +
to_string_dec_uint(percent_x100 % 100, 2, '0') + "%";
}
void BasebandStatsView::on_statistics_update(const BasebandStatistics& statistics) {
text_used.set(ticks_to_percent_string(statistics.baseband_ticks));
text_idle.set(ticks_to_percent_string(statistics.idle_ticks));
}
DebugMemoryView::DebugMemoryView(NavigationView& nav) {
add_children({ {
&text_title,
@ -195,7 +160,7 @@ DebugSDView::DebugSDView(NavigationView& nav) {
fr = f_open(&fdst, "TST.SND", FA_OPEN_EXISTING | FA_READ);
if (!fr) led_rx.on();
//if (!fr) led_rx.on();
/*fr = f_read(&fdst, buffer, 512*2, &bw);