Skip to content

Commit e2e093b

Browse files
committed
m1n1.hw.asc: Add .work_pending() and .has_messages()
Signed-off-by: Hector Martin <[email protected]>
1 parent 0b509da commit e2e093b

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

proxyclient/m1n1/hw/asc.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ def add_ep(self, idx, ep):
8787
self.epmap[idx] = ep
8888
setattr(self, ep.SHORT, ep)
8989

90+
def has_messages(self):
91+
return not self.asc.OUTBOX_CTRL.reg.EMPTY
92+
93+
def work_pending(self):
94+
while self.has_messages():
95+
self.work()
96+
9097
def work(self):
9198
if self.asc.OUTBOX_CTRL.reg.EMPTY:
9299
return True

0 commit comments

Comments
 (0)