![]() |
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 StatesPosts: 166 |
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: AustraliaPosts: 1025 |
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 StatesPosts: 3412 |
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 StatesPosts: 166 |
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: AustraliaPosts: 2716 |
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 StatesPosts: 166 |
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: AustraliaPosts: 19 |
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 StatesPosts: 166 |
A Winner!!!!! Thank You! |
||||
BarryH![]() Newbie ![]() Joined: 05/01/2025 Location: AustraliaPosts: 19 |
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 StatesPosts: 166 |
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. |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |