UI thread starvation and hal pins inside M remap

More
6 months 2 weeks ago #345593 by erikfriesen
I've created a pcb fiducial detector within camView, I'll assume this is running in the qtvcp/UI thread. 

I've exported HAL pins from the camView widget so I can control this, then added manual control buttons on the UI, and linked these in the postgui_hal file.

I want to control this manual button from a remapped m code, so I've exported another hal pin to do so.  The problem is that when I set this pin from the m code, the UI/qtvcp thread is never serviced, so nothing happens.

What are some ideas or solutions here?

Please Log in to join the conversation.

More
6 months 2 weeks ago #345594 by erikfriesen
Answering this myself for the next person, it needs

import time
from interpreter import INTERP_OK, INTERP_EXECUTE_FINISH

def change_tool(self, **words):
# Perform actions
# ...

# Pause for 2 seconds, synchronized with motion
yield INTERP_EXECUTE_FINISH
time.sleep(2)

return INTERP_OK

Please Log in to join the conversation.

More
6 months 2 weeks ago #345595 by erikfriesen
I'll add to this, this mostly works, but not perfectly, so any help appreciated about the reasons.

Please Log in to join the conversation.

Time to create page: 0.090 seconds
Powered by Kunena Forum