![]() |
Forum Index : Microcontroller and PC projects : Shelling Out..?
Author | Message | ||||
Zonker![]() Guru ![]() Joined: 18/08/2012 Location: United StatesPosts: 767 |
Evening Gent's... I wanted to check this with everyone, because it's probably something stupid I am doing.. ![]() The Car facts: I am running on an E-100 board with the RTC module installed in back. I have a SDD1963 based 4.3" LCD, passing all tests, touched calibrated with click sound, SD card pushed in and confirmed working... ' RTC Setup Test Const time_display_box=1 Const yer_val_box=2 Const yer_label_box=3 Const mth_val_box=4 Const mth_label_box=5 Const day_val_box=6 Const day_label_box=7 Const hrs_val_box=8 Const hrs_label_box=9 Const min_val_box=10 Const min_label_box=11 'Dim old_date As string length 10 'Dim old_time As string length 10 'Dim not_touched =1 CLS GUI setup 1 GUI displaybox time_display_box,0,0,300,20,RGB(yellow),RGB(black) CtrlVal(time_display_box)="test" Font 5 GUI numberbox yer_val_box,20,30,100,50,RGB(yellow),RGB(blue) CtrlVal(yer_val_box)=Val(Mid$(Date$,7,4)) ' extract year data Font 1 GUI interrupt pen_down,pen_up SetTick 1000,check_time Do Loop Sub check_time 'Do 'refresh_line=GetScanLine() 'Print refresh_line 'Loop While refresh_line<50 Print Time$ 'Print refresh_line CtrlVal(time_display_box)=Time$ End Sub Sub MM.KEYPRESS ref As integer, caption As string Print caption If ref=yer_val_box And caption="Ent" Then If Val(CtrlVal(yer_val_box))>4000 Then CtrlVal(yer_val_box)="4000" If Val(CtrlVal(yer_val_box))<0 Then CtrlVal(yer_val_box)="0" EndIf EndIf End Sub Sub pen_down Print "down" End Sub Sub pen_up Print "up" End Sub This where I got so far... Now, when I run this, I get whats expected on the time_display_box object... I touched a blank area of the screen to generate a few pen "down-up" events.. So far, so good... Then I touch the yer_val_box and enter the new year data.. I hit the "Ent" button and get what I expect back into yer_val_box... But then I notice the interrupts are no longer working... Humm... Now, it took a few tries and head scratching, but, I finally noticed it.. In this "snip" pix, notice the "command prompt" .. Yep, the program is still runing ok, but, the firmware has returned, and (not shown here), you can type commands and the firmware answers back, AND the yer_val_box is still active and working too..! However, the rest of the INT subs are no longer active... Not sure whats going on here.. ![]() The program should stay trapped in the Do loop... I can continue building, but was wondering if anyone else have seen this behavior..? But, maybe it's just something stupid I am doing..! ![]() BTW - What is the correct numbers to enter for the GETSCANLINE function..? Thanks for any feedback on this stuff..!! |
||||
Phil23 Guru ![]() Joined: 27/03/2016 Location: AustraliaPosts: 1667 |
Think I found that the GUI will continue to run in the background even after the main code is terminated. A while back I played with that though, but have experienced something similar. Phil |
||||
Zonker![]() Guru ![]() Joined: 18/08/2012 Location: United StatesPosts: 767 |
But... I didn't press control C..!! It just "shells out" on it's own... The only thing that gets things back to working, is to type "edit".. Then, the GUI stops and after exiting, things are back to normal... ![]() |
||||
disco4now![]() Guru ![]() Joined: 18/12/2014 Location: AustraliaPosts: 1000 |
Is there a stray END IF in there? Sub MM.KEYPRESS ref As integer, caption As string Print caption If ref=yer_val_box And caption="Ent" Then If Val(CtrlVal(yer_val_box))>4000 Then CtrlVal(yer_val_box)="4000" If Val(CtrlVal(yer_val_box))<0 Then CtrlVal(yer_val_box)="0" EndIf EndIf End Sub Latest F4 Latest H7 FotS |
||||
Zonker![]() Guru ![]() Joined: 18/08/2012 Location: United StatesPosts: 767 |
oops... Will try it.. Nope, acts the same way... Humm... It shells out after I press the first key on the number entry pad... Well, will keep playing... Getting late here... Time for some rack... Thanks for the feedback..! ![]() |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6269 |
I can repeat the error on a Explore64 with 5.3beta3 When I bring up the keypad I can move between the ALT and normal screens. If I press on "CAN" caption gets the value of "Ent". That doesn't seem right. After printing the value of caption, the program exits with the following error: There are NO FOR's in the program at all. If I press a number on the keypad, the main program exits to the command prompt without any error message. Jim VK7JH MMedit |
||||
Phil23 Guru ![]() Joined: 27/03/2016 Location: AustraliaPosts: 1667 |
MM.KEYPRESS? Is that a new internal variable or Sub name? Haven't heard of it & don't get any search hits in either the 5.2 manuals or in the forum. Phil. Edit:- Just found it in the 5.3 Beta manual. |
||||
Phil23 Guru ![]() Joined: 27/03/2016 Location: AustraliaPosts: 1667 |
Don't have 5.3 loaded here to play with by wondering if Sub pen_up is breaking you out of MM.KEYPRESS? |
||||
StoveMan Regular Member ![]() Joined: 29/03/2013 Location: United StatesPosts: 51 |
Do we still need Ireturn from interrupt routine or will end sub work? |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9589 |
End Sub works. This sounds like a little bug that needs squishing to me.... Smoke makes things work. When the smoke gets out, it stops! |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6269 |
I loaded the pump control demo program from the manual. It runs OK I added this to the end: The main program now exits like in Zonker's program and the GUI elements keep running. The MM.KEYPRESS sub still runs as if it's a library function. Jim VK7JH MMedit |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |