Skip to content

Commit 56cbfcd

Browse files
committed
Merge branch 'release-1.0.2'
2 parents 20e217d + e056cfb commit 56cbfcd

File tree

13 files changed

+244
-74
lines changed

13 files changed

+244
-74
lines changed

doc/changelog.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
========================
2+
SDM 1.0.2
3+
------------------------
4+
Released on 2021-12-03
5+
========================
6+
7+
* sdmconsole: fixed a bug in stream reader with last packet not being displayed under certain circumstances
8+
* installer: fixed a regression with start menu shortcut not being deleted
9+
* installer: use EnVar plugin instead of EnvVarUpdate module to modify PATH variable
10+
* uartdemo: implement synchronization (trigger modes)
11+
112
========================
213
SDM 1.0.1
314
------------------------

doc/manual.pdf

-211 Bytes
Binary file not shown.

src/cmake/Version.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.3.0)
44

55
set(PRODUCT_VERSION_MAJOR 1)
66
set(PRODUCT_VERSION_MINOR 0)
7-
set(PRODUCT_VERSION_PATCH 1)
7+
set(PRODUCT_VERSION_PATCH 2)
88

99
try_compile(CPU_DETECTED "${CMAKE_CURRENT_BINARY_DIR}/try_compile/DetectCPU" "${CMAKE_CURRENT_LIST_DIR}/DetectCPU.c" COPY_FILE "${CMAKE_CURRENT_BINARY_DIR}/try_compile/DetectCPU.bin")
1010

src/cmake/installer/make_installer.nsi.in

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
!include "MUI2.nsh"
44
!include "Sections.nsh"
5-
!include "EnvVarUpdate.nsh"
65
!include "WordFunc.nsh"
76
!include "FileFunc.nsh"
87
!include "x64.nsh"
@@ -105,21 +104,18 @@ LangString UninstallOldVersionFailed ${LANG_RUSSIAN} "Не удалось уда
105104
LangString VCRedistInstallationFailed ${LANG_ENGLISH} "Warning: Microsoft Visual C++ Redistributable installation failed (exit code $0)."
106105
LangString VCRedistInstallationFailed ${LANG_RUSSIAN} "Предупреждение: установка Microsoft Visual C++ Redistributable завершилась неудачей (код выхода $0)."
107106

108-
LangString AddToPath ${LANG_ENGLISH} "Add ${PROGRAM_SHORT_NAME} to the PATH variable"
107+
LangString AddToPath ${LANG_ENGLISH} "Add ${PROGRAM_SHORT_NAME} to the PATH environment variable"
109108
LangString AddToPath ${LANG_RUSSIAN} "Добавить ${PROGRAM_SHORT_NAME} в переменную окружения PATH"
110109

111-
LangString StartMenuShortcuts ${LANG_ENGLISH} "Create start menu shortcuts"
112-
LangString StartMenuShortcuts ${LANG_RUSSIAN} "Создать ярлыки в главном меню"
110+
LangString StartMenuShortcuts ${LANG_ENGLISH} "Create a start menu shortcut"
111+
LangString StartMenuShortcuts ${LANG_RUSSIAN} "Создать ярлык в главном меню"
113112

114-
LangString DesktopShortcuts ${LANG_ENGLISH} "Create desktop shortcut"
113+
LangString DesktopShortcuts ${LANG_ENGLISH} "Create a desktop shortcut"
115114
LangString DesktopShortcuts ${LANG_RUSSIAN} "Создать ярлык на рабочем столе"
116115

117116
LangString UninstallString ${LANG_ENGLISH} "Uninstall"
118117
LangString UninstallString ${LANG_RUSSIAN} "Удалить"
119118

120-
LangString ManualString ${LANG_ENGLISH} "User Manual"
121-
LangString ManualString ${LANG_RUSSIAN} "Руководство пользователя"
122-
123119
LangString UninstallProgramFiles ${LANG_ENGLISH} "Uninstall program files"
124120
LangString UninstallProgramFiles ${LANG_RUSSIAN} "Удалить файлы программы"
125121

@@ -289,7 +285,8 @@ SectionEnd
289285

