From 8ba1ba125f5b3804f2f9002e2792f943718d3377 Mon Sep 17 00:00:00 2001 From: gutmet Date: Thu, 30 Apr 2020 19:43:31 +0200 Subject: [PATCH] pm5conv timestamp --- Sports/Concept2/PM5/pm5conv.bash | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Sports/Concept2/PM5/pm5conv.bash b/Sports/Concept2/PM5/pm5conv.bash index cf23261..cf08064 100755 --- a/Sports/Concept2/PM5/pm5conv.bash +++ b/Sports/Concept2/PM5/pm5conv.bash @@ -15,6 +15,16 @@ function printNonEmpty { fi } +function printTimestamp { + timestamp="0x$1" + year="$(( ((timestamp & 0xFE000000) >> 25) + 2000 ))" + day="$(( (timestamp & 0x01F00000) >> 21 ))" + month="$(( (timestamp & 0x000F0000) >> 16 ))" + hour="$(( (timestamp & 0x0000FF00) >> 8 ))" + minute="$(( timestamp & 0x000000FF ))" + printf "Date %d-%02d-%02d %02d:%02d\n" $year $month $day $hour $minute +} + function printSplit { outputSplit="$($cmd -nopadding -fvar=offset=$1,splitNo=$2 $storage-Workout$3.layhex $storage 2> /dev/null)" status=$? @@ -37,6 +47,7 @@ function printWorkout { status=$? if [ $status -eq 0 ]; then eval "$outputHeader" + printTimestamp "$Timestamp" printNonEmpty "TotalDuration" printNonEmpty "TotalDistance" printNonEmpty "SplitSize"