Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Geithner, Thomas
desk-control
Commits
e2a39355
Commit
e2a39355
authored
Oct 09, 2017
by
Mall, Anon
Browse files
changed to linak desk and added define for small steps
parent
7bc1bb29
Changes
4
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
e2a39355
USB2LIN_PATH
=
$(CURDIR)
/usb2lin
COAP_PATH
=
/usr/local/include/coap
CXXFLAGS
+=
-fmax-errors
=
1
export
CXXFLAGS
export
USB2LIN_PATH
export
COAP_PATH
all
:
src
...
...
src/Makefile
View file @
e2a39355
...
...
@@ -8,6 +8,10 @@ LDLIBS+=-lavahi-client -lavahi-common
override
CXXFLAGS
+=
-I
$(USB2LIN_PATH)
LDLIBS
+=
-lusb-1
.0
#COAP
override
CXXFLAGS
+=
-I
$(COAP_PATH)
-L
/usr/local/lib
LDLIBS
+=
-lcoap-1
OBJS
=
\
desk-controller.o
\
desk-frontend.o
\
...
...
src/desk-controller.cpp
View file @
e2a39355
...
...
@@ -18,6 +18,7 @@ using namespace usb2lin06;
#define MIN_HEIGHT 0
#define MAX_HEIGHT 52
#define STOP_DELAY 2
#define SMALL_STEP_TIME 220
Controller
::
Controller
(
std
::
string
offset_file
)
:
m_offsetFile
(
offset_file
),
...
...
@@ -241,6 +242,7 @@ LinakDesk::doDeskControl(void)
try
{
target_height
=
m_queue
.
getMessage
(
chrono
::
seconds
(
1
));
cout
<<
__func__
<<
": target_height: "
<<
target_height
<<
endl
;
m_finished
=
false
;
}
catch
(
TimeoutException
&
e
)
...
...
@@ -268,7 +270,7 @@ LinakDesk::doDeskControl(void)
{
cout
<<
"small step up... "
<<
endl
;
int
step
=
m_targetHeight
-
m_currentHeight
;
for
(
int
i
=
0
;
i
<
(
step
*
250
);
i
++
)
for
(
int
i
=
0
;
i
<
(
step
*
SMALL_STEP_TIME
);
i
++
)
move
(
Command
::
up
);
lck
.
lock
();
m_currentHeight
=
getInternalHeight
();
...
...
@@ -280,7 +282,7 @@ LinakDesk::doDeskControl(void)
{
cout
<<
"small step down... "
<<
endl
;
int
step
=
m_currentHeight
-
m_targetHeight
;
for
(
int
i
=
0
;
i
<
(
step
*
250
);
i
++
)
for
(
int
i
=
0
;
i
<
(
step
*
SMALL_STEP_TIME
);
i
++
)
move
(
Command
::
down
);
unique_lock
<
mutex
>
lck
(
m_cmdMutex
);
m_currentHeight
=
getInternalHeight
();
...
...
src/desk-main.cpp
View file @
e2a39355
...
...
@@ -16,8 +16,8 @@ using namespace desk;
int
main
(
int
rgc
,
char
**
argv
){
//Controller c;
DummyDesk
c
;
//
LinakDesk c;
//
DummyDesk c;
LinakDesk
c
;
CmdFrontend
cf
(
c
);
CoapFrontend
cof
(
c
,
5678
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment