analogSequence repaired

This commit is contained in:
Tristan Krause 2019-06-06 12:10:17 +02:00
parent ff84de538a
commit bff5ff42e9
85 changed files with 1180 additions and 287 deletions

View file

@ -12,12 +12,86 @@
</component>
<component name="ChangeListManager">
<list default="true" id="d13a1bae-0fd7-48fc-b53c-d6dd1aaf95b9" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/cli.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/cli.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../bin/b15fcli" beforeDir="false" afterPath="$PROJECT_DIR$/../bin/b15fcli" afterDir="false" />
<change beforePath="$PROJECT_DIR$/drv/b15f.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/drv/b15f.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/drv/timeoutexception.h" beforeDir="false" afterPath="$PROJECT_DIR$/drv/timeoutexception.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/drv/usart.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/drv/usart.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/drv/usart.cpp.orig" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/drv/usart.h" beforeDir="false" afterPath="$PROJECT_DIR$/drv/usart.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/CMakeCCompilerId_8c_source.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/CMakeCCompilerId_8c_source.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/CMakeCXXCompilerId_8cpp_source.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/CMakeCXXCompilerId_8cpp_source.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/annotated.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/annotated.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/b15f_8cpp_source.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/b15f_8cpp_source.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/b15f_8h_source.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/b15f_8h_source.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/backup_8cpp_source.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/backup_8cpp_source.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/classB15F-members.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/classB15F-members.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/classB15F.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/classB15F.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/classDot-members.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/classDot-members.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/classDot.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/classDot.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/classDriverException-members.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/classDriverException-members.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/classDriverException.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/classDriverException.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/classPlottyFile-members.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/classPlottyFile-members.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/classPlottyFile.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/classPlottyFile.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/classTimeoutException-members.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/classTimeoutException-members.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/classTimeoutException.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/classTimeoutException.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/classUSART-members.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/classUSART-members.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/classUSART.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/classUSART.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/classUSARTException-members.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/classUSARTException-members.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/classUSARTException.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/classUSARTException.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/classView-members.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/classView-members.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/classView.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/classView.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/classViewInfo-members.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/classViewInfo-members.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/classViewInfo.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/classViewInfo.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/classViewMonitor-members.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/classViewMonitor-members.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/classViewMonitor.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/classViewMonitor.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/classViewPromt-members.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/classViewPromt-members.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/classViewPromt.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/classViewPromt.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/classViewSelection-members.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/classViewSelection-members.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/classViewSelection.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/classViewSelection.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/classes.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/classes.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/cli_8cpp_source.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/cli_8cpp_source.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/dir_1788f8309b1a812dcb800a185471cf6c.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/dir_1788f8309b1a812dcb800a185471cf6c.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/dir_19f2f1b99f19c12fa55b8d312cf373ed.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/dir_19f2f1b99f19c12fa55b8d312cf373ed.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/dir_3d3c8ff3ebf9841b39117ac899f41936.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/dir_3d3c8ff3ebf9841b39117ac899f41936.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/dir_587c94d866dbb2f408f78cf41f9b2f8d.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/dir_587c94d866dbb2f408f78cf41f9b2f8d.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/dir_90e361ec3542f3dd076ea3ad19547437.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/dir_90e361ec3542f3dd076ea3ad19547437.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/dir_95e29a8b8ee7c54052c171a88bb95675.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/dir_95e29a8b8ee7c54052c171a88bb95675.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/dir_f89abcb304c928c7d889aa5625570de5.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/dir_f89abcb304c928c7d889aa5625570de5.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/dot_8cpp_source.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/dot_8cpp_source.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/dot_8h_source.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/dot_8h_source.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/driverexception_8h_source.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/driverexception_8h_source.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/feature__tests_8c_source.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/feature__tests_8c_source.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/feature__tests_8cxx_source.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/feature__tests_8cxx_source.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/files.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/files.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/functions.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/functions.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/functions_func.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/functions_func.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/functions_vars.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/functions_vars.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/hierarchy.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/hierarchy.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/index.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/plottyfile_8cpp_source.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/plottyfile_8cpp_source.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/plottyfile_8h_source.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/plottyfile_8h_source.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/search/all_10.js" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/search/all_10.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/search/all_7.js" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/search/all_7.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/search/all_c.js" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/search/all_c.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/search/all_f.js" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/search/all_f.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/search/functions_a.js" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/search/functions_a.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/search/functions_c.js" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/search/functions_c.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/search/functions_d.js" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/search/functions_d.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/search/variables_1.js" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/search/variables_1.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/timeoutexception_8h_source.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/timeoutexception_8h_source.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/ui_8cpp_source.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/ui_8cpp_source.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/ui_8h_source.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/ui_8h_source.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/usart_8cpp_source.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/usart_8cpp_source.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/usart_8h_source.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/usart_8h_source.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/usartexception_8h_source.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/usartexception_8h_source.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/view_8cpp_source.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/view_8cpp_source.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/view_8h_source.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/view_8h_source.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/view__info_8cpp_source.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/view__info_8cpp_source.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/view__info_8h_source.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/view__info_8h_source.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/view__monitor_8cpp_source.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/view__monitor_8cpp_source.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/view__monitor_8h_source.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/view__monitor_8h_source.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/view__promt_8cpp_source.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/view__promt_8cpp_source.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/view__promt_8h_source.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/view__promt_8h_source.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/view__selection_8cpp_source.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/view__selection_8cpp_source.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../docs/html/view__selection_8h_source.html" beforeDir="false" afterPath="$PROJECT_DIR$/../../docs/html/view__selection_8h_source.html" afterDir="false" />
</list>
<ignored path="$PROJECT_DIR$/cmake-build-debug/" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
@ -43,8 +117,8 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/drv/usart.h">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="396">
<caret line="126" column="44" selection-start-line="126" selection-start-column="44" selection-end-line="126" selection-end-column="44" />
<state relative-caret-position="291">
<caret line="83" column="34" lean-forward="true" selection-start-line="83" selection-start-column="34" selection-end-line="83" selection-end-column="34" />
<folding>
<element signature="e#33#51#0" expanded="true" />
</folding>
@ -52,6 +126,18 @@
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/drv/usart.cpp">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="366">
<caret line="115" column="49" selection-start-line="115" selection-start-column="49" selection-end-line="115" selection-end-column="49" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/drv/usartexception.h">
<provider selected="true" editor-type-id="text-editor">
@ -88,26 +174,26 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/drv/b15f.h">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="285">
<caret line="34" column="41" selection-start-line="34" selection-start-column="41" selection-end-line="34" selection-end-column="41" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/drv/b15f.cpp">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="375">
<caret line="154" selection-start-line="154" selection-end-line="154" />
<state relative-caret-position="352">
<caret line="266" column="46" selection-start-line="266" selection-start-column="29" selection-end-line="266" selection-end-column="46" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/drv/b15f.cpp">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="347">
<caret line="324" column="11" selection-start-line="324" selection-start-column="11" selection-end-line="324" selection-end-column="11" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/cli.cpp">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="2" selection-start-column="2" selection-end-column="2" />
<state relative-caret-position="135">
<caret line="26" column="26" selection-start-line="26" selection-start-column="26" selection-end-line="26" selection-end-column="26" />
</state>
</provider>
</entry>
@ -118,8 +204,8 @@
<findStrings>
<find>read</find>
<find>read_timeout</find>
<find>read_timeout</find>
<find>write_timeout</find>
<find>RQ_ADC_DAC_STROKE</find>
</findStrings>
<replaceStrings>
<replace>::read_timeout</replace>
@ -137,10 +223,10 @@
<option value="$PROJECT_DIR$/drv/usartexception.h" />
<option value="$PROJECT_DIR$/Makefile" />
<option value="$PROJECT_DIR$/drv/timeoutexception.h" />
<option value="$PROJECT_DIR$/cli.cpp" />
<option value="$PROJECT_DIR$/drv/usart.h" />
<option value="$PROJECT_DIR$/drv/usart.cpp" />
<option value="$PROJECT_DIR$/drv/b15f.cpp" />
<option value="$PROJECT_DIR$/cli.cpp" />
</list>
</option>
</component>
@ -224,18 +310,18 @@
<updated>1559118962147</updated>
<workItem from="1559118964304" duration="1913000" />
<workItem from="1559633658436" duration="5344000" />
<workItem from="1559813060146" duration="2140000" />
<workItem from="1559813060146" duration="2642000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="9397000" />
<option name="totallyTimeSpent" value="9899000" />
</component>
<component name="ToolWindowManager">
<frame x="67" y="25" width="1853" height="1055" extended-state="6" />
<editor active="true" />
<layout>
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.255119" />
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.255119" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info id="Favorites" order="2" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" />
@ -247,7 +333,7 @@
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="bottom" id="Database Changes" order="7" />
<window_info anchor="bottom" id="Messages" order="8" weight="0.32937366" />
<window_info anchor="bottom" id="Terminal" order="9" sideWeight="0.4997233" visible="true" weight="0.32181427" />
<window_info active="true" anchor="bottom" id="Terminal" order="9" sideWeight="0.4997233" visible="true" weight="0.32181427" />
<window_info anchor="bottom" id="Event Log" order="10" sideWeight="0.5002767" side_tool="true" weight="0.32181427" />
<window_info anchor="bottom" id="Version Control" order="11" />
<window_info anchor="bottom" id="CMake" order="12" weight="0.33045357" />
@ -303,44 +389,44 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/drv/b15f.h">
<entry file="file://$PROJECT_DIR$/cli.cpp">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="285">
<caret line="34" column="41" selection-start-line="34" selection-start-column="41" selection-end-line="34" selection-end-column="41" />
<state relative-caret-position="135">
<caret line="26" column="26" selection-start-line="26" selection-start-column="26" selection-end-line="26" selection-end-column="26" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/drv/usart.cpp">
<entry file="file://$PROJECT_DIR$/drv/b15f.h">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="306">
<caret line="93" column="45" selection-start-line="93" selection-start-column="45" selection-end-line="93" selection-end-column="45" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
<state relative-caret-position="352">
<caret line="266" column="46" selection-start-line="266" selection-start-column="29" selection-end-line="266" selection-end-column="46" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/drv/usart.h">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="396">
<caret line="126" column="44" selection-start-line="126" selection-start-column="44" selection-end-line="126" selection-end-column="44" />
<state relative-caret-position="291">
<caret line="83" column="34" lean-forward="true" selection-start-line="83" selection-start-column="34" selection-end-line="83" selection-end-column="34" />
<folding>
<element signature="e#33#51#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/drv/b15f.cpp">
<entry file="file://$PROJECT_DIR$/drv/usart.cpp">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="375">
<caret line="154" selection-start-line="154" selection-end-line="154" />
<state relative-caret-position="366">
<caret line="115" column="49" selection-start-line="115" selection-start-column="49" selection-end-line="115" selection-end-column="49" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/cli.cpp">
<entry file="file://$PROJECT_DIR$/drv/b15f.cpp">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="2" selection-start-column="2" selection-end-column="2" />
<state relative-caret-position="347">
<caret line="324" column="11" selection-start-line="324" selection-start-column="11" selection-end-line="324" selection-end-column="11" />
</state>
</provider>
</entry>