290286
Section $(AddToPath)
291287
# Modify PATH environment variable
292-
${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$INSTDIR"
288+
EnVar::SetHKLM
289+
EnVar::AddValue "PATH" "$INSTDIR"
293290
SectionEnd
294291

295292
Section $(StartMenuShortcuts)
@@ -313,13 +310,14 @@ FunctionEnd
313310
Section "un.$(UninstallProgramFiles)"
314311
SectionIn RO
315312
# Remove program from PATH
316-
${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$INSTDIR"
313+
EnVar::SetHKLM
314+
EnVar::DeleteValue "PATH" "$INSTDIR"
317315

318316
# Remove unistaller entry
319317
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_FULL_NAME_WITH_ARCH}"
320318

321319
# Remove shortcuts
322-
RMDir /REBOOTOK "$SMPROGRAMS\${MAIN_EXECUTABLE} (${ARCH_STR}).lnk"
320+
Delete /REBOOTOK "$SMPROGRAMS\${MAIN_EXECUTABLE} (${ARCH_STR}).lnk"
323321
Delete /REBOOTOK "$DESKTOP\${MAIN_EXECUTABLE} (${ARCH_STR}).lnk"
324322

325323
# Remove uninstaller

src/doc/manual/manual.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,11 +288,11 @@ \subsection{Examples}
288288
\subsection{Generating installer for Windows}
289289
\label{subsec:wininstaller}
290290

291-
Under Microsoft Windows, SDM provides a script, \shellcmd{make\_installer.nsi}, which can be used to generate an installer with NSIS (Nullsoft Scriptable Install System)\footnote{\url{http://nsis.sourceforge.net}}. Using the \emph{Large Strings} special build of NSIS is recommended, otherwise the installer can fail to properly update the PATH environment variable.
291+
Under Microsoft Windows, SDM provides a script, \shellcmd{make\_installer.nsi}, which can be used to generate an installer with NSIS (Nullsoft Scriptable Install System)\footnote{\url{http://nsis.sourceforge.io}}.
292292

293293
To generate the installer package, SDM must be first built and installed using CMake (possibly to a temporary directory). The NSIS script is configured by the build system and installed alongside program executables. Then, \shellcmd{makensis} program is used to create an installer.
294294

295-
The installer generation script uses the \shellcmd{EnvVarUpdate.nsh} module to modify the \shellcmd{PATH} environment variable in the Windows Registry. This module is not included in the NSIS distribution and must be installed separately\footnote{\url{http://nsis.sourceforge.net/Path_Manipulation}}.
295+
The installer generation script uses the \shellcmd{EnVar} NSIS plugin to modify the \shellcmd{PATH} environment variable in the Windows Registry. This plugin is not included in the NSIS distribution and must be installed separately\footnote{\url{https://nsis.sourceforge.io/EnVar_plug-in}}.
296296

297297
When using a MinGW-based toolchain, it is recommended to use \shellcmd{make install/strip} instead of just \shellcmd{make install} to strip unneeded symbols from the executables:
298298

src/doc/manual/version.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
% This file is automatically generated by the build system.
22
% Do not edit it manually.
33

4-
\newcommand{\productversion}{1.0.1}
4+
\newcommand{\productversion}{1.0.2}

src/gui/sdmconsole/streamreader.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ void StreamReader::run() try {
142142
std::map<int,StreamPacket> packets;
143143
bool connectionVerified=false;
144144
QTime t;
145+
bool haveNewData=false;
145146

146147
t.start();
147148

@@ -188,6 +189,7 @@ void StreamReader::run() try {
188189
auto oldSize=packets[s].data.size();
189190
auto r=readFullPacket(s,packets[s].data);
190191
std::size_t newSamples=packets[s].data.size()-oldSize;
192+
if(newSamples>0) haveNewData=true;
191193
maxNewSamples=std::max(newSamples,maxNewSamples);
192194
if(r==FullPacket) {
193195
packets[s].finished=true;
@@ -226,6 +228,7 @@ void StreamReader::run() try {
226228
_src.readStreamErrors();
227229
glock.unlock();
228230
marshalAsync(&StreamReader::dispatch,std::move(packets));
231+
haveNewData=false;
229232
packets.clear();
230233
t.start();
231234
QThread::yieldCurrentThread(); // give other threads a chance
@@ -234,9 +237,10 @@ void StreamReader::run() try {
234237

235238
glock.unlock();
236239

237-
if(maxNewSamples>0&&t.elapsed()>_displayTimeout) { // too much time since last result, try to produce partial result
240+
if(haveNewData&&t.elapsed()>_displayTimeout) { // too much time since last result, try to produce partial result
238241
// Copy packets instead of moving since we aren't done yet
239242
marshalAsync(&StreamReader::dispatch,packets);
243+
haveNewData=false;
240244
t.start();
241245
}
242246

src/gui/sdmconsole/translations/sdmconsole_ru.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@
694694
<location filename="../registermapwidget.cpp" line="489"/>
695695
<location filename="../registermapworker.cpp" line="86"/>
696696
<location filename="../sidebar.cpp" line="143"/>
697-
<location filename="../streamreader.cpp" line="429"/>
697+
<location filename="../streamreader.cpp" line="433"/>
698698
<location filename="../streamselector.cpp" line="319"/>
699699
<location filename="../streamselector.cpp" line="323"/>
700700
<location filename="../streamselector.cpp" line="327"/>
@@ -1537,27 +1537,27 @@
15371537
<translation>Запись потоков данных:</translation>
15381538
</message>
15391539
<message>
1540-
<location filename="../streamreader.cpp" line="247"/>
1540+
<location filename="../streamreader.cpp" line="251"/>
15411541
<source>Stream reader error: </source>
15421542
<translation>Ошибка чтения потока: </translation>
15431543
</message>
15441544
<message>
1545-
<location filename="../streamreader.cpp" line="360"/>
1545+
<location filename="../streamreader.cpp" line="364"/>
15461546
<source>Error: </source>
15471547
<translation>Ошибка: </translation>
15481548
</message>
15491549
<message>
1550-
<location filename="../streamreader.cpp" line="374"/>
1550+
<location filename="../streamreader.cpp" line="378"/>
15511551
<source>Data streams were successfully saved</source>
15521552
<translation>Потоки данных были успешно сохранены</translation>
15531553
</message>
15541554
<message>
1555-
<location filename="../streamreader.cpp" line="379"/>
1555+
<location filename="../streamreader.cpp" line="383"/>
15561556
<source>Operation has been aborted by the user</source>
15571557
<translation>Операция была прервана пользователем</translation>
15581558
</message>
15591559
<message>
1560-
<location filename="../streamreader.cpp" line="430"/>
1560+
<location filename="../streamreader.cpp" line="434"/>
15611561
<source>Cannot apply data stream set</source>
15621562
<translation>Невозможно применить набор потоков данных</translation>
15631563
</message>

src/sdk/examples/uartdemo/data/uartdemo.srm

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<RegisterMap>
33
<Page name="Page 1">
4+
<SectionHeader>Analog input</SectionHeader>
45
<Register>
56
<Name>ADC input channel</Name>
67
<Id></Id>
@@ -33,6 +34,77 @@
3334
<Value>1</Value>
3435
</Data>
3536
</Register>
37+
<Register>
38+
<Name>Packet size</Name>
39+
<Id></Id>
40+
<Address></Address>
41+
<Data>
42+
<Widget type="LineEdit"/>
43+
<Value>512</Value>
44+
</Data>
45+
<WriteAction>_ch.writereg(0x24,_reg.data&amp;0xFF)
46+
_ch.writereg(0x25,_reg.data&gt;&gt;8)</WriteAction>
47+
<ReadAction>local low=_ch.readreg(0x24)
48+
local high=_ch.readreg(0x25)
49+
return (high&lt;&lt;8)+low</ReadAction>
50+
</Register>
51+
<SectionHeader>Synchronization</SectionHeader>
52+
<Register>
53+
<Name>Sync mode</Name>
54+
<Id></Id>
55+
<Address>0x20</Address>
56+
<Data>
57+
<Widget type="DropDown">
58+
<Option name="Off" value="0"/>
59+
<Option name="Rising edge" value="1"/>
60+
<Option name="Falling edge" value="2"/>
61+
</Widget>
62+
<Value>0</Value>
63+
</Data>
64+
</Register>
65+
<Register>
66+
<Name>Sync source</Name>
67+
<Id></Id>
68+
<Address>0x21</Address>
69+
<Data>
70+
<Widget type="DropDown">
71+
<Option name="Analog input" value="0"/>
72+
<Option name="Digital pin 3" value="3"/>
73+
<Option name="Digital pin 4" value="4"/>
74+
<Option name="Digital pin 5" value="5"/>
75+
<Option name="Digital pin 6" value="6"/>
76+
<Option name="Digital pin 7" value="7"/>
77+
<Option name="Digital pin 8" value="8"/>
78+
<Option name="Digital pin 9" value="9"/>
79+
<Option name="Digital pin 10" value="10"/>
80+
<Option name="Digital pin 11" value="11"/>
81+
<Option name="Digital pin 12" value="12"/>
82+
<Option name="Digital pin 13" value="13"/>
83+
</Widget>
84+
<Value>0</Value>
85+
</Data>
86+
</Register>
87+
<Register>
88+
<Name>Sync level</Name>
89+
<Id></Id>
90+
<Address>0x22</Address>
91+
<Data>
92+
<Widget type="LineEdit"/>
93+
<Value>512</Value>
94+
</Data>
95+
<WriteAction>_ch.writereg(_reg.addr,_reg.data/4)</WriteAction>
96+
<ReadAction>return _ch.readreg(_reg.addr)*4</ReadAction>
97+
</Register>
98+
<Register>
99+
<Name>Sync offset</Name>
100+
<Id></Id>
101+
<Address>0x23</Address>
102+
<Data>
103+
<Widget type="LineEdit"/>
104+
<Value>128</Value>
105+
</Data>
106+
</Register>
107+
<SectionHeader>Pin settings</SectionHeader>
36108
<Register>
37109
<Name>Pin 2 mode</Name>
38110
<Id></Id>

src/sdk/examples/uartdemo/readme.txt

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,31 @@ It allows the user to control digital pins and provides a virtual
33
oscilloscope based on on-chip ADC. Before use, upload the "uartdemo_sketch"
44
to your Arduino.
55

6-
FEATURES
6+
ANALOG INPUT
7+
8+
ADC input channel and reference voltage can be selected by the user.
9+
Sampling frequency is 4808 Hz.
10+
11+
For temperature measurement, select the "Temperature sensor" input channel
12+
and the 1.1V reference. Conversion formula:
13+
14+
T (°C) = 0.782 * CODE - 250.4
15+
16+
SYNCHRONIZATION
17+
18+
Sync mode: Off, Rising edge, Falling edge.
19+
20+
Sync source: either the current analog input, or a digital pin (which will
21+
be put into the Input mode).
22+
23+
Sync level: the oscilloscope will be triggered when the signal goes above
24+
or below this value (depending on the sync edge). Ignored when a digital
25+
pin is used as a sync source.
26+
27+
Sync offset: the number of samples before the trigger event that will be
28+
displayed. Must not be greater than 254.
29+
30+
OTHER FEATURES
731

832
Pins 2-13 can be controlled from the register map. Each pin can be set
933
to one of the following modes:
@@ -18,23 +42,34 @@ to the PWM mode.
1842

1943
Pins 0 and 1 are used for serial communication and can't be controlled.
2044

21-
ADC input channel and reference voltage can be selected by the user.
22-
Sampling frequency is 4808 Hz.
23-
24-
For temperature measurement, select the "Temperature sensor" input channel
25-
and the 1.1V reference. Conversion formula:
26-
27-
T (°C) = 0.782 * CODE - 250.4
28-
2945
PROTOCOL
3046

3147
Serial port configuration: 115200 baud, 8 data bits, 1 stop bit, no parity,
3248
no flow control.
3349

3450
Write register (master -> slave): 01010000 ADDR[7:0] DATA[7:0]
35-
Read register (master-> slave): 01010001 ADDR[7:0]
51+
Read register (master -> slave): 01010001 ADDR[7:0]
3652
Register data (slave -> master): 1000 DATA[7:4] 0000 DATA[3:0]
37-
Stream data (slave -> master): 110 DATA[9:5] 000 DATA[4:0]
53+
Stream data (slave -> master): 11 SOP DATA[9:5] 000 DATA[4:0]
54+
55+
SOP = start of packet flag (1 bit).
56+
57+
REGISTERS
58+
59+
All registers are 8-bit.
60+
61+
Address Function
62+
0x00 Analog input selection (for MUX bits in the ADMUX AVR register)
63+
0x01 Reference voltage selection (for REFS bits in the ADMUX AVR register)
64+
0x02-0x0D Pin 2-13 states: 0 - input, 1 - input with pullup, 2 - force low,
65+
3 - force high, 4 - PWM (for those pins that support it)
66+
0x12-0x1D Pin 2-13 PWM values (for those pins that support it)
67+
0x20 Sync mode: 0 - off, 1 - rising edge, 2 - falling edge
68+
0x21 Sync source: 0 - analog input, digital pin number otherwise
69+
0x22 Sync level (only 8 most significant bits)
70+
0x23 Sync offset
71+
0x24 Packet size (lower 8 bits)
72+
0x25 Packet size (higher 8 bits)
3873

3974
TROUBLESHOOTING
4075

0 commit comments

Comments
 (0)