Skip to content

Commit d2d0b81

Browse files
committed
Added check for I2C read loops without resetting results pointer
1 parent d00b66f commit d2d0b81

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

projects/test_marble_family/i2c/demo_i2c_baddy.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,18 @@ def violation7():
107107
return
108108

109109

110+
def violation8():
111+
print("{:-^80s}".format(" Violation 8. Loop reads missing set_resx "))
112+
m = marble_i2c.MarbleI2C()
113+
# m.set_resx()
114+
m.read("U34", 0, 1)
115+
m.buffer_flip()
116+
m.pause(4096) # Pause for roughly 0.24ms
117+
m.jump(0) # Jump back to loop start
118+
m.check_program()
119+
return
120+
121+
110122
def doViolations(argv):
111123
if len(argv) > 1:
112124
vMask = _int(argv[1])
@@ -120,6 +132,7 @@ def doViolations(argv):
120132
violation5,
121133
violation6,
122134
violation7,
135+
violation8,
123136
)
124137
exceptions = [False]*len(violations)
125138
for n in range(len(violations)):

0 commit comments

Comments
 (0)