Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 70c26394c9 |
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user