-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
67 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/*!**************************************************************************** | ||
* @file custom-time.c | ||
* @brief This file implements functions to convert time in milliseconds to | ||
* a human readable format to be used for logging time | ||
*******************************************************************************/ | ||
|
||
|
||
#include "custom_time.h" | ||
|
||
char tstamp[50]; | ||
int minute=0, sec=0, msec=0; | ||
|
||
/*!**************************************************************************** | ||
* @brief convert time in milliseconds to minutes, seconds and time that are human readable | ||
* @param msec time in milliseconds, got from millis() function | ||
*******************************************************************************/ | ||
void convertTimestamp(unsigned long msec) { | ||
minute = ((msec / 1000) / 60) % 60; | ||
sec = (msec / 1000) % 60; | ||
msec = msec % 1000; | ||
|
||
sprintf(tstamp, "%d:%d:%ul", minute, sec, msec); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/*!**************************************************************************** | ||
* @file custom-time.h | ||
* @brief This file defines functions needed for time conversions | ||
* for data logging | ||
*******************************************************************************/ | ||
|
||
#ifndef CUSTOM_TIME_H | ||
#define CUSTOM_TIME_H | ||
|
||
#include <Arduino.h> | ||
|
||
extern char tstamp[]; // to hold a human readable timestamp | ||
void convertTimestamp(unsigned long); | ||
|
||
#endif |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,6 @@ | |
|
||
#include <Arduino.h> | ||
|
||
char* convertTimestamp(unsigned long); | ||
|
||
void convertTimestamp(unsigned long); | ||
ma | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters