-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
66 lines (59 loc) · 1.41 KB
/
main.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
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* File: main.c
* Author: Гусенков С.В
*
* Created on 8 декабря 2015 г., 15:55
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "struct_code.h"
#include "gstruct.h"
#include <time.h>
#define GPS_version "V0.2 Beta"
/*
*
*/
void DelRash(char *out, char* in)
{
int i;
for(i=0; i<strlen(in);i++)
{
if(in[i]=='.')
{
out[i]=0;
break;
}
out[i]=in[i];
}
}
int main(int argc, char** argv) {
if(argc==2)
{
char filen[200];
FILE* fl = fopen(argv[1],"r");
struct OporaDataStruct ors;
fread(&ors,sizeof(ors),1,fl);
//printf("%d",ors.Er1.el1.ExampleParamet);
DelRash(filen,argv[1]);
GenerateC_Gpio_File(ors,filen);
DelRash(filen,argv[1]);
GenerateC_CLK_File(ors, filen);
DelRash(filen,argv[1]);
GenerateC_SSP_File(ors, filen);
DelRash(filen,argv[1]);
GenerateC_PVDCS_File(ors, filen);
DelRash(filen,argv[1]);
GenerateHeader_GPIO_File(ors,filen);
DelRash(filen,argv[1]);
GenerateHeader_CLK_File(ors, filen);
DelRash(filen,argv[1]);
GenerateHeader_SSP_File(ors, filen);
DelRash(filen,argv[1]);
GenerateHeader_PVDCS_File(ors, filen);
fclose(fl);
}
// printf(argv[0]);
//printf("%d",argc);
return 0;
}