Rev 2949 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2949 | Rev 2959 | ||
---|---|---|---|
Line 31... | Line 31... | ||
31 | """ |
31 | """ |
32 | import sys |
32 | import sys |
33 | import os |
33 | import os |
34 | 34 | ||
35 | INPUT = sys.argv[1] |
35 | INPUT = sys.argv[1] |
- | 36 | FILE_NAME = sys.argv[2] |
|
- | 37 | VAR_NAME = sys.argv[3] |
|
36 | f = open(INPUT) |
38 | f = open(INPUT) |
37 | line_length = 8 |
39 | line_length = 8 |
38 | file_size = os.path.getsize(INPUT) |
40 | file_size = os.path.getsize(INPUT) |
39 | 41 | ||
40 | print """#include <sys/types.h>' |
42 | print """#include <sys/types.h> |
41 | 43 | ||
42 | const size_t data_size = %d; |
44 | const size_t """ + VAR_NAME + "_size = " + str(file_size) +"""; |
43 | const char data_filename[] = "/test"; |
45 | const char """ + VAR_NAME + "_filename[] = \"/" + FILE_NAME +"""\"; |
44 | const uint8_t data[] = {""" % file_size |
46 | const uint8_t """ + VAR_NAME + """[] = { |
- | 47 | """; |
|
45 | 48 | ||
46 | first_line = True |
49 | first_line = True |
47 | 50 | ||
48 | while True: |
51 | while True: |
49 | data = f.read(line_length) |
52 | data = f.read(line_length) |