Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 18:31 16 Apr 2024 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 : 3 Picomite bug reports and also request an enhancement

Author Message
KenH
Newbie

Joined: 06/02/2022
Location: United Kingdom
Posts: 13
Posted: 01:33pm 08 Aug 2022
Copy link to clipboard 
Print this post

Hello

I would like to report 3 Picomite bug reports and also request an enhancement.

In summary, the bug reports are:

time$ cannot be set as the result of a function (date$ seems OK)
"GUI formatbox activate" and "GUI numberbox activate" fail, but "GUI textbox activate" seems OK
If you return to the command prompt <Ctl> C from other than page 1 you get "Error: Invalid address - resetting" and the program is deleted

Enhancement request - a method to increase the font size for formatbox and numberbox as currently is it very very small and much smaller than shown in the manual.
My wife is slightly visually impaired and has no chance of seeing the very small numbers.
I am using LCDpanel ILI9488.

Below example programs to illustrate each error.

Regards

Ken

time$ cannot be set as the result of a function

Function I2time(hh, mm) As string
I2time = STR$(hh,2,0,"0") + ":" + STR$(mm,2,0,"0")
end function

Dim buff as string
buff = I2time(12,20)
time$ = buff
print time$, "  ", buff
time$ = I2time(12,20)
Saved 176 bytes

> Run
12:20:00  12:20
[8] Time$ = I2time(12,20)
Error : Expected a number
>

"GUI formatbox activate" and "GUI numberbox activate" fail.
Note different errors depending upon whether option explicit or not.

option explicit
cls
GUI formatbox #1,time1,0,0,160,50,rgb(white),rgb(black)
GUI formatbox activate #1
Saved 99 bytes

> Run
[4] GUI formatbox activate #1
Error : ACTIVATE is not declared
>


cls
GUI formatbox #1,time1,0,0,160,50,rgb(white),rgb(black)
GUI formatbox activate #1
Saved 86 bytes

> Run
[3] GUI formatbox activate #1
Error : Expression syntax
>

