Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 03:29 07 Jun 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 V6.00.02 release candidates - all versions

     Page 50 of 50    
Author Message
jkdelauney
Newbie

Joined: 03/06/2025
Location: United States
Posts: 4
Posted: 03:53pm 05 Jun 2025
Copy link to clipboard 
Print this post

  matherp said  just a typo in the order of strings in overlaid_functions[] in functions.c compared to the enum in configuration.h


Thanks. I compared your current repo state to the last pull I had and I see what you're talking about.

I might not be able to learn from my own mistakes, but I can at least learn from other's. ;)
Edited 2025-06-06 01:53 by jkdelauney
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 603
Posted: 04:19pm 05 Jun 2025
Copy link to clipboard 
Print this post

Alternatively, allow the same x, y, x, y, w, h parameters in the Framebuffer copy? which already has the background option.
Edited 2025-06-06 02:20 by Bleep
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 988
Posted: 03:21am 06 Jun 2025
Copy link to clipboard 
Print this post

  toml_12953 said  
When I run prog1, I get
[LIBRARY] const true=-1
Error : true variable already declared

I do have TRUE declared in my library but why is CHAIN trying to rerun the library commands?

Peter,
What do you think about the CHAIN command not running the normal code in the library. All other resources in the library (SUBs,FUNCTIONs,FONTs CSUBs) are still available to the chained program just the normal code it not run. The FLASH CHAIN command does not run the normal code. i.e. comment this line in do_chain()


if(Option.LIBRARY_FLASH_SIZE == MAX_PROG_SIZE) ExecuteProgram(LibMemory );  // run anything that might be in the library


Gerry
Latest F4 Latest H7 FotS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10134
Posted: 07:33am 06 Jun 2025
Copy link to clipboard 
Print this post

  Quote  What do you think about the CHAIN command not running the normal code in the library.

This discussion stems from, IMHO, incorrect use of the library. It should be a repository of subroutines and functions that are , in effect extending the language. Again, IMHO, it should never contain executable main program code and definitely should not be declaring global variables without ON SKIP protection.
Disabling the library would mean that anything in the library would be inaccessible in the chained program. FLASH CHAIN is very different as it runs a pre-tokenised image. CHAIN loads from source and has to tokenise which means it rebuilds the subroutine tables.
In any event, unless any critical bugs are found in the next few days, the release is completely closed and I have already sent the binaries to Geoff ready for release.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7679
Posted: 07:54am 06 Jun 2025
Copy link to clipboard 
Print this post

I can't understand why you would even consider having executable code in the Library, especially trying to Chain to it as the Library routines (like all well-behaved subroutines and functions) should all be using their own local variables so there's no need for them to access the variables area of the previous program. The only reason to try that I can see is to see if it breaks. :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
toml_12953
Guru

Joined: 13/02/2015
Location: United States
Posts: 405
Posted: 08:46am 06 Jun 2025
Copy link to clipboard 
Print this post

  Mixtel90 said  I can't understand why you would even consider having executable code in the Library, especially trying to Chain to it as the Library routines (like all well-behaved subroutines and functions) should all be using their own local variables so there's no need for them to access the variables area of the previous program. The only reason to try that I can see is to see if it breaks. :)


I like to initialize constants to be used in every program such as TRUE=-1, FALSE=0, etc. I also like to set OPTION BASE 1, OPTION ESCAPE and other temporary options.
The only problem is declaring the constants but now I get around it by doing this:

ON ERROR SKIP 2
CONST TRUE=-1
CONST FALSE=0
OPTION ESCAPE
OPTION BASE 1
  :
  :
  :
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10134
Posted: 08:55am 06 Jun 2025
Copy link to clipboard 
Print this post

  Quote  I like to initialize constants to be used in every program such as TRUE=-1, FALSE=0, etc. I also like to set OPTION BASE 1, OPTION ESCAPE and other temporary options.


Much better, in my view, to have a template that you use to create any new program and put these in the template rather than the library. No need for ON ERROR then. I seem to remember MMEDIT supports such a template?
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7679
Posted: 09:46am 06 Jun 2025
Copy link to clipboard 
Print this post

If you don't use MMEDIT then it's easy enough to LOAD "template.bas" from SD card before you start programming.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Amnesie
Guru

Joined: 30/06/2020
Location: Germany
Posts: 548
Posted: 02:55pm 06 Jun 2025
Copy link to clipboard 
Print this post

Hello, I think I found a bug...

can anyone confirm this? I was trying the Keypad feature, see for yourself:












I tried also tried a different syntax, always the same. I am using as you can see a 128x64 LCD...
Because of the "display error" in Putty I also tried to do something like:


option display 24,80


Problem persists. I have a 2 row by 3 column keypad.. I don't know what I am doing wrong.

row1 is: GP20
row2 is: GP21
col1 is: GP22
col2 is: GP19
col3 is: GP18

Greetings
Daniel
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10134
Posted: 03:22pm 06 Jun 2025
Copy link to clipboard 
Print this post

Obviously the error isn't right but manual page 55
  Quote  The PicoMite firmware supports either a 4x3 keypad or a 4x4 keypad
 
Amnesie
Guru

Joined: 30/06/2020
Location: Germany
Posts: 548
Posted: 03:28pm 06 Jun 2025
Copy link to clipboard 
Print this post

Hello Peter,

thank you a lot for your reply! Ahh this is my bad. My PCB is already designed for an 2 by 3 row Keypad... Hm.. Ok. Then I have to do a redesign. I assumed, that it would be no problem to allow a smaller keypad. Sorry my bad  

Or is there a work-around possible?








I have some pins left, that I initially wanted to use for GPIO...


Greetings
Daniel
Edited 2025-06-07 01:34 by Amnesie
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10134
Posted: 03:35pm 06 Jun 2025
Copy link to clipboard 
Print this post

If you have two unassigned pins then just include these in the keypad command and your PCB will work fine. Otherwise just run the scan in a timed Basic interrupt
Edited 2025-06-07 01:36 by matherp
 
Amnesie
Guru

Joined: 30/06/2020
Location: Germany
Posts: 548
Posted: 03:48pm 06 Jun 2025
Copy link to clipboard 
Print this post

  matherp said  If you have two unassigned pins then just include these in the keypad command and your PCB will work fine. Otherwise just run the scan in a timed Basic interrupt


Ah, thanks, good Idea! I know that a 2 by 3 keypad seems a bid odd, but I am saving one single pin at least   .. Hey there are projects in which every single Pin counts... so I thought, it would work with the built-in keypad function. But you gave me a good hint! Thanks!

Greetings
Daniel
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7679
Posted: 04:02pm 06 Jun 2025
Copy link to clipboard 
Print this post

Of course, in some cases you can get several buttons on a single ADC input by switching resistors. You can save a lot of pins like that. In practice you can probably get 4 or 5 buttons easily, more if your resistor tolerances are good.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
     Page 50 of 50    
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