Skip to content
Snippets Groups Projects
Commit 316ebf04 authored by bertucci's avatar bertucci
Browse files

The work continues

parent 1c0ddf70
No related branches found
No related tags found
No related merge requests found
...@@ -410,7 +410,7 @@ void RTprintLogging(struct CommDriver *comm, log_t* log_struct, parameter_t* ps, ...@@ -410,7 +410,7 @@ void RTprintLogging(struct CommDriver *comm, log_t* log_struct, parameter_t* ps,
timer_axi_reset(); timer_axi_reset();
} }
void RTprintend(); void RTprintend()
{ {
if (arrayIndex == 0) if (arrayIndex == 0)
{ {
...@@ -524,3 +524,25 @@ void format_log(int idx, log_t* log_struct, struct str* buf) { ...@@ -524,3 +524,25 @@ void format_log(int idx, log_t* log_struct, struct str* buf) {
} }
safe_sprintf_cat(buf, "\n"); safe_sprintf_cat(buf, "\n");
} }
/*
Initially sets it so that all debug values are zero
*/
void initializeFlags(SensorRTFlags_t * flags) {
flags = calloc(1, sizeof(SensorRTFlags_t));
flags -> imuflags = calloc(1, sizeof(IMUFlags_t));
flags -> optflowflags = calloc(1, sizeof(OptFlowFlags_t));
flags -> lidarflags = calloc(1, sizeof(lidarFlags_t));
flags -> errorflags = calloc(1, sizeof(SensorErrorFlags_t));
flags -> flag_count = 0;
}
void freeFlags(SensorRTFlags_t * flags){
free(flags -> imuflags);
free(flags -> optflowflags);
free(flags -> lidarflags);
free(flags -> errorflags);
free(flags -> flag_count);
free(flags);
}
...@@ -121,3 +121,11 @@ void pack_short(int16_t val, u8* buff) { ...@@ -121,3 +121,11 @@ void pack_short(int16_t val, u8* buff) {
void pack_float(float val, u8* buff) { void pack_float(float val, u8* buff) {
memcpy(buff, &val, sizeof(val)); memcpy(buff, &val, sizeof(val));
} }
/*
Helper to return single bit of u32 data. This returns the "position"'th bit of the given u32,
assuming it is Zero indexed.
*/
u32 read_bit(u32 data, int position) {
return (data >> position) & 1;
}
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