If you return to the command prompt <Ctl> C from other than page 1
(Sorry that this example is quite long, but shorter ones don't seem to fail!)

Autosave
Dim switch = 1
Dim old_switch = 0

Sub S1
Print "Sub S1"
GUI interrupt 0
GUI delete all
GUI setup 1
Font #5,1
GUI caption #1,"Line 1", 0,0,"LT",RGB(white)
GUI caption #2,"Line 2", 0,50,"LT",RGB(white)
GUI caption #3,"Line 3", 0,100,"LT",RGB(white)
GUI caption #4,"Line 4", 0,150,"LT",RGB(white)
GUI caption #5,"Line 5", 0,200,"LT",RGB(white)
GUI button #6,"Button",0,250,200,40,RGB(black),RGB(cyan)
GUI interrupt S1down
Page 1
end sub

Sub s1down
Print "Sub S1down"
if touch(ref) = 6 then
 switch = 2
end if
end sub

Sub S2
Print "Sub S2 - Now I will press <Ctl> C"
GUI interrupt 0
GUI delete all
GUI setup 2
Font #5,1
GUI button #1,"Button",0,100,200,40,RGB(black),RGB(cyan)
GUI interrupt S2down
Page 2
end sub

Sub s2down
Print "Sub S2down"
if touch(ref) = 1 then
 switch = 1
end if
end sub

cls
do
if switch <> old_switch then
 old_switch = switch
 select case switch
  case 1
   S1
  case 2
   S2
 end select
end if
loop
Saved 915 bytes
>
> Run
Sub S1
Sub S1down
Sub S2 - Now I will press <Ctl> C
> Autosave
Error: Invalid address - resetting
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8562
Posted: 03:05pm 08 Aug 2022
Copy link to clipboard 
Print this post

1 is trivial will fix in next beta. Workround as you found or

Function I2time$(hh, mm)
I2time$ = STR$(hh,2,0,"0") + ":" + STR$(mm,2,0,"0")
end function

Dim buff as string
buff = I2time$(12,20)
time$ = buff
print time$, "  ", buff
time$ = I2time$(12,20)


2 appears to be a manual issue. There is no PicoMite code to support this functionality and nothing in Geoff's latest source which is where the Picomite code comes from. Will inform Geoff

3 Unable to test as not at home. If you can change example to use a 320x240 display I could possibly test

Re enhancement, the code autosizes the font based on the resolution of the display. I don't know if there is a bigger font that would fit the cell size on a 480x320 display but will have a look when back home (3 weeks)
 
KenH
Newbie

Joined: 06/02/2022
Location: United Kingdom
Posts: 13
Posted: 07:39pm 08 Aug 2022
Copy link to clipboard 
Print this post

Hello Peter

Many thanks for the prompt reply.

Re 1 as you say, not a major problem - just worked with Micromite. Easy enough to get around.

Re 3, I have run this again with  LCDPANEL ILI9341 320 x 240 and get the same error - "Error: Invalid address - resetting". Unfortunately, the error seems very dependent upon the layout of page 1. Some layouts work, some don't but the error is consistent and not random. 320 x 240 program below. If you delete one or more of the GUI caption lines, the error goes away!

Re the enhancement request, I have run this again with  LCDPANEL ILI9341 320 x 240 and the font appears bigger and fills more of the buttons. With LCDPANEL ILI9488 480 x 320 the font appears smaller and fills much less of the button. The font could be quite a lot bigger without spilling over boundaries.

Thanks again

Best wishes

Ken

option list
OPTION SYSTEM SPI GP10,GP11,GP12
OPTION SYSTEM I2C GP20,GP21
OPTION LCDPANEL ILI9341, RLANDSCAPE,GP8,GP15,GP9
OPTION GUI CONTROLS 50
OPTION TOUCH GP16,GP17
GUI CALIBRATE 0, 341, 199, 886, 629
> Autosave
Dim switch = 1
Dim old_switch = 0

Sub S1
Print "Sub S1"
GUI interrupt 0
GUI delete all
GUI setup 1
Font #5,1
GUI caption #1,"Line 1", 0,0,"LT",RGB(white)
GUI caption #2,"Line 2", 0,40,"LT",RGB(white)
GUI caption #3,"Line 3", 0,80,"LT",RGB(white)
GUI caption #4,"Line 4", 0,120,"LT",RGB(white)
GUI caption #5,"Line 5", 0,160,"LT",RGB(white)
GUI button #6,"Button",0,200,200,40,RGB(black),RGB(cyan)
GUI interrupt S1down
Page 1
end sub

Sub s1down
Print "Sub S1down"
if touch(ref) = 6 then
 switch = 2
end if
end sub

Sub S2
Print "Sub S2 - Now I will press <Ctl> C"
GUI interrupt 0
GUI delete all
GUI setup 2
Font #5,1
GUI button #1,"Button",0,100,200,40,RGB(black),RGB(cyan)
GUI interrupt S2down
Page 2
end sub

Sub s2down
Print "Sub S2down"
if touch(ref) = 1 then
 switch = 1
end if
end sub

cls
do
if switch <> old_switch then
 old_switch = switch
 select case switch
  case 1
   S1
  case 2
   S2
 end select
end if
loop
Saved 914 bytes
> Run
Sub S1
Sub S1down
Sub S2 - Now I will press <Ctl> C
> Autosave
Error: Invalid address - resetting
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5875
Posted: 01:09am 09 Aug 2022
Copy link to clipboard 
Print this post

I can confirm the bug.
Trying to enter 'NEW' also causes the error but 'CPU RESTART' works and the program is safe and sound after the restart.

Jim
VK7JH
MMedit   MMBasic Help
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8562
Posted: 09:03am 09 Aug 2022
Copy link to clipboard 
Print this post

OK Found the bug. It is caused by the use of GUI DELETE which clearly has never been used before as it frees up memory but doesn't de-allocate the pointer. Then when NEW or AUTOSAVE test the pointer and given that it is set also try and free up the memory bad things happen. Will fix in next V5.07.05 beta
 
KenH
Newbie

Joined: 06/02/2022
Location: United Kingdom
Posts: 13
Posted: 11:19am 09 Aug 2022
Copy link to clipboard 
Print this post

Many thanks for identifying the problem.

I am converting a program which was "shoe horned" into a Micromite which has 17 screens (pages). Converting it to use the the advanced graphics in the Picomite along the way. I use GUI Delete at the start of each page, otherwise I would have to set Option GUI controls to a very high number.

Many thanks again.

Ken
 
KenH
Newbie

Joined: 06/02/2022
Location: United Kingdom
Posts: 13
Posted: 02:19pm 18 Aug 2022
Copy link to clipboard 
Print this post

Hello Peter

I have discovered a few more minor bugs whilst working with advanced GUI controls:

When you change pages the 'UP' icon of a spinbox is not erased.
The rest of the spinbox is erased as expected. The program below demonstrates.
Tested with both ILI9488 and ILI9341.

If you touch a radio button very briefly (say with a stylus) the radio button changes, but a GUI Interrupt is not triggered.

Similarly, pressing an ordinary button very briefly makes it stay in the 'pressed' position with no interrupt.

Sometimes the 'UP' or 'DOWN' icons on a spinbox stay illuminated and the control freezes. This may well be the same issue as with buttons.

Best wishes

Ken

cls
GUI setup 1
Font #3,1: GUI spinbox #1,50,50,150,35,RGB(cyan),RGB(32,32,32),1,0,10
Font #3,1: GUI spinbox #2,100,150,200,50,RGB(cyan),RGB(32,32,32),1,0,10

Page 1
pause 5000
GUI setup 2
Page 2
 
Print this page


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

© JAQ Software 2024