MTTY Behavior on module disconnect

Topics for the Eclipse Environment
Post Reply
ecasey
Posts: 164
Joined: Sat Mar 26, 2011 9:34 pm

MTTY Behavior on module disconnect

Post by ecasey »

This is a minor gripe, but it would be nice if MTTY would shut down nicely when the USB cable is disconnected.
Under Release 2.7.0 on a MOD5282 running MTTY in WIN7, if the board powers down for any reason, MTTY gives me a modal dialog box that says
Error 22: WaitCommEvent.
The device does not recognize the command.
On selecting "OK", the box just pops back up, no matter how many times I press "OK" or "X" to close the dialog. I have to open the Task Manager and end the program to get it to go away.
I think it has always been doing this; I also only recall this happening on the MOD5282. I work on other MODs (5270, 5441x, nano) and I don't remember this behavior with them. I have 5282s on all my dev boards right now or I would test them.

If anyone knows of a work around to get MTTY to go quietly into the night, please let me know.
sblair
Posts: 162
Joined: Mon Sep 12, 2011 1:54 pm

Re: MTTY Behavior on module disconnect

Post by sblair »

It's always done that on occasion at least for me. Happens to me with 5270 and 5441x.

My solution is just always to open the Windows Task Manager and kill the process.

It's not as much a solution for getting it to go quietly into the night as it is snuffing it out with a pillow....but it gets the job done.
ecasey
Posts: 164
Joined: Sat Mar 26, 2011 9:34 pm

Re: MTTY Behavior on module disconnect

Post by ecasey »

I looked at the source code for MTTTY with a view to fixing it myself if I could find a simple and thread safe way to do it.
The best I could do without a lot of re-writing was to simply change the timeout value in the BreakDownCommPort function from 20 seconds to 2 seconds.

Now, if power is lost or USB cable is disconnected, it will exit after I click a few dialog boxes. I have attached a copy that you can put in the /nburn/pcbin file to replace the original MTTTY.exe.
...at your own risk of course.
Attachments
mttty.zip
(25.6 KiB) Downloaded 249 times
Post Reply