Skip to content
Snippets Groups Projects
Commit e01d9b94 authored by GroundStation's avatar GroundStation
Browse files

Fixed things to work with the groundstation computer

- Changed C standard
- Changed wpedantic to pedantic
- Deleted some unused code that used nonexistent time functions
- Fixed a bug with VRPN
parent 6519d941
No related branches found
No related tags found
No related merge requests found
......@@ -3,8 +3,8 @@
# Generic Variables
GCC=gcc
GXX=g++
CFLAGS= -Wall -Wpedantic -Wextra -Werror -std=gnu11 -g -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-but-set-variable
CXXFLAGS= -Wall -Wpedantic -Wextra -Werror -Wno-reorder -Wno-unused-variable -std=c++0x -g
CFLAGS= -Wall -pedantic -Wextra -Werror -std=gnu99 -g -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-but-set-variable
CXXFLAGS= -Wall -pedantic -Wextra -Werror -Wno-reorder -Wno-unused-variable -std=c++0x -g
INCLUDES = $(foreach dir, $(INCDIR), -I$(dir))
INCDIR=inc src/vrpn src/vrpn/quat src/vrpn/build $(BESRCDIR) $(CLISRCDIR) $(FESRCDIR)
LIBS= -lpthread -lbluetooth -lvrpn -lquat -Lsrc/vrpn/build -Lsrc/vrpn/build/quat
......
......@@ -638,7 +638,7 @@ static void client_recv(int fd) {
if (tracker == NULL) {
char * dummy = TD_MAGIC " 1.0 2.0 3.0 4.0 5.0 6.0\n";
write(fd, dummy, strlen(dummy));
}else if (ucart_vrpn_tracker_getData(tracker, &td)) {
}else if (!ucart_vrpn_tracker_getData(tracker, &td)) {
write(fd, TD_MAGIC " ERROR\n", strlen(TD_MAGIC " ERROR\n"));
} else {
/* more than sufficient buffer */
......
......@@ -10,8 +10,6 @@
#include "cli_monitor.h"
#include "frontend_tracker.h"
static void timespec_diff(struct timespec *start, struct timespec *result);
int cli_monitor(struct backend_conn * conn, int argc, char **argv) {
int c, result;
int countFlag = 0;
......@@ -98,18 +96,3 @@ int monitor(struct backend_conn * conn) {
return 0;
}
static void timespec_diff(struct timespec *start, struct timespec *result)
{
struct timespec stop;
clock_gettime(CLOCK_REALTIME, &stop);
if ((stop.tv_nsec - start->tv_nsec) < 0) {
result->tv_sec = stop.tv_sec - start->tv_sec - 1;
result->tv_nsec = stop.tv_nsec - start->tv_nsec + 1000000000;
} else {
result->tv_sec = stop.tv_sec - start->tv_sec;
result->tv_nsec = stop.tv_nsec - start->tv_nsec;
}
return;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment