-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuildInfoSetup.c
52 lines (40 loc) · 1.16 KB
/
buildInfoSetup.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include "LPC214x.h"
#include "main.h"
#include "buildInfoSetup.h"
struct BUILD_INFO buildInfo;
void generateConfigurationByDefines(void);
/*
* MODIFY THIS FUNCTION TO INCLUDE ALL IMPORTANT DEFINES OF A PROJECT
*/
void generateBuildInfo()
{
char months[12][3]={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dez"};
char dateStr[11]=__DATE__;
int m,d,y;
int i,z;
m=1;
for (z=0;z<11;z++)
{
int cnt=0;
for (i=0;i<3;i++)
if (months[z][i]==dateStr[i])
cnt++;
if (cnt==3)
{
m=z+1;
break;
}
}
for (z=0;z<11;z++)
if (dateStr[z]<48)
dateStr[z]=48;
d=(dateStr[4]-48)*10+(dateStr[5]-48);
y=(dateStr[7]-48)*1000+(dateStr[8]-48)*100+(dateStr[9]-48)*10+(dateStr[10]-48);
buildInfo.build_date=y+m*10000+d*1000000;
buildInfo.configuration=__BUILD_CONFIG;
buildInfo.build_number=0;
buildInfo.svn_modified=0;
buildInfo.svn_revision=0;
buildInfo.version_major=__VERSION_MAJOR;
buildInfo.version_minor=__VERSION_MINOR;
}