diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2021-02-03 20:39:15 -0500 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2021-02-03 20:39:15 -0500 |
commit | 87851f4e6c4aebd65e28ef16823ada7b197e2edc (patch) | |
tree | 67722165abbcfd76d7d4ea0ce5442f9450eda1ca /gui/wxmain.cpp | |
parent | a0871d9c96c6d74631b47f7bc81fe367f9a237de (diff) |
more stack space; expose trig to algorithms
Diffstat (limited to 'gui/wxmain.cpp')
-rw-r--r-- | gui/wxmain.cpp | 49 |
1 files changed, 43 insertions, 6 deletions
diff --git a/gui/wxmain.cpp b/gui/wxmain.cpp index 86807ab..10e5d7a 100644 --- a/gui/wxmain.cpp +++ b/gui/wxmain.cpp @@ -65,14 +65,50 @@ static const char *file_header = R"cpp( using adcsample_t = uint16_t; constexpr unsigned int SIZE = $0; - adcsample_t *process_data(adcsample_t *samples, unsigned int size); - extern "C" void process_data_entry() { ((void (*)())process_data)(); } +constexpr double PI = 3.14159265358979323846L; +__attribute__((naked)) +auto sin(double x) { +asm("vmov.f64 r1, r2, d0;" + "eor r0, r0;" + "svc 1;" + "vmov.f64 d0, r1, r2;" + "bx lr"); +return 0; +} +__attribute__((naked)) +auto cos(double x) { +asm("vmov.f64 r1, r2, d0;" + "mov r0, #1;" + "svc 1;" + "vmov.f64 d0, r1, r2;" + "bx lr"); +return 0; +} +__attribute__((naked)) +auto tan(double x) { +asm("vmov.f64 r1, r2, d0;" + "mov r0, #2;" + "svc 1;" + "vmov.f64 d0, r1, r2;" + "bx lr"); +return 0; +} +__attribute__((naked)) +auto sqrt(double x) { +asm("vmov.f64 r1, r2, d0;" + "mov r0, #3;" + "svc 1;" + "vmov.f64 d0, r1, r2;" + "bx lr"); +return 0; +} + // End stmdspgui header code )cpp"; @@ -223,11 +259,12 @@ MainFrame::MainFrame() : wxFrame(nullptr, wxID_ANY, "stmdspgui", wxPoint(50, 50) void MainFrame::onCloseEvent(wxCloseEvent& event) { SetMenuBar(nullptr); - delete m_menu_bar->Remove(2); - delete m_menu_bar->Remove(1); - delete m_menu_bar->Remove(0); - delete m_menu_bar; + //delete m_menu_bar->Remove(2); + //delete m_menu_bar->Remove(1); + //delete m_menu_bar->Remove(0); + //delete m_menu_bar; delete m_measure_timer; + delete m_device; Unbind(wxEVT_COMBOBOX, &MainFrame::onToolbarSampleRate, this, wxID_ANY, wxID_ANY); Unbind(wxEVT_BUTTON, &MainFrame::onRunCompile, this, Id::MCodeCompile, wxID_ANY); |