diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2021-05-23 13:19:09 -0400 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2021-05-23 13:19:09 -0400 |
commit | f1773b634eb6cf4e1312379dcc7bcbab7291c60b (patch) | |
tree | 2fe10536100230e7e6a3b597147f51ba4ddc32d8 /gui | |
parent | d2f50fb9259a3142fa6b319a7a735a0e19355d01 (diff) |
2nd pot; some doc; smooth WAV playback
Diffstat (limited to 'gui')
-rw-r--r-- | gui/wxmain_devdata.cpp | 24 | ||||
-rw-r--r-- | gui/wxmain_mrun.cpp | 22 |
2 files changed, 27 insertions, 19 deletions
diff --git a/gui/wxmain_devdata.cpp b/gui/wxmain_devdata.cpp index 551f6cc..7f736a2 100644 --- a/gui/wxmain_devdata.cpp +++ b/gui/wxmain_devdata.cpp @@ -49,16 +49,16 @@ const char *makefile_text_l4 = #endif "arm-none-eabi-g++ -x c++ -Os -std=c++20 -fno-exceptions -fno-rtti " "-mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mtune=cortex-m4 " - "-nostartfiles -I$1/cmsis" + "-nostartfiles -I$1/cmsis " "-Wl,-Ttext-segment=0x10000000 -Wl,-zmax-page-size=512 -Wl,-eprocess_data_entry " "$0 -o $0.o" NEWLINE - COPY " $0.o $0.orig.o" NEWLINE - "arm-none-eabi-strip -s -S --strip-unneeded $0.o" NEWLINE - "arm-none-eabi-objcopy --remove-section .ARM.attributes " + COPY " $0.o $0.orig.o" NEWLINE + "arm-none-eabi-strip -s -S --strip-unneeded $0.o" NEWLINE + "arm-none-eabi-objcopy --remove-section .ARM.attributes " "--remove-section .comment " "--remove-section .noinit " "$0.o" NEWLINE - "arm-none-eabi-size $0.o" NEWLINE; + "arm-none-eabi-size $0.o" NEWLINE; // $0 = buffer size const char *file_header_h7 = R"cpp( @@ -168,11 +168,21 @@ asm("vsqrt.f32 s0, s0; bx lr"); return 0; } -auto readalt() { +auto readpot1() { Sample s; -asm("push {r4-r6}; svc 3; mov %0, r0; pop {r4-r6}" : "=&r"(s)); +asm("push {r4-r6}; eor r0, r0; svc 3; mov %0, r0; pop {r4-r6}" : "=&r"(s)); return s; } +auto readpot2() { +Sample s; +asm("push {r4-r6}; mov r0, #1; svc 3; mov %0, r0; pop {r4-r6}" : "=&r"(s)); +return s; +} + +void puts(const char *s) { +// 's' will already be in r0. +asm("push {r4-r6}; svc 4; pop {r4-r6}"); +} // End stmdspgui header code diff --git a/gui/wxmain_mrun.cpp b/gui/wxmain_mrun.cpp index 58b1873..e12d068 100644 --- a/gui/wxmain_mrun.cpp +++ b/gui/wxmain_mrun.cpp @@ -48,18 +48,16 @@ void MainFrame::onRunStart(wxCommandEvent& ce) m_device->continuous_start_measure(); m_timer_performance->StartOnce(1000); } else { - if (m_device->is_siggening() && m_wav_clip) { - // TODO Confirm need for factor of 500 - m_timer_wavclip->Start(m_device->get_buffer_size() * 500 / - srateNums[m_rate_select->GetSelection()]); - } else if (m_conv_result_log) { - m_timer_record->Start(m_device->get_buffer_size() / - srateNums[m_rate_select->GetSelection()] * - 800 / 1000); - } else if (m_run_draw_samples->IsChecked()) { - m_timer_record->Start(m_device->get_buffer_size() / - srateNums[m_rate_select->GetSelection()]); - } + auto reqSpeedExact = + m_device->get_buffer_size() + / static_cast<float>(srateNums[m_rate_select->GetSelection()]) + * 1000.f * 0.5f; + int reqSpeed = reqSpeedExact; + + if (m_device->is_siggening() && m_wav_clip) + m_timer_wavclip->Start(reqSpeed); + if (m_conv_result_log || m_run_draw_samples->IsChecked()) + m_timer_record->Start(reqSpeed); m_device->continuous_start(); } |