Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 10:36 01 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PicoMite strange bahaviour

Author Message
wolfme
Newbie

Joined: 26/10/2021
Location: Germany
Posts: 31
Posted: 02:55pm 15 Dec 2021
Copy link to clipboard 
Print this post

Hi,

i found strange behaviour of my picomite (with V5.07.01) when changing ctrl-c to my own exit routine.

after executing

Option Break 4
On Key 3, my_exit()

For r=1 To 1000
 Print r
 Pause (1000)
Next r

Sub my_exit()
 Option Break 3
 Print "Bye..."
 End
End Sub


i cannot do xmodem transfers until i reset my picomite.
What's wrong? Do i miss something?

Wolfgang
Edited 2021-12-16 00:57 by wolfme
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10310
Posted: 03:25pm 15 Dec 2021
Copy link to clipboard 
Print this post

It is a sort of a bug but sort of you not tidying up fully - thanks for the diagnostic. The workaround is to include

ON KEY 3,0

in my_exit
Edited 2021-12-16 01:26 by matherp
 
wolfme
Newbie

Joined: 26/10/2021
Location: Germany
Posts: 31
Posted: 03:35pm 15 Dec 2021
Copy link to clipboard 
Print this post

  matherp said  It is a sort of a bug but sort of you not tidying up fully - thanks for the diagnostic. The workaround is to include

ON KEY 3,0

in my_exit


yes, this did the trick...  
many thanks!

Wolfgang
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 03:41pm 15 Dec 2021
Copy link to clipboard 
Print this post

Peter,

I had made a note to query you about this with regards implementation in MMB4L. In your opinion should OPTION BREAK be reset to 3:

- Only on NEW/RUN/LOAD ?
- On program END, either implicit or explicit ?
- On uncaught ERROR ?
- Something else ?

Best wishes,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10310
Posted: 03:57pm 15 Dec 2021
Copy link to clipboard 
Print this post

  Quote  I had made a note to query you about this with regards implementation in MMB4L.


In general I've just copied direct from Geoff's code

There is a big conceptual issue here

As standard MMBasic tidies up when you issue a RUN command. So after exiting a program all the stuff like variables are available for inspection. On the CMM2 there is so much going on that I implemented a subroutine that is called on any exit to tidy up everything except variables.

The issue found by Wolfgang was that the key interrupt was still active and that was "b.....ing" xmodem which unlike everything else deals with non-ascii characters.

The classic example of this issue is with GUI controls that still sort of respond after the program is stopped with ctrl-C

No easy answer I'm afraid
 
wolfme
Newbie

Joined: 26/10/2021
Location: Germany
Posts: 31
Posted: 04:23pm 15 Dec 2021
Copy link to clipboard 
Print this post

  matherp said  
No easy answer I'm afraid


For me it's absolute ok.
I've put this to my teraterm xmodem transfer macro before xmodem starts
So easy going...

Wolfgang
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 04:44pm 15 Dec 2021
Copy link to clipboard 
Print this post

  matherp said  There is a big conceptual issue here...


Yes, I now remember I saw this with SETTICK interrupts still being fired after a program had exited to the BASIC prompt and ended up temporarily (?) patching over the issue by clearing all interrupts. I made a mental note that probably they should actually be "suspended" so they could be restored if the user chose to CONTINUE ... but given the existing limitations on the use of CONTINUE I wasn't sure how useful that would be. You'd also need to give special consideration as to how to handle missed SETTICK interrupts and whether to "backdate" the TIMER to when the program exited.

As you say, "No easy answer".

Thanks anyway,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
wolfme
Newbie

Joined: 26/10/2021
Location: Germany
Posts: 31
Posted: 05:07pm 15 Dec 2021
Copy link to clipboard 
Print this post

Could it add to the xmodem command itself?

something like:
- save the on key state
- execute on key 3,0
- execute xmodem transfer
- restore on key state

Wolfgang
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10310
Posted: 05:48pm 15 Dec 2021
Copy link to clipboard 
Print this post

  Quote  Could it add to the xmodem command itself?


Don't worry - trivial to fix - will be in the next beta
 
wolfme
Newbie

Joined: 26/10/2021
Location: Germany
Posts: 31
Posted: 07:21pm 15 Dec 2021
Copy link to clipboard 
Print this post

 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025