View file

@ -125,7 +125,7 @@ bool B15F::testIntConv()
usart.transmit(&rq[0], 0, sizeof(rq));
uint16_t aw;
usart.receive(reinterpret_cast<uint8_t*>(&aw), 0, sizeof(aw));
usart.receive(reinterpret_cast<uint8_t *>(&aw), 0, sizeof(aw));
return aw == dummy * 3;
}
@ -291,7 +291,7 @@ uint16_t B15F::analogRead(uint8_t channel)
usart.transmit(&rq[0], 0, sizeof(rq));
uint16_t aw;
usart.receive(reinterpret_cast<uint8_t*>(&aw), 0, sizeof(aw));
usart.receive(reinterpret_cast<uint8_t *>(&aw), 0, sizeof(aw));
if (aw > 1023)
abort("Bad ADC data detected (1)");
@ -302,45 +302,58 @@ void
B15F::analogSequence(uint8_t channel_a, uint16_t *buffer_a, uint32_t offset_a, uint8_t channel_b, uint16_t *buffer_b,
uint32_t offset_b, uint16_t start, int16_t delta, uint16_t count)
{
/*
// prepare pointers
buffer_a += offset_a;
buffer_b += offset_b;
usart.clearInputBuffer();
usart.writeByte(RQ_ADC_DAC_STROKE);
usart.writeByte(channel_a);
usart.writeByte(channel_b);
usart.writeInt(start);
usart.writeInt(static_cast<uint16_t>(delta));
usart.writeInt(count);
uint8_t rq[] =
{
RQ_ADC_DAC_STROKE,
channel_a,
channel_b,
static_cast<uint8_t >(start & 0xFF),
static_cast<uint8_t >(start >> 8),
static_cast<uint8_t >(delta & 0xFF),
static_cast<uint8_t >(delta >> 8),
static_cast<uint8_t >(count & 0xFF),
static_cast<uint8_t >(count >> 8)
};
for (uint16_t i = 0; i < count; i++) {
if (buffer_a) {
buffer_a[i] = usart.readInt();
usart.transmit(&rq[0], 0, sizeof(rq));
for (uint16_t i = 0; i < count; i++)
{
if (buffer_a)
{
usart.receive(reinterpret_cast<uint8_t *>(&buffer_a[i]), 0, 2);
if (buffer_a[i] > 1023) // check for broken usart connection
abort("Bad ADC data detected (2)");
} else {
usart.readInt();
}
else
{
usart.drop(2);
}
if (buffer_b) {
buffer_b[i] = usart.readInt();
if (buffer_b)
{
usart.receive(reinterpret_cast<uint8_t *>(&buffer_b[i]), 0, 2);
if (buffer_b[i] > 1023) // check for broken usart connection
abort("Bad ADC data detected (3)");
} else {
usart.readInt();
}
else
{
usart.drop(2);
}
}
uint8_t aw = usart.readByte();
if (aw != MSG_OK)
uint8_t aw;
usart.receive(&aw, 0, sizeof(aw));
if(aw != MSG_OK)
abort("Sequenz unterbrochen");
delay_us(10);*/
}
uint8_t B15F::pwmSetFrequency(uint32_t freq)

