Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 70c26394c9 | |||
| 4aa6634f1e |
@@ -182,50 +182,50 @@ class MultiExtMemSpiInterface(LowLevelHardwareInterface):
|
||||
|
||||
|
||||
# -------------------------------------read one times-------------------------------------------
|
||||
data = []
|
||||
flag_print = False
|
||||
|
||||
data = self._spi.send_byte(tx_h)
|
||||
|
||||
if (data[0] != 255 or data[1] != 255 or data[2] != 255):
|
||||
self._head_wrong_cnt[device] = self._head_wrong_cnt[device] + 1
|
||||
if (self._head_wrong_cnt[device] <= 5): # print 5 times
|
||||
print('data_first[0:3] != [255, 255, 255], device:', device, ',', self._head_wrong_cnt[device], 'times')
|
||||
print(list(data[0:7]))
|
||||
|
||||
data[0:3] = [255, 255, 255]
|
||||
# ----------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
# -------------------------------------read two times-------------------------------------------
|
||||
# data = []
|
||||
# data_first = []
|
||||
# data_second = []
|
||||
# flag_print = False
|
||||
|
||||
# data_first = self._spi.send_byte(tx_h)
|
||||
# data_second = self._spi.send_byte(tx_h)
|
||||
# data = self._spi.send_byte(tx_h)
|
||||
|
||||
# if (data_first[0] != 255 or data_first[1] != 255 or data_first[2] != 255):
|
||||
# if (data[0] != 255 or data[1] != 255 or data[2] != 255):
|
||||
# self._head_wrong_cnt[device] = self._head_wrong_cnt[device] + 1
|
||||
# if (self._head_wrong_cnt[device] < 10):
|
||||
# if (self._head_wrong_cnt[device] <= 5): # print 5 times
|
||||
# print('data_first[0:3] != [255, 255, 255], device:', device, ',', self._head_wrong_cnt[device], 'times')
|
||||
# print(list(data_first[0:7]))
|
||||
# print(list(data[0:7]))
|
||||
|
||||
# if (data_second[0] != 255 or data_second[1] != 255 or data_second[2] != 255):
|
||||
# self._head_wrong_cnt[device] = self._head_wrong_cnt[device] + 1
|
||||
# if (self._head_wrong_cnt[device] < 10):
|
||||
# print('data_first[0:3] != [255, 255, 255], device:', device, ',', self._head_wrong_cnt[device], 'times')
|
||||
# print(list(data_second[0:7]))
|
||||
# data[0:3] = [255, 255, 255]
|
||||
# ----------------------------------------------------------------------------------------------
|
||||
|
||||
# if (data_first[3:] == data_second[3:]):
|
||||
# data = data_first
|
||||
# data[0:3] = [255, 255, 255]
|
||||
# check comment: tail -f ~/xxx.out | grep -e "data_first" -e "data_second" -e "\[0, 0, 0, 0, 0, 0, 0\]"
|
||||
# -------------------------------------read two times-------------------------------------------
|
||||
data = []
|
||||
data_first = []
|
||||
data_second = []
|
||||
flag_print = False
|
||||
|
||||
# else:
|
||||
# data_third = self._spi.send_byte(tx_h)
|
||||
# print("read data_third", data_third)
|
||||
# data = self.compare_green_data(data_first, data_second, data_third, len(tx_h))
|
||||
data_first = self._spi.send_byte(tx_h)
|
||||
data_second = self._spi.send_byte(tx_h)
|
||||
|
||||
if (data_first[0] != 255 or data_first[1] != 255 or data_first[2] != 255):
|
||||
self._head_wrong_cnt[device] = self._head_wrong_cnt[device] + 1
|
||||
if (self._head_wrong_cnt[device] < 10):
|
||||
print('data_first[0:3] != [255, 255, 255], device:', device, ',', self._head_wrong_cnt[device], 'times')
|
||||
print(list(data_first[0:7]))
|
||||
|
||||
if (data_second[0] != 255 or data_second[1] != 255 or data_second[2] != 255):
|
||||
self._head_wrong_cnt[device] = self._head_wrong_cnt[device] + 1
|
||||
if (self._head_wrong_cnt[device] < 10):
|
||||
print('data_second[0:3] != [255, 255, 255], device:', device, ',', self._head_wrong_cnt[device], 'times')
|
||||
print(list(data_second[0:7]))
|
||||
|
||||
if (data_first[3:] == data_second[3:]):
|
||||
data = data_first
|
||||
data[0:3] = [255, 255, 255]
|
||||
|
||||
else:
|
||||
data_third = self._spi.send_byte(tx_h)
|
||||
print("read data_third", data_third)
|
||||
data = self.compare_green_data(data_first, data_second, data_third, len(tx_h))
|
||||
# ----------------------------------------------------------------------------------------------
|
||||
|
||||
# debug use
|
||||
|
||||
@@ -363,13 +363,13 @@ class RecordingProcess(Process):
|
||||
if (device == 7):
|
||||
print('self._last_cnt[7]:', self._last_cnt[7], ', last_data_cnt:', last_data_cnt)
|
||||
|
||||
print('skip RAM, but data is right, solve data', list(raw_data[i]), 'skip Ram', self._skip_ram_cnt, 'times')
|
||||
print('data:')
|
||||
print('|', list(raw_data[0]))
|
||||
print('|', list(raw_data[1]))
|
||||
print('| ... ... ...')
|
||||
print('| ... ... ...')
|
||||
print('|', list(raw_data[colum_total-1]))
|
||||
print('skip RAM, but data is right, solve data', list(raw_data[i][0:3]), 'skip Ram', self._skip_ram_cnt, 'times')
|
||||
# print('data:')
|
||||
# print('|', list(raw_data[0]))
|
||||
# print('|', list(raw_data[1]))
|
||||
# print('| ... ... ...')
|
||||
# print('| ... ... ...')
|
||||
# print('|', list(raw_data[colum_total-1]))
|
||||
print()
|
||||
|
||||
if (device == 4):
|
||||
|
||||
Reference in New Issue
Block a user