From a4f1482a8b23d5f761f60d6f3821c84190d89e2f Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Sun, 21 Mar 2021 16:33:08 -0400 Subject: add pot. support; L4 trig; eagle schematic draft --- gui/wxmain.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'gui') 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"); -- cgit v1.2.3