View file

@ -0,0 +1,444 @@
#include "b15f.h"
B15F *B15F::instance = nullptr;
errorhandler_t B15F::errorhandler = nullptr;
B15F::B15F() {
init();
}
void B15F::init() {
std::string device = exec("bash -c 'ls /dev/ttyUSB*'");
while (device.find(' ') != std::string::npos || device.find('\n') != std::string::npos ||
device.find('\t') != std::string::npos)
device.pop_back();
if (device.length() == 0)
abort("Adapter nicht gefunden");
std::cout << PRE << "Verwende Adapter: " << device << std::endl;
std::cout << PRE << "Stelle Verbindung mit Adapter her... " << std::flush;
usart.setBaudrate(BAUDRATE);
usart.openDevice(device);
std::cout << "OK" << std::endl;
std::cout << PRE << "Teste Verbindung... " << std::flush;
uint8_t tries = 3;
while (tries--) {
// verwerfe Daten, die µC noch hat
//discard();
if (!testConnection())
continue;
if (!testIntConv())
continue;
break;
}
if (tries == 0)
abort("Verbindungstest fehlgeschlagen. Neueste Version im Einsatz?");
std::cout << "OK" << std::endl;
// Gib board info aus
std::vector<std::string> info = getBoardInfo();
std::cout << PRE << "AVR Firmware Version: " << info[0] << " um " << info[1] << " Uhr (" << info[2] << ")"
<< std::endl;
}
void B15F::reconnect() {
uint8_t tries = RECONNECT_TRIES;
while (tries--) {
delay_ms(RECONNECT_TIMEOUT);
discard();
if (testConnection())
return;
}
abort("Verbindung kann nicht repariert werden");
}
void B15F::discard(void) {
try {
uint8_t rq[] =
{
RQ_DISC
};
usart.clearOutputBuffer();
for (uint8_t i = 0; i < 16; i++) {
usart.transmit(&rq[0], 0, sizeof(rq)); // sende discard Befehl (verwerfe input)
delay_ms(4);
}
usart.clearInputBuffer();
}
catch (std::exception &ex) {
abort(ex);
}
}
bool B15F::testConnection() {
// erzeuge zufälliges Byte
srand(time(NULL));
uint8_t dummy = rand() % 256;
uint8_t rq[] =
{
RQ_TEST,
dummy
};
usart.transmit(&rq[0], 0, sizeof(rq));
uint8_t aw[2];
usart.receive(&aw[0], 0, sizeof(aw));
return aw[0] == MSG_OK && aw[1] == dummy;
}
bool B15F::testIntConv() {
srand(time(NULL));
uint16_t dummy = rand() % (0xFFFF / 3);
uint8_t rq[] =
{
RQ_INT,
static_cast<uint8_t >(dummy & 0xFF),
static_cast<uint8_t >(dummy >> 8)
};
usart.transmit(&rq[0], 0, sizeof(rq));
uint16_t aw;
usart.receive(reinterpret_cast<uint8_t *>(&aw), 0, sizeof(aw));
return aw == dummy * 3;
}
std::vector<std::string> B15F::getBoardInfo(void) {
std::vector<std::string> info;
uint8_t rq[] =
{
RQ_INFO
};
usart.transmit(&rq[0], 0, sizeof(rq));
uint8_t n;
usart.receive(&n, 0, sizeof(n));
while (n--) {
uint8_t len;
usart.receive(&len, 0, sizeof(len));
char str[len + 1];
str[len] = '\0';
usart.receive(reinterpret_cast<uint8_t *>(&str[0]), 0, len);
info.push_back(std::string(str));
}
uint8_t aw;
usart.receive(&aw, 0, sizeof(aw));
if (aw != MSG_OK)
abort("Board Info fehlerhalft: code " + std::to_string((int) aw));
return info;
}
bool B15F::activateSelfTestMode() {
uint8_t rq[] =
{
RQ_ST
};
usart.transmit(&rq[0], 0, sizeof(rq));
uint8_t aw;
usart.receive(&aw, 0, sizeof(aw));
return aw == MSG_OK;
}
bool B15F::digitalWrite0(uint8_t port) {
uint8_t rq[] =
{
RQ_BA0,
port
};
usart.transmit(&rq[0], 0, sizeof(rq));
uint8_t aw;
usart.receive(&aw, 0, sizeof(aw));
return aw == MSG_OK;
}
bool B15F::digitalWrite1(uint8_t port) {
uint8_t rq[] =
{
RQ_BA1,
port
};
usart.transmit(&rq[0], 0, sizeof(rq));
uint8_t aw;
usart.receive(&aw, 0, sizeof(aw));
return aw == MSG_OK;
}
uint8_t B15F::digitalRead0() {
usart.clearInputBuffer();
uint8_t rq[] =
{
RQ_BE0
};
usart.transmit(&rq[0], 0, sizeof(rq));
uint8_t aw;
usart.receive(&aw, 0, sizeof(aw));
return aw;
}
uint8_t B15F::digitalRead1() {
usart.clearInputBuffer();
uint8_t rq[] =
{
RQ_BE1
};
usart.transmit(&rq[0], 0, sizeof(rq));
uint8_t aw;
usart.receive(&aw, 0, sizeof(aw));
return aw;
}
uint8_t B15F::readDipSwitch() {
usart.clearInputBuffer();
uint8_t rq[] =
{
RQ_DSW
};
usart.transmit(&rq[0], 0, sizeof(rq));
uint8_t aw;
usart.receive(&aw, 0, sizeof(aw));
return aw;
}
bool B15F::analogWrite0(uint16_t value) {
uint8_t rq[] =
{
RQ_AA0,
static_cast<uint8_t >(value & 0xFF),
static_cast<uint8_t >(value >> 8)
};
usart.transmit(&rq[0], 0, sizeof(rq));
uint8_t aw;
usart.receive(&aw, 0, sizeof(aw));
return aw == MSG_OK;
}
bool B15F::analogWrite1(uint16_t value) {
uint8_t rq[] =
{
RQ_AA1,
static_cast<uint8_t >(value & 0xFF),
static_cast<uint8_t >(value >> 8)
};
usart.transmit(&rq[0], 0, sizeof(rq));
uint8_t aw;
usart.receive(&aw, 0, sizeof(aw));
return aw == MSG_OK;
}
uint16_t B15F::analogRead(uint8_t channel) {
usart.clearInputBuffer();
if (channel > 7)
abort("Bad ADC channel: " + std::to_string(channel));
uint8_t rq[] =
{
RQ_ADC,
channel
};
usart.transmit(&rq[0], 0, sizeof(rq));
uint16_t aw;
usart.receive(reinterpret_cast<uint8_t *>(&aw), 0, sizeof(aw));
if (aw > 1023)
abort("Bad ADC data detected (1)");
return aw;
}
void
B15F::analogSequence(uint8_t channel_a, uint16_t *buffer_a, uint32_t offset_a, uint8_t channel_b, uint16_t *buffer_b,
uint32_t offset_b, uint16_t start, int16_t delta, uint16_t count) {
// prepare pointers
buffer_a += offset_a;
buffer_b += offset_b;
usart.clearInputBuffer();
uint8_t rq[] =
{
RQ_ADC_DAC_STROKE,
channel_a,
channel_b,
static_cast<uint8_t >(start & 0xFF),
static_cast<uint8_t >(start >> 8),
static_cast<uint8_t >(delta & 0xFF),
static_cast<uint8_t >(delta >> 8),
static_cast<uint8_t >(count & 0xFF),
static_cast<uint8_t >(count >> 8)
};
usart.transmit(&rq[0], 0, sizeof(rq));
for (uint16_t i = 0; i < count; i++) {
if (buffer_a) {
usart.receive(reinterpret_cast<uint8_t *>(&buffer_a[i]), 0, 2);
if (buffer_a[i] > 1023) // check for broken usart connection
abort("Bad ADC data detected (2)");
} else {
usart.drop(2);
}
if (buffer_b) {
usart.receive(reinterpret_cast<uint8_t *>(&buffer_b[i]), 0, 2);
if (buffer_b[i] > 1023) // check for broken usart connection
abort("Bad ADC data detected (3)");
} else {
usart.drop(2);
}
}
uint8_t aw;
usart.receive(&aw, 0, sizeof(aw));
if(aw != MSG_OK)
abort("Sequenz unterbrochen");
}
uint8_t B15F::pwmSetFrequency(uint32_t freq) {
usart.clearInputBuffer();
uint8_t rq[] =
{
RQ_PWM_SET_FREQ,
static_cast<uint8_t>((freq >> 0) & 0xFF),
static_cast<uint8_t>((freq >> 8) & 0xFF),
static_cast<uint8_t>((freq >> 16) & 0xFF),
static_cast<uint8_t>((freq >> 24) & 0xFF)
};
usart.transmit(&rq[0], 0, sizeof(rq));
uint8_t aw;
usart.receive(&aw, 0, sizeof(aw));
return aw;
}
bool B15F::pwmSetValue(uint8_t value) {
usart.clearInputBuffer();
uint8_t rq[] =
{
RQ_PWM_SET_VALUE,
value
};
usart.transmit(&rq[0], 0, sizeof(rq));
uint8_t aw;
usart.receive(&aw, 0, sizeof(aw));
return aw == MSG_OK;
}
bool B15F::setRegister(uint8_t adr, uint8_t val) {
usart.clearInputBuffer();
uint8_t rq[] =
{
RQ_SET_REG,
adr,
val
};
usart.transmit(&rq[0], 0, sizeof(rq));
uint8_t aw;
usart.receive(&aw, 0, sizeof(aw));
return aw == val;
}
uint8_t B15F::getRegister(uint8_t adr) {
usart.clearInputBuffer();
uint8_t rq[] =
{
RQ_GET_REG,
adr
};
usart.transmit(&rq[0], 0, sizeof(rq));
uint8_t aw;
usart.receive(&aw, 0, sizeof(aw));
return aw;
}
void B15F::delay_ms(uint16_t ms) {
std::this_thread::sleep_for(std::chrono::milliseconds(ms));
}
void B15F::delay_us(uint16_t us) {
std::this_thread::sleep_for(std::chrono::microseconds(us));
}
B15F &B15F::getInstance(void) {
if (!instance)
instance = new B15F();
return *instance;
}
// https://stackoverflow.com/a/478960
std::string B15F::exec(std::string cmd) {
std::array<char, 128> buffer;
std::string result;
std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(cmd.c_str(), "r"), pclose);
if (!pipe) {
throw std::runtime_error("popen() failed!");
}
while (fgets(buffer.data(), buffer.size(), pipe.get()) != nullptr) {
result += buffer.data();
}
return result;
}
void B15F::abort(std::string msg) {
DriverException ex(msg);
abort(ex);
}
void B15F::abort(std::exception &ex) {
if (errorhandler)
errorhandler(ex);
else {
std::cerr << "NOTICE: B15F::errorhandler not set" << std::endl;
std::cout << ex.what() << std::endl;
throw DriverException(ex.what());
}
}
void B15F::setAbortHandler(errorhandler_t func) {
errorhandler = func;
}

