32 static uint32_t ticks = 0;
36 ticks = HAL_GetTick();
71 static uint32_t ticks = 0;
74 static float stable_pos = 0;
75 static float required_pos = 0;
85 ticks = HAL_GetTick();
96 *p_set_pos = stable_pos;
123 else if ((HAL_GetTick() > ticks))
141 required_pos = stable_pos;
166 required_pos = *p_set_pos;
185 static uint32_t ticks = 0;
207 if (HAL_GetTick() > ticks)
259 *p_ticks += HAL_GetTick();
280static void regul_return(uint32_t * p_reg, uint32_t * p_ticks,
float set_pos)
287 *p_ticks = HAL_GetTick();
settings_t set_data
Main system settings.
sensor_data_t measured_data
Current sensor measured data.
void valve_fcn(uint32_t *p_reg, float *p_set_pos)
It handles the execution of motion commands.
void autoread_fcn(uint32_t reg)
It handles the periodic transmission of the sensor data message.
#define STOP_CONST_OFF_LEFT
void regul_fcn(uint32_t *p_reg, float set_pos)
It handles the regulation of the orientation.
#define STOP_CONST_OFF_RIGHT
void sensor_deg_limit(float *p_deg)
It normalizes the orientation value to the –180° to +180° range.
static void valve_close(void)
static void regul_stop(uint32_t *p_reg, uint32_t *p_ticks)
static void regul_return(uint32_t *p_reg, uint32_t *p_ticks, float set_pos)
: Header for main.c file. This file contains the common defines of the application.
#define _read_BV(reg, bit)
#define _read_time_l(reg)
#define _float2int(data_fl)
#define _read_time_r(reg)
#define VALVE_R_GPIO_Port
#define _tog_BV(reg, bit)
#define _clr_BV(reg, bit)
#define _set_time(reg, time_l, time_r)
#define VALVE_L_GPIO_Port
#define _set_BV(reg, bit)
float pos[3]
Orientation X, Y, Z [deg]; related to initial position.
float gyr[3]
Gyroscope X, Y, Z [dps].
float acc[3]
Accelerometer X, Y, Z [g].
uint8_t time_r
Time [10*ms], right valve is open.
uint8_t angle
Angle [deg], cube rotate after turn cmd.
int16_t home
Angle [deg], default orientation.
uint8_t time_l
Time [10*ms], left valve is open.
uint8_t time_a
Period [100*ms], sensor report will be sended.