![]() |
Forum Index : Microcontroller and PC projects : PicoMite strange bahaviour
Author | Message | ||||
wolfme Newbie ![]() Joined: 26/10/2021 Location: GermanyPosts: 31 |
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 KingdomPosts: 10310 |
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: GermanyPosts: 31 |
yes, this did the trick... ![]() many thanks! Wolfgang |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4311 |
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 KingdomPosts: 10310 |
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: GermanyPosts: 31 |
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 KingdomPosts: 4311 |
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: GermanyPosts: 31 |
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 KingdomPosts: 10310 |
Don't worry - trivial to fix - will be in the next beta |
||||
wolfme Newbie ![]() Joined: 26/10/2021 Location: GermanyPosts: 31 |
![]() |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |