"At least it builds !"

This commit is contained in:
furrtek 2016-04-21 22:12:51 +02:00
parent 1b0da68d65
commit 2fcfdba9ea
19 changed files with 46 additions and 87 deletions

View File

@ -22,7 +22,7 @@
PATH_BOOTSTRAP=bootstrap
PATH_APPLICATION=application
PATH_BASEBAND=baseband
PATH_BASEBAND_TX=baseband-tx
# PATH_BASEBAND_TX=baseband-tx
TARGET=portapack-h1-firmware
@ -30,7 +30,7 @@ TARGET_BOOTSTRAP=$(PATH_BOOTSTRAP)/bootstrap
TARGET_HACKRF_FIRMWARE=hackrf_one_usb_ram
TARGET_APPLICATION=$(PATH_APPLICATION)/build/application
TARGET_BASEBAND=$(PATH_BASEBAND)/build/baseband
TARGET_BASEBAND_TX=$(PATH_BASEBAND_TX)/build/baseband-tx
# TARGET_BASEBAND_TX=$(PATH_BASEBAND_TX)/build/baseband-tx
MAKE_SPI_IMAGE=tools/make_spi_image.py
MAKE_MODULES_FILE=tools/make_baseband_file.py
@ -59,13 +59,13 @@ program: $(TARGET).bin modules
sleep 1s
hackrf_spiflash -w $(TARGET).bin
modules: $(TARGET_BASEBAND).bin $(TARGET_BASEBAND_TX).bin
modules: $(TARGET_BASEBAND).bin # $(TARGET_BASEBAND_TX).bin
$(MAKE_MODULES_FILE) $(MODULES)
cp $(PATH_BASEBAND).bin ../sdcard/$(PATH_BASEBAND).bin
cp $(PATH_BASEBAND_TX).bin ../sdcard/$(PATH_BASEBAND_TX).bin
# cp $(PATH_BASEBAND_TX).bin ../sdcard/$(PATH_BASEBAND_TX).bin
$(TARGET).bin: modules $(MAKE_SPI_IMAGE) $(TARGET_BOOTSTRAP).bin $(TARGET_HACKRF_FIRMWARE).dfu $(TARGET_BASEBAND).bin $(TARGET_BASEBAND_TX).bin $(TARGET_APPLICATION).bin
$(MAKE_SPI_IMAGE) $(TARGET_BOOTSTRAP).bin $(TARGET_HACKRF_FIRMWARE).dfu $(TARGET_BASEBAND_TX).bin $(TARGET_APPLICATION).bin $(TARGET).bin
$(TARGET).bin: modules $(MAKE_SPI_IMAGE) $(TARGET_BOOTSTRAP).bin $(TARGET_HACKRF_FIRMWARE).dfu $(TARGET_BASEBAND).bin $(TARGET_APPLICATION).bin
$(MAKE_SPI_IMAGE) $(TARGET_BOOTSTRAP).bin $(TARGET_HACKRF_FIRMWARE).dfu $(TARGET_BASEBAND).bin $(TARGET_APPLICATION).bin $(TARGET).bin
$(TARGET_BOOTSTRAP).bin: $(TARGET_BOOTSTRAP).elf
$(CP) -O binary $(TARGET_BOOTSTRAP).elf $(TARGET_BOOTSTRAP).bin

View File

@ -172,9 +172,6 @@ private:
NoTouch,
TouchDetected,
};
static float cmx;
static float cmy;
static constexpr uint32_t width_pixels = 240;
static constexpr uint32_t height_pixels = 320;
@ -183,12 +180,12 @@ private:
static constexpr size_t touch_count_threshold { 4 };
static constexpr uint32_t touch_stable_bound { 4 };
static constexpr float calib_x_low = 0.15f;
static constexpr float calib_x_high = 0.93f;
static constexpr float calib_x_low = 0.07f;
static constexpr float calib_x_high = 0.94f;
static constexpr float calib_x_range = calib_x_high - calib_x_low;
static constexpr float calib_y_low = 0.05f;
static constexpr float calib_y_high = 0.84f;
static constexpr float calib_y_low = 0.04f;
static constexpr float calib_y_high = 0.91f;
static constexpr float calib_y_range = calib_y_high - calib_y_low;
// Ensure filter length is equal or less than touch_count_threshold,
@ -212,8 +209,6 @@ private:
};
}
ui::Point raw_point() const ;
void touch_started() {
fire_event(ui::TouchEvent::Type::Start);
}
@ -228,7 +223,7 @@ private:
void fire_event(ui::TouchEvent::Type type) {
if( on_event ) {
on_event({ filtered_point(), type, raw_point() });
on_event({ filtered_point(), type });
}
}
};

