diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2021-03-21 16:33:08 -0400 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2021-03-21 16:33:08 -0400 |
commit | a4f1482a8b23d5f761f60d6f3821c84190d89e2f (patch) | |
tree | 746095fa69eccccdc1c2830fdd0c06bac01848f5 /gui | |
parent | 1a7d45b9130251119874df8b15424ec41306d8f2 (diff) |
add pot. support; L4 trig; eagle schematic draft
Diffstat (limited to 'gui')
-rw-r--r-- | gui/wxmain.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/gui/wxmain.cpp b/gui/wxmain.cpp index d020bef..1a10b84 100644 --- a/gui/wxmain.cpp +++ b/gui/wxmain.cpp @@ -122,6 +122,12 @@ asm("vsqrt.f64 d0, d0; bx lr"); return 0; } +auto readalt() { +adcsample_t s; +asm("svc 3; mov %0, r0" : "=&r"(s)); +return s; +} + // End stmdspgui header code )cpp"; @@ -156,7 +162,7 @@ asm("vmov.f32 r1, s0;" return 0; } __attribute__((naked)) -auto tan(double x) { +auto tan(float x) { asm("vmov.f32 r1, s0;" "mov r0, #2;" "svc 1;" @@ -170,6 +176,12 @@ asm("vsqrt.f32 s0, s0; bx lr"); return 0; } +auto readalt() { +adcsample_t s; +asm("push {r4-r6}; svc 3; mov %0, r0; pop {r4-r6}" : "=&r"(s)); +return s; +} + // End stmdspgui header code )cpp"; @@ -472,6 +484,11 @@ void MainFrame::prepareEditor() wxString MainFrame::compileEditorCode() { + if (m_device == nullptr) { + m_status_bar->SetStatusText("Need device connected to compile."); + return ""; + } + if (m_temp_file_name.IsEmpty()) m_temp_file_name = wxFileName::CreateTempFileName("stmdspgui"); |