UI thread starvation and hal pins inside M remap

More
16 Apr 2026 13:11 #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 or Create an account to join the conversation.

More
16 Apr 2026 13:21 #345594 by erikfriesen
Replied by erikfriesen on topic UI thread starvation and hal pins inside M remap
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
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

More
16 Apr 2026 13:33 #345595 by erikfriesen
Replied by erikfriesen on topic UI thread starvation and hal pins inside M remap
I'll add to this, this mostly works, but not perfectly, so any help appreciated about the reasons.

Please Log in or Create an account to join the conversation.

Moderators: cmorley
Time to create page: 0.119 seconds
Powered by Kunena Forum