diff --git a/CMakeLists.txt b/CMakeLists.txt index 17605af7..d6af58bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ endif() project(STMViewer) -set(STMVIEWER_VERSION 0.1.0) +set(STMVIEWER_VERSION 0.1.1) set(CMAKE_BUILD_TYPE Release) set(CMAKE_CXX_STANDARD 17) diff --git a/README.md b/README.md index 32e21f75..44f2be50 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,8 @@ Windows: 1. Make sure you've got GDB installed and added to your PATH (the easiest way is to install using [MinGW](https://www.mingw-w64.org)) 2. Download and run the STMViewer installer. Make sure the ST-link is in "STM32 Debug + Mass Storage + VCP" mode as for some reason "STM32 Debug + VCP" throws libusb errors on Windows. This needs further investigation. +You can assing the external GPU to STMViewer for improved performance. + ## Quick Start 1. Open Options->Acqusition Settings window in the top menu. diff --git a/docs/STMViewer.gif b/docs/STMViewer.gif index 2662ae7f..b99f64a2 100644 Binary files a/docs/STMViewer.gif and b/docs/STMViewer.gif differ diff --git a/src/VarReader/VarReader.cpp b/src/VarReader/VarReader.cpp index 89d47769..9ccc1e4e 100644 --- a/src/VarReader/VarReader.cpp +++ b/src/VarReader/VarReader.cpp @@ -114,44 +114,59 @@ bool VarReader::setValue(const Variable& var, double value) switch (var.getType()) { case Variable::type::U8: + { sl->q_buf[0] = static_cast(value); retVal = stlink_write_mem8(sl, address, 1); break; + } case Variable::type::I8: + { sl->q_buf[0] = static_cast(value); retVal = stlink_write_mem8(sl, address, 1); break; + } case Variable::type::U16: + { sl->q_buf[0] = static_cast(value); sl->q_buf[1] = static_cast(value) >> 8; retVal = stlink_write_mem8(sl, address, 2); break; + } case Variable::type::I16: + { sl->q_buf[0] = static_cast(value); sl->q_buf[1] = static_cast(value) >> 8; retVal = stlink_write_mem8(sl, address, 2); break; + } case Variable::type::U32: + { sl->q_buf[0] = static_cast(value); sl->q_buf[1] = static_cast(value) >> 8; sl->q_buf[2] = static_cast(value) >> 16; sl->q_buf[3] = static_cast(value) >> 24; retVal = stlink_write_mem8(sl, address, 4); break; + } case Variable::type::I32: + { sl->q_buf[0] = static_cast(value); sl->q_buf[1] = static_cast(value) >> 8; sl->q_buf[2] = static_cast(value) >> 16; sl->q_buf[3] = static_cast(value) >> 24; retVal = stlink_write_mem8(sl, address, 4); break; + } case Variable::type::F32: - sl->q_buf[0] = (*(uint32_t*)&value); - sl->q_buf[1] = (*(uint32_t*)&value) >> 8; - sl->q_buf[2] = (*(uint32_t*)&value) >> 16; - sl->q_buf[3] = (*(uint32_t*)&value) >> 24; + { + float val = static_cast(value); + sl->q_buf[0] = (*(uint32_t*)&val); + sl->q_buf[1] = (*(uint32_t*)&val) >> 8; + sl->q_buf[2] = (*(uint32_t*)&val) >> 16; + sl->q_buf[3] = (*(uint32_t*)&val) >> 24; retVal = stlink_write_mem8(sl, address, 4); break; + } default: return false; }