From eee7b9f956d70cdb45eaf3e0f3d1473e2e7009de Mon Sep 17 00:00:00 2001 From: Roy Date: Fri, 21 Apr 2023 14:09:37 +0800 Subject: [PATCH] Other feat: new update elite version code --- .../cc26xx/app/headstage/Elite_version.h | 21 +++++------- .../cc26xx/app/python/update_elite_version.py | 33 +++++++++++++++++++ 2 files changed, 41 insertions(+), 13 deletions(-) create mode 100644 simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/python/update_elite_version.py diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h index b2d2504..c2bdb4b 100644 --- a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h @@ -1,15 +1,10 @@ +#ifndef VERSION_DATE +#define VERSION_DATE -#ifndef VERSION_DATE -#define VERSION_DATE - -#define VERSION_DATE_YEAR 23 -#define VERSION_DATE_MONTH 4 -#define VERSION_DATE_DAY 12 -#define VERSION_DATE_HOUR 14 -#define VERSION_DATE_MINUTE 14 - -// this is NOT the version hash !! -// it's the last version hash -#define VERSION_HASH 8808490caa465cc94d14896de28763a5e5c4672b -#define VERSION_GIT_BRANCH Elite_OBJ_0.2mv +#define VERSION_DATE_YEAR 23 +#define VERSION_DATE_MONTH 4 +#define VERSION_DATE_DAY 21 +#define VERSION_DATE_HOUR 14 +#define VERSION_DATE_MINUTE 9 #endif + diff --git a/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/python/update_elite_version.py b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/python/update_elite_version.py new file mode 100644 index 0000000..4c21f95 --- /dev/null +++ b/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/python/update_elite_version.py @@ -0,0 +1,33 @@ +# $python .\simplelink\ble_sdk_2_02_02_25\src\examples\simple_peripheral\cc26xx\app\python\update_elite_version.py + +import datetime +import os + +print(datetime.datetime.now()) +# print(datetime.datetime.now().year) +# print(datetime.datetime.now().month) +# print(datetime.datetime.now().day) +# print(datetime.datetime.now().hour) +# print(datetime.datetime.now().minute) +# print(datetime.datetime.now().strftime("%H:%M:%S")) + +y = datetime.datetime.now().year % 100 +m = datetime.datetime.now().month +d = datetime.datetime.now().day +hour = datetime.datetime.now().hour +minute = datetime.datetime.now().minute + +path = os.getcwd() +path += '/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h' +print('save:', path) + +with open(path, 'w') as f: + f.write('#ifndef VERSION_DATE\t\t' + '\n') + f.write('#define VERSION_DATE\t\t' + '\n\n') + f.write('#define VERSION_DATE_YEAR\t\t' + str(y) + '\n') + f.write('#define VERSION_DATE_MONTH\t\t' + str(m) + '\n') + f.write('#define VERSION_DATE_DAY\t\t' + str(d) + '\n') + f.write('#define VERSION_DATE_HOUR\t\t' + str(hour) + '\n') + f.write('#define VERSION_DATE_MINUTE\t\t' + str(minute) + '\n') + + f.write('#endif' + '\n\n') \ No newline at end of file