Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b83d3af commit 4594897Copy full SHA for 4594897
src/bin/servo_map.cpp
@@ -14,6 +14,7 @@
14
// along with servoarray. If not, see <http://www.gnu.org/licenses/>.
15
16
#include "servoarray/servomap.h"
17
+#include "./util.h"
18
19
#include <iostream>
20
@@ -23,6 +24,10 @@ int main(int argc, char **argv) {
23
24
auto sa = ServoArray::ServoArray(driver);
25
auto map = ServoArray::ServoMap(sa);
26
27
+ util::register_signal(SIGINT);
28
+ util::register_signal(SIGQUIT);
29
+ util::register_signal(SIGTERM);
30
+
31
while(true) {
32
std::string name;
33
std::cout << "(name) > ";
@@ -34,5 +39,7 @@ int main(int argc, char **argv) {
34
39
35
40
map[name] = rad;
36
41
std::cout << name << " -> " << map[name] << std::endl;
42
43
+ if(util::should_exit()) break;
37
44
}
38
45
0 commit comments