Commit e2a39355 authored by Mall, Anon's avatar Mall, Anon
Browse files

changed to linak desk and added define for small steps

parent 7bc1bb29
USB2LIN_PATH=$(CURDIR)/usb2lin
COAP_PATH=/usr/local/include/coap
CXXFLAGS+=-fmax-errors=1
export CXXFLAGS
export USB2LIN_PATH
export COAP_PATH
all: src
......
......@@ -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 \
......
......@@ -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();
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment