| Open Projects | oLogic - Oscilloscope Logic Viewer oLogic 1.4 - NEW Logic Viewer SSX32 - Serial Servo Driver
|
|
Build Hex filename, embedded version, and time stampI did this code because a client wanted to have the compile date in the .hex file names.
At the same time, I needed to have a time stamp embedded in the controller, so I knew what release was running.
Here is a solution for both!
In your code, if you read the string (stored in ROM) _build[], you will have the time and date of compile.
19 bytes of ROM are used to store the build date and time
_build[] string format: "31-Aug-09 23:55:18" | | Driver Specs | | mcu: | PIC12,16,18 | | compiler: | CCS C |
| |
Here is an example of using the driver with a single +5v source and any pins you want from a pic.
| Example Usage |
/vhost/mculabs/driver_db/_build/files/ex1.h
1
2 // optional, these control the hex file name
3 #define _BUILD_PROJECT "Prj_Name"
4 #define _BUILD_VERSION "v1.0"
5
6 #include "_build.c"
7
|
And here is the complete source file.
| _build.c |
/vhost/mculabs/driver_db/_build/files/_build.c
1 /*
2 file: _build.c
3 project: standard include
4 description: Use for tracking build date and time and setting
5 the output hex file name
6 written by : Michael Bradley
7
8 Changelog:
9 08/31/09 This module created
10
11
12 USE:
13 // optional, these control the hex file name
14 #define _BUILD_PROJECT "Prj_Name"
15 #define _BUILD_VERSION "v1.0"
16
17 #include "_build.c"
18
19 REFERENCE:
20 19 bytes of ROM are used to store the build date and time
21 _build[] string format: "31-Aug-09 23:55:18"
22
23 */
24
25
26 const char _build[19] = {__DATE__ " " __TIME__};
27
28 #ifdef _BUILD_PROJECT
29 #define _BUILD_FILE _BUILD_PROJECT "-" _BUILD_VERSION "-" __DATE__ ".hex"
30 #export (file=_BUILD_FILE, HEX)
31 #endif
32
33
|
|