Skip to content

Commit

Permalink
some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Hossein-M98 committed Feb 22, 2021
1 parent 365508c commit 29dc7a3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 9 additions & 7 deletions TDMS.c
Original file line number Diff line number Diff line change
Expand Up @@ -1041,16 +1041,18 @@ TDMS_SetGroupDataValues(TDMS_Group_t *Group,
* @param Second: Normal Second (0 to 59)
* @retval Second part of TDMS Timestamp
*/
uint64_t
int64_t
TDMS_TimeSecond(uint16_t Year, uint8_t Month, uint8_t Day,
uint8_t Hour, uint8_t Minute, uint8_t Second)
{
uint32_t DiffDay = TDMS_DateDef(Day, Month, Year);

uint64_t DiffSecond = (Hour) * 3600 +
(Minute) * 60 +
(Second) +
DiffDay * 86400ul;
uint32_t DiffDay;
int64_t DiffSecond;

DiffDay = TDMS_DateDef(Day, Month, Year);
DiffSecond = (int64_t) (DiffDay * 86400ul);
DiffSecond += (int64_t) (Hour * 3600);
DiffSecond += (int64_t) (Minute * 60);
DiffSecond += (int64_t) (Second);

return DiffSecond;
}
2 changes: 1 addition & 1 deletion TDMS.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ TDMS_SetGroupDataValues(TDMS_Group_t *Group,
* @param Second: Normal Second (0 to 59)
* @retval Second part of TDMS Timestamp
*/
uint64_t
int64_t
TDMS_TimeSecond(uint16_t Year, uint8_t Month, uint8_t Day,
uint8_t Hour, uint8_t Minute, uint8_t Second);

Expand Down

0 comments on commit 29dc7a3

Please sign in to comment.