diff --git a/quad/src/quad_app/log_data.c b/quad/src/quad_app/log_data.c index 5ca0d16a65936d6ca8211213cd9549005f9f9c1a..9448fc10d5d47ec8e32c31e364983f5a94a8c873 100644 --- a/quad/src/quad_app/log_data.c +++ b/quad/src/quad_app/log_data.c @@ -138,7 +138,7 @@ int log_data(log_t* log_struct, parameter_t* ps) { return 1; } - float* thisRow = &logArray[arrayIndex * row_size * sizeof(float)]; + float* thisRow = &logArray[arrayIndex * row_size]; int offset = 0; thisRow[offset++] = log_struct->time_stamp; thisRow[offset++] = log_struct->gam.accel_x; @@ -234,7 +234,7 @@ void format_log(int idx, log_t* log_struct, struct str* buf) { int i; buf->size = 0; - float* row = &logArray[idx * row_size * sizeof(float)];\ + float* row = &logArray[idx * row_size];\ safe_sprintf_cat(buf, "%f", row[0]); for (i = 1; i < row_size; i++) { diff --git a/quad/src/virt_quad/hw_impl_unix_global_timer.c b/quad/src/virt_quad/hw_impl_unix_global_timer.c index be752b774eb55cb17f3c481947f44b76fc2ec124..dc3513d8036b102de55d0c1d90c866ebce86534c 100644 --- a/quad/src/virt_quad/hw_impl_unix_global_timer.c +++ b/quad/src/virt_quad/hw_impl_unix_global_timer.c @@ -4,6 +4,9 @@ int unix_global_timer_reset(struct TimerDriver *self) { if (self->state == NULL) { self->state = malloc(sizeof(struct timeval)); } + struct timezone tz; + struct timeval *start = self->state; + gettimeofday(start, &tz); return 0; }