git.droids-corp.org
/
aversive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
revert test serpi
[aversive.git]
/
projects
/
microb2010
/
tests
/
hostsim
/
robotsim.c
diff --git
a/projects/microb2010/tests/hostsim/robotsim.c
b/projects/microb2010/tests/hostsim/robotsim.c
index
7ed49f4
..
9303a85
100644
(file)
--- a/
projects/microb2010/tests/hostsim/robotsim.c
+++ b/
projects/microb2010/tests/hostsim/robotsim.c
@@
-22,8
+22,9
@@
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
-#include <
sys/types
.h>
+#include <
unistd
.h>
#include <sys/stat.h>
#include <sys/stat.h>
+#include <sys/types.h>
#include <fcntl.h>
#include <aversive.h>
#include <fcntl.h>
#include <aversive.h>
@@
-72,11
+73,13
@@
void robotsim_dump(void)
char buf[BUFSIZ];
int len;
char buf[BUFSIZ];
int len;
- len =snprintf(buf, sizeof(buf), "%d %d %d\n",
+ len =
snprintf(buf, sizeof(buf), "%d %d %d\n",
position_get_x_s16(&mainboard.pos),
position_get_y_s16(&mainboard.pos),
position_get_a_deg_s16(&mainboard.pos));
position_get_x_s16(&mainboard.pos),
position_get_y_s16(&mainboard.pos),
position_get_a_deg_s16(&mainboard.pos));
+ hostsim_lock();
write(fd, buf, len);
write(fd, buf, len);
+ hostsim_unlock();
}
void robotsim_pwm(void *arg, int32_t val)
}
void robotsim_pwm(void *arg, int32_t val)