View File

@ -26,6 +26,7 @@
#include "ymdata.hpp"
#include "portapack.hpp"
#include "audio.hpp"
#include "event_m0.hpp"
#include "ui_about.hpp"
@ -73,7 +74,7 @@ void AboutView::on_show() {
transmitter_model.set_tuning_frequency(92200000); // 92.2MHz, change !
portapack::audio_codec.set_headphone_volume(volume_t::decibel(0 - 99) + wolfson::wm8731::headphone_gain_range.max);
audio::headphone::set_volume(volume_t::decibel(0 - 99) + audio::headphone::volume_range().max);
transmitter_model.enable();
}
@ -350,7 +351,7 @@ void AboutView::update() {
// Slowly increase volume to avoid jumpscare
if (headphone_vol < (70<<2)) {
portapack::audio_codec.set_headphone_volume(volume_t::decibel((headphone_vol/4) - 99) + wolfson::wm8731::headphone_gain_range.max);
audio::headphone::set_volume(volume_t::decibel((headphone_vol/4) - 99) + audio::headphone::volume_range().max);
headphone_vol++;
}
}

View File

@ -25,7 +25,7 @@
#include "ui_painter.hpp"
#include "ui_menu.hpp"
#include "ui_navigation.hpp"
#include "m4_startup.hpp"
#include "core_control.hpp"
#include "ui_font_fixed_8x16.hpp"
namespace ui {

View File

@ -52,20 +52,10 @@ void MenuItemView::paint(Painter& painter) {
r,
paint_style.background
);
ui::Color final_item_color = item.color;
if (final_item_color.v == paint_style.background.v) final_item_color = paint_style.foreground;
Style text_style {
.font = paint_style.font,
.background = paint_style.background,
.foreground = final_item_color
};
painter.draw_string(
{ static_cast<Coord>(r.pos.x + 8), static_cast<Coord>(r.pos.y + (r.size.h - font_height) / 2) },
text_style,
{ r.pos.x + 8, r.pos.y + (r.size.h - font_height) / 2 },
paint_style,
item.text
);
}

View File

