#include <stdint.h>
#include <semaphore.h>
+#define OLD_POS_NUM 50
+#define MAX_DUTY 170
+#define MAX_SPEED (7*OLD_POS_NUM)
+
struct rpi_in;
struct rpi_state{
int duty; /* duty cycle of pwm */
int desired_pos; /* desired position */
+ int old_pos[OLD_POS_NUM]; /* old positions */
int desired_spd; /* desired speed */
+ int speed;
char commutate; /* zapina prepocet duty na jednotlive pwm */
char pos_reg_ena; /* position regulation enable */