| 92 | fout.write(";\n") |
| 93 | |
| 94 | def write_array(self, fout, frame_index): |
| 95 | fout.write("{\n\t") |
| 96 | for i, value in enumerate(self.frames[frame_index]): |
| 97 | if i: |
| 98 | fout.write(",") |
| 99 | if i % 8 == 0: |
| 100 | fout.write("\n\t") |
| 101 | else: |
| 102 | fout.write(" ") |
| 103 | if self.hex_format and "int" in self.data_format: |
| 104 | if self.data_format == "int8": |
| 105 | value = ctypes.c_int8(int(value, 16)).value |
| 106 | elif self.data_format == "int16": |
| 107 | value = ctypes.c_int16(int(value, 16)).value |
| 108 | elif self.data_format == "int32": |
| 109 | value = ctypes.c_int32(int(value, 16)).value |
| 110 | elif self.data_format == "int64": |
| 111 | value = ctypes.c_int64(int(value, 16)).value |
| 112 | value = str(value) |
| 113 | fout.write('{:>4}'.format(value)) |
| 114 | fout.write("\n}") |
| 115 | |
| 116 | def get_c_type(self): |
| 117 | if self.data_format == "int8": |