@ -34,7 +34,6 @@ namespace ui {
struct MenuItem {
std::string text;
ui::Color color;
std::function<void(void)> on_select;
// TODO: Prevent default-constructed MenuItems.

View File

@ -23,7 +23,7 @@
#include "portapack.hpp"
#include "event_m0.hpp"
#include "portapack_persistent_memory.hpp"
#include "splash.hpp"
#include "ui_about.hpp"
@ -299,7 +299,7 @@ BMPView::BMPView(NavigationView& nav) {
button_done.on_select = [this,&nav](Button&){
nav.pop();
nav.push(new SystemMenuView { nav });
nav.push<SystemMenuView>();
};
}
@ -316,7 +316,7 @@ void PlayDeadView::focus() {
PlayDeadView::PlayDeadView(NavigationView& nav, bool booting) {
_booting = booting;
persistent_memory::set_playing_dead(0x59);
portapack::persistent_memory::set_playing_dead(0x59);
add_children({ {
&text_playdead1,
@ -329,8 +329,8 @@ PlayDeadView::PlayDeadView(NavigationView& nav, bool booting) {
};
button_done.on_select = [this,&nav](Button&){
if (sequence == persistent_memory::playdead_sequence()) {
persistent_memory::set_playing_dead(0);
if (sequence == portapack::persistent_memory::playdead_sequence()) {
portapack::persistent_memory::set_playing_dead(0);
if (_booting) {
nav.pop();
nav.push<SystemMenuView>();

View File

@ -187,8 +187,8 @@ void SetTouchCalibView::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));
text_debugx.set(to_string_dec_uint(round(event.point.x), 4));
text_debugy.set(to_string_dec_uint(round(event.point.y), 4));
}
return true;
}
@ -441,6 +441,15 @@ void ModInfoView::focus() {
SetupMenuView::SetupMenuView(NavigationView& nav) {
add_items<7>({ {
{ "SD card modules", [&nav](){ nav.push<ModInfoView>(); } },
{ "Date/Time", [&nav](){ nav.push<SetDateTimeView>(); } },
{ "Frequency correction", [&nav](){ nav.push<SetFrequencyCorrectionView>(); } },
{ "Antenna Bias Voltage", [&nav](){ nav.push<AntennaBiasSetupView>(); } },
{ "Touch screen", [&nav](){ nav.push<SetTouchCalibView>(); } },
{ "Play dead", [&nav](){ nav.push<SetPlayDeadView>(); } },
{ "UI", [&nav](){ nav.push<SetUIView>(); } },
} });
/*add_items<7>({ {
{ "SD card modules", ui::Color::white(), [&nav](){ nav.push<ModInfoView>(); } },
{ "Date/Time", ui::Color::white(), [&nav](){ nav.push<SetDateTimeView>(); } },
{ "Frequency correction", ui::Color::white(), [&nav](){ nav.push<SetFrequencyCorrectionView>(); } },
@ -448,7 +457,7 @@ SetupMenuView::SetupMenuView(NavigationView& nav) {
{ "Touch screen", ui::Color::white(), [&nav](){ nav.push<SetTouchCalibView>(); } },
{ "Play dead", ui::Color::red(), [&nav](){ nav.push<SetPlayDeadView>(); } },
{ "UI", ui::Color::white(), [&nav](){ nav.push<SetUIView>(); } },
} });
} });*/
on_left = [&nav](){ nav.pop(); };
}

View File

@ -26,6 +26,7 @@
#include "hackrf_hal.hpp"
#include "event_m0.hpp"
#include "audio.hpp"
#include "ui_alphanum.hpp"
#include "ff.h"
#include "hackrf_gpio.hpp"
@ -204,7 +205,7 @@ void XylosView::journuit() {
upd_message();
portapack::audio_codec.set_headphone_volume(volume_t::decibel(90 - 99) + wolfson::wm8731::headphone_gain_range.max);
audio::headphone::set_volume(volume_t::decibel(90 - 99) + audio::headphone::volume_range().max);
shared_memory.xylos_transmit_done = false;
memcpy(shared_memory.xylosdata, ccirmessage, 21);
transmitter_model.enable();
@ -326,7 +327,7 @@ XylosView::XylosView(
[this,&transmitter_model](Message* const p) {
const auto message = static_cast<const TXDoneMessage*>(p);
if (message->n == 25) {
portapack::audio_codec.set_headphone_volume(volume_t::decibel(0 - 99) + wolfson::wm8731::headphone_gain_range.max);
audio::headphone::set_volume(volume_t::decibel(0 - 99) + audio::headphone::volume_range().max);
transmitter_model.disable();
txing = false;
button_txtest.set_style(&style_val);
@ -341,7 +342,7 @@ XylosView::XylosView(
transmitter_model.set_tuning_frequency(xylos_freqs[options_freq.selected_index()]);
portapack::audio_codec.set_headphone_volume(volume_t::decibel(90 - 99) + wolfson::wm8731::headphone_gain_range.max);
audio::headphone::set_volume(volume_t::decibel(90 - 99) + audio::headphone::volume_range().max);
txing = true;
button_txtest.set_style(&style_cancel);
@ -362,7 +363,7 @@ XylosView::XylosView(
char progress[21];
const auto message = static_cast<const TXDoneMessage*>(p);
if (message->n == 25) {
portapack::audio_codec.set_headphone_volume(volume_t::decibel(0 - 99) + wolfson::wm8731::headphone_gain_range.max);
audio::headphone::set_volume(volume_t::decibel(0 - 99) + audio::headphone::volume_range().max);
transmitter_model.disable();
for (c=0;c<20;c++)
progress[c] = ' ';
@ -390,7 +391,7 @@ XylosView::XylosView(
transmitter_model.set_tuning_frequency(xylos_freqs[options_freq.selected_index()]);
portapack::audio_codec.set_headphone_volume(volume_t::decibel(90 - 99) + wolfson::wm8731::headphone_gain_range.max);
audio::headphone::set_volume(volume_t::decibel(90 - 99) + audio::headphone::volume_range().max);
txing = true;
button_transmit.set_style(&style_cancel);

Binary file not shown.

View File

@ -42,7 +42,6 @@
#include "debug.hpp"
#include "audio.hpp"
#include "audio_dma.hpp"
#include "gcc.hpp"

Binary file not shown.

View File

@ -120,8 +120,6 @@ void BasebandThread::run() {
);
}
}
delete baseband_buffer;
}
BasebandProcessor* BasebandThread::create_processor(const int32_t mode) {

View File

@ -1,2 +1 @@
const char md5_baseband[16] = {0x03,0x77,0xc0,0x0b,0x13,0x5b,0x84,0x72,0x8f,0x4b,0xbb,0x51,0x48,0x54,0x82,0xd3,};
const char md5_baseband_tx[16] = {0xa3,0xb9,0xd4,0x35,0xb5,0xe0,0x66,0x82,0xac,0x61,0x59,0xa1,0x27,0x36,0x0b,0xfe,};
const char md5_baseband[16] = {0x4a,0x99,0xbe,0xec,0x29,0x7c,0x61,0xd2,0x1d,0xc1,0xb5,0x5e,0xb4,0x16,0xae,0x5d,};

View File

@ -255,7 +255,6 @@ struct TouchEvent {
Point point;
Type type;
Point rawpoint;
};
} /* namespace ui */

View File

@ -301,7 +301,7 @@ Checkbox::Checkbox(
) : Widget { { parent_pos, { static_cast<ui::Dim>((8 * length) + 24), 24 } } },
text_ { text }
{
flags.focusable = true;
set_focusable(true);
}
void Checkbox::set_text(const std::string value) {
@ -325,7 +325,7 @@ bool Checkbox::value() const {
void Checkbox::paint(Painter& painter) {
const auto r = screen_rect();
const auto paint_style = (has_focus() || flags.highlighted) ? style().invert() : style();
const auto paint_style = (has_focus() || highlighted()) ? style().invert() : style();
painter.draw_rectangle({ r.pos.x, r.pos.y, 24, 24 }, style().foreground);
@ -377,12 +377,12 @@ bool Checkbox::on_key(const KeyEvent key) {
bool Checkbox::on_touch(const TouchEvent event) {
switch(event.type) {
case TouchEvent::Type::Start:
flags.highlighted = true;
set_highlighted(true);
set_dirty();
return true;
case TouchEvent::Type::End:
flags.highlighted = false;
set_highlighted(false);
value_ = not value_;
set_dirty();
if( on_select ) {
@ -393,37 +393,6 @@ bool Checkbox::on_touch(const TouchEvent event) {
default:
return false;
}
#if 0
switch(event.type) {
case TouchEvent::Type::Start:
flags.highlighted = true;
set_dirty();
return true;
case TouchEvent::Type::Move:
{
const bool new_highlighted = screen_rect().contains(event.point);
if( flags.highlighted != new_highlighted ) {
flags.highlighted = new_highlighted;
set_dirty();
}
}
return true;
case TouchEvent::Type::End:
if( flags.highlighted ) {
flags.highlighted = false;
set_dirty();
if( on_select ) {
on_select(*this);
}
}
return true;
default:
return false;
}
#endif
}
/* Button ****************************************************************/

Binary file not shown.

Binary file not shown.

Binary file not shown.