Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 22:15 18 Sep 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 : Is this expected and correct behavior?    I'm unable to set Break Key

Author Message
EDNEDN
Senior Member

Joined: 18/02/2023
Location: United States
Posts: 166
Posted: 10:41pm 09 Sep 2025
Copy link to clipboard 
Print this post

I'm using PicoMite_v6.01.00b11 on a RP2350 with the Web software.   I seem to be unable to set the Break Key to something else than ^C.    I also can't seem to disable the Break Key.    Here are the commands that I've tried and do not seem to work:

>
> ? mm.info(option break)
3
> option break 5
> ? mm.info(option break)
3
> option break 0
> ? mm.info(option break)
3
>

I must be doing something wrong.  This is too important of an option for me to be the only one seeing a problem.    A lot of people have software where they need to disable the Break Key.    

Can anybody help me understand?

Incidentally...   It is getting reset at line 5672 of Picomite.c.    This is the main command loop:


       while (1)
       {
           if (Option.DISPLAY_CONSOLE)
           {
               SetFont(PromptFont);
               gui_fcolour = PromptFC;
               gui_bcolour = PromptBC;
               if (CurrentX != 0)
                   MMPrintString("\r\n"); // prompt should be on a new line
           }
           MMAbort = false;
           BreakKey = BREAK_KEY;
           EchoOption = true;

Edited 2025-09-10 08:45 by EDNEDN
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 1025
Posted: 11:16pm 09 Sep 2025
Copy link to clipboard 
Print this post

Are you setting it inside the program. It is a non permanent option so only valid for the life of the program.
Are you using a USB Keyboard?
F4 H7FotSF4xGT
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3412
Posted: 11:17pm 09 Sep 2025
Copy link to clipboard 
Print this post

Per the manual: "The value of the break key is set to CTRL-C key at power upand when a
program is run but it can be changed to any keyboard key using this
command in a program"

Are you using it in a program as opposed to at the command prompt?
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
EDNEDN
Senior Member

Joined: 18/02/2023
Location: United States
Posts: 166
Posted: 11:25pm 09 Sep 2025
Copy link to clipboard 
Print this post

It does seem to stick when set within a program.    It just seems counter intuitive to me that the value is non-sticky as soon as the program exits.

Thank You for your help confirming this is expected behavior!!!!
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2716
Posted: 12:10am 10 Sep 2025
Copy link to clipboard 
Print this post

If you want it all the time, does setting it in Sub MM.STARTUP as well as in the program make any difference?
 
EDNEDN
Senior Member

Joined: 18/02/2023
Location: United States
Posts: 166
Posted: 12:34am 10 Sep 2025
Copy link to clipboard 
Print this post

  Quote  If you want it all the time, does setting it in Sub MM.STARTUP as well as in the program make any difference?


That is certainly worth a try!   I don't think it will help once (or if) the program terminates because it is getting set to ^C in the main command loop.   But with the Autorun option set...   At least it would start off with the desired behavior.
 
BarryH

Newbie

Joined: 05/01/2025
Location: Australia
Posts: 19
Posted: 02:14am 10 Sep 2025
Copy link to clipboard 
Print this post

  EDNEDN said  
  Quote  If you want it all the time, does setting it in Sub MM.STARTUP as well as in the program make any difference?


or better yet, as well as setting it within your program, setting it in the SUB MM.PROMPT, and saving it to the library, will make the OPTION BREAK command appear as if it is set permanently. (tested before answering)
Edited 2025-09-10 12:17 by BarryH
BarryH
 
EDNEDN
Senior Member

Joined: 18/02/2023
Location: United States
Posts: 166
Posted: 02:28am 10 Sep 2025
Copy link to clipboard 
Print this post

  Quote  or better yet, as well as setting it within your program, setting it in the SUB MM.PROMPT, and saving it to the library,



A Winner!!!!!

Thank You!
 
BarryH

Newbie

Joined: 05/01/2025
Location: Australia
Posts: 19
Posted: 03:04am 10 Sep 2025
Copy link to clipboard 
Print this post

actually, it can be more nuanced than my original proposal.

1. Without using the library, you can have an un-referenced sub MM.PROMPT which includes the OPTION BREAK command within your program, and on a break or natural finish of a program, or a cpu restart or power on event, MMBASIC will find and execute the MM.PROMPT sub if it is in the main program memory. This negates the use of the library if you are using all flash slots for a different purpose.


SUB MM.PROMPT 'un-referenced sub within main program
 OPTION BREAK 4
 Print "OPTION BREAK is ,ctrl. D >";
END SUB
a=1
WHILE a>0
PRINT a
LOOP


2. Have a MM.PROMPT sub saved to the library
BarryH
 
EDNEDN
Senior Member

Joined: 18/02/2023
Location: United States
Posts: 166
Posted: 03:16am 10 Sep 2025
Copy link to clipboard 
Print this post

Thank You!    These were very creative and practical ideas.
I'm not sure which I'll do.   But I'm going to try them all.
 
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