View file

@ -72,6 +72,15 @@ void USART::flushOutputBuffer()
throw USARTException("Fehler beim Versenden des Ausgangspuffers");
}
void USART::transmit(uint8_t *buffer, uint16_t offset, uint8_t len)
{
int code = write(file_desc, buffer + offset, len);
if (code != len)
throw USARTException(
std::string(__FUNCTION__) + " failed: " + std::string(__FILE__) + "#" + std::to_string(__LINE__) +
", " + strerror(code) + " (code " + std::to_string(code) + " / " + std::to_string(len) + ")");
}
void USART::receive(uint8_t *buffer, uint16_t offset, uint8_t len)
{
int bytes_avail, code;
@ -102,13 +111,11 @@ void USART::receive(uint8_t *buffer, uint16_t offset, uint8_t len)
", " + strerror(code) + " (code " + std::to_string(code) + " / " + std::to_string(len) + ")");
}
void USART::transmit(uint8_t *buffer, uint16_t offset, uint8_t len)
void USART::drop(uint8_t len)
{
int code = write(file_desc, buffer + offset, len);
if (code != len)
throw USARTException(
std::string(__FUNCTION__) + " failed: " + std::string(__FILE__) + "#" + std::to_string(__LINE__) +
", " + strerror(code) + " (code " + std::to_string(code) + " / " + std::to_string(len) + ")");
// Kann bestimmt noch eleganter gelöst werden
uint8_t dummy[len];
receive(&dummy[0], 0, len);
}
uint32_t USART::getBaudrate()

