Skip to content

Commit

Permalink
display timestamp in seconds.ms in output
Browse files Browse the repository at this point in the history
  • Loading branch information
iltis42 committed Jun 2, 2024
1 parent b2ad0d7 commit e71c9b3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions main/sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,6 @@ void readSensors(void *pvParameters){
_millis=millis();
struct timeval tv;
gettimeofday(&tv, NULL);
struct tm* local = localtime( &tv.tv_sec );
// ESP_LOGI(FNAME,"AS");
xSemaphoreTake(xMutex,portMAX_DELAY ); // Static Pressure
bool bok=false;
Expand All @@ -612,7 +611,7 @@ void readSensors(void *pvParameters){
long int delta = _millis - _gps_millis;
if( delta < 0 )
delta += 1000;
sprintf( log+pos, "%02d%02d%02d.%03d,%ld,%.3f,%.3f,%.3f,%.2f,%.4f,%.4f,%.4f,%.4f,%.4f,%.4f", local->tm_hour, local->tm_min, local->tm_sec, (int)(tv.tv_usec / 1000), delta, bp, tp, dynamicP, T, IMU::getGliderAccelX(), IMU::getGliderAccelY(), IMU::getGliderAccelZ(),
sprintf( log+pos, "%d.%03d,%ld,%.3f,%.3f,%.3f,%.2f,%.4f,%.4f,%.4f,%.4f,%.4f,%.4f", (int)(tv.tv_sec%(60*60*24)), (int)(tv.tv_usec / 1000), delta, bp, tp, dynamicP, T, IMU::getGliderAccelX(), IMU::getGliderAccelY(), IMU::getGliderAccelZ(),
IMU::getGliderNogateGyroX(), IMU::getGliderNogateGyroY(), IMU::getGliderNogateGyroZ() );
if( compass ){
pos=strlen(log);
Expand Down

0 comments on commit e71c9b3

Please sign in to comment.