Skip to content

Commit 0c3fda0

Browse files
author
Arbin Timilsina
committed
Optimization
1 parent ba84c01 commit 0c3fda0

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

femb_python/test_measurements/quadEpcsTester/testQuadEPCS.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def __init__(self, datadir="data", outlabel="OscillatorTesting"):
1414

1515
self.nFlashes = 4
1616
self.nPages = 10
17-
self.nTriesWrite = 5
17+
self.nTriesWrite = 3
1818
self.printData = False
1919

2020
def doTesting(self):
@@ -38,14 +38,14 @@ def doTesting(self):
3838
self.femb_config.eraseFlash(iFlash)
3939
boardStatus = self.femb_config.readStatus(iFlash)
4040
iTries = 1
41-
while(boardStatus != 0 and iTries <= 5):
41+
while(boardStatus != 0 and iTries <= 3):
4242
iTries +=1
4343
print("Error!! Status after erasing is bad. Trying again. Try no. %s" %(iTries))
4444
self.femb_config.eraseFlash(iFlash)
4545
boardStatus = self.femb_config.readStatus(iFlash)
4646
eraseTried[iFlash] = iTries
4747

48-
if(iTries > 5):
48+
if(iTries > 3):
4949
print("Flash %s has a problem. Will skip this flash!\n" %(iFlash))
5050
flashToSkip[iFlash] = True
5151

@@ -84,7 +84,7 @@ def doTesting(self):
8484

8585
isMatch = set(inputData) == set(outputData)
8686
iTries = 1
87-
while (not isMatch and iTries < self.nTriesWrite):
87+
while (not isMatch and iTries <= self.nTriesWrite):
8888
iTries += 1
8989
print("*" * 75)
9090
print("Input and output data don't match, trying again!\nTry no. %s" %(iTries))
@@ -121,13 +121,13 @@ def doTesting(self):
121121

122122
flashSuccess = [False]*self.nFlashes
123123
print("\nInfo on Write: ")
124-
print("Note: Will print no. of write tries if > 1 for a page")
124+
print("Note: Will print no. of write tries if > 1 for first 5 page.\nNote: Failing on 9999999 pages means failed to erase and skipped.")
125125
for iFlash in range(self.nFlashes):
126126
if(failedPages[iFlash] == 0):
127127
flashSuccess[iFlash] = True
128128
print("\nFlash %s passed!!" %(iFlash))
129129
for iPage in range(self.nPages):
130-
if(programTried[iFlash][iPage] > 1):
130+
if(programTried[iFlash][iPage] > 1 and iPage < 5):
131131
print("No. of program tries for page %s is %s" %(iPage, programTried[iFlash][iPage]))
132132
else:
133133
print("\nFlash %s failed!!" %(iFlash))

0 commit comments

Comments
 (0)