View file

@ -0,0 +1,139 @@
#include <stdexcept>
#include "usart.h"
USART::~USART()
{
closeDevice();
}
void USART::openDevice(std::string device)
{
// Benutze blockierenden Modus
file_desc = open(device.c_str(), O_RDWR | O_NOCTTY);// | O_NDELAY
if (file_desc <= 0)
throw USARTException("Fehler beim Öffnen des Gerätes");
struct termios options;
int code = tcgetattr(file_desc, &options);
if (code)
throw USARTException("Fehler beim Lesen der Geräteparameter");
options.c_cflag = CS8 | CLOCAL | CREAD;
options.c_iflag = IGNPAR;
options.c_oflag = 0;
options.c_lflag = 0;
options.c_cc[VMIN] = 0;
options.c_cc[VTIME] = timeout;
code = cfsetspeed(&options, baudrate);
if (code)
throw USARTException("Fehler beim Setzen der Baudrate");
code = tcsetattr(file_desc, TCSANOW, &options);
if (code)
throw USARTException("Fehler beim Setzen der Geräteparameter");
code = fcntl(file_desc, F_SETFL, 0); // blockierender Modus
if (code)
throw USARTException("Fehler beim Aktivieren des blockierenden Modus'");
clearOutputBuffer();
clearInputBuffer();
}
void USART::closeDevice()
{
if (file_desc > 0)
{
int code = close(file_desc);
if (code)
throw USARTException("Fehler beim Schließen des Gerätes");
file_desc = -1;
}
}
void USART::clearInputBuffer()
{
int code = tcflush(file_desc, TCIFLUSH);
if (code)
throw USARTException("Fehler beim Leeren des Eingangspuffers");
}
void USART::clearOutputBuffer()
{
int code = tcflush(file_desc, TCOFLUSH);
if (code)
throw USARTException("Fehler beim Leeren des Ausgangspuffers");
}
void USART::flushOutputBuffer()
{
int code = tcdrain(file_desc);
if (code)
throw USARTException("Fehler beim Versenden des Ausgangspuffers");
}
void USART::transmit(uint8_t *buffer, uint16_t offset, uint8_t len)
{
int code = write(file_desc, buffer + offset, len);
if (code != len)
throw USARTException(
std::string(__FUNCTION__) + " failed: " + std::string(__FILE__) + "#" + std::to_string(__LINE__) +
", " + strerror(code) + " (code " + std::to_string(code) + " / " + std::to_string(len) + ")");
}
void USART::receive(uint8_t *buffer, uint16_t offset, uint8_t len)
{
int bytes_avail, code;
auto start = std::chrono::steady_clock::now();
auto end = std::chrono::steady_clock::now();
do
{
code = ioctl(file_desc, FIONREAD, &bytes_avail);
if (code)
throw USARTException(
std::string(__FUNCTION__) + " failed: " + std::string(__FILE__) + "#" + std::to_string(__LINE__) +
", " + strerror(code) + " (code " + std::to_string(code) + ")");
end = std::chrono::steady_clock::now();
long elapsed =
std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count() / 100; // in Dezisekunden
if (elapsed >= timeout)
throw TimeoutException(
std::string(__FUNCTION__) + " failed: " + std::string(__FILE__) + "#" + std::to_string(__LINE__) +
", " + std::to_string(elapsed) + " / " + std::to_string(timeout) + " ds");
}
while (bytes_avail < len);
code = read(file_desc, buffer + offset, len);
if (code != len)
throw USARTException(
std::string(__FUNCTION__) + " failed: " + std::string(__FILE__) + "#" + std::to_string(__LINE__) +
", " + strerror(code) + " (code " + std::to_string(code) + " / " + std::to_string(len) + ")");
}
void USART::drop(uint8_t len)
{
// Kann bestimmt noch eleganter gelöst werden
uint8_t dummy[len];
receive(&dummy[0], 0, len);
}
uint32_t USART::getBaudrate()
{
return baudrate;
}
uint8_t USART::getTimeout()
{
return timeout;
}
void USART::setBaudrate(uint32_t baudrate)
{
this->baudrate = baudrate;
}
void USART::setTimeout(uint8_t timeout)
{
this->timeout = timeout;
}

View file

@ -88,6 +88,13 @@ public:
*/
void receive(uint8_t *buffer, uint16_t offset, uint8_t len);
/**
* Receives n bytes but discards them
* \param len count of bytes to receive
* \throws USARTException
*/
void drop(uint8_t len);
/*************************************/