"quad/git@git.ece.iastate.edu:bbartels/MicroCART_17-18.git" did not exist on "ef520ac4b39a48fd8cabf4a7234d413c7175b342"
Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <err.h>
#include <stdio.h>
#include "frontend_setsetpoint.h"
#include "setpoint_common.h"
#include "frontend_common.h"
int frontend_setsetpoint(
struct backend_conn * conn,
struct frontend_setpoint_data * setpoint_data,
int mask)
{
if (conn == NULL) {
return -1;
}
char buffer[2048];
/* Set the P, I, and D */
if (mask & SET_X) {
if (snprintf(buffer, 2048,
"setsetpointx %f\n",
setpoint_data->x) >= 2048) {
errx(0, "Buffer to small to format!");
}
ucart_backendWrite(conn, buffer);
}
if (mask & SET_Y) {
if (snprintf(buffer, 2048,
"setsetpointy %f\n",
setpoint_data->y) >= 2048) {
errx(0, "Buffer to small to format!");
}
ucart_backendWrite(conn, buffer);
}
if (mask & SET_Z) {
if (snprintf(buffer, 2048,
"setsetpointz %f\n",
setpoint_data->z) >= 2048) {
errx(0, "Buffer to small to format!");
}
ucart_backendWrite(conn, buffer);
}
return 0;
}