Forum Index
HomeZBasic Home   Forum RulesForum Rules   Forum FAQForum FAQ   MemberlistMemberlist   UsergroupsUsergroups   RSS FeedRSS Feed
Site SearchSite Search   LinksLinks   DownloadDownload   Digests and SubscriptionsDigests and Subscriptions
ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in   RegisterRegister
What am I missing?

 
Post new topic   Reply to topic    Forum Index -> ZX-40
Author Message
DH*
Guest





Posted: 19 July 2006, 15:37 PM    Post subject: What am I missing? Reply with quote

This is my first stab at multitasking. My task stack is 50 bytes.

Just before starting my main loop I start the task with...
Code:
    CallTask TTLTask, TTLStack


The task is...
Code:
Sub TTLTask()

  Call WaitForInterrupt(zxPinChange, INT0)        'pin16 = ZC
  cnt = cnt + 1
     
End Sub

Pin16 has a square wave ZC from a TW523.

No matter how long the app runs, cnt never exceeds 1, indicating the task only gets called once.

Do I need to wrap the task procedure in a Do:Loop?
Back to top
mikep



Joined: 24 Sep 2005
Posts: 765
Location: Austin, TX

Posted: 19 July 2006, 15:54 PM    Post subject: Re: What am I missing? Reply with quote

dhouston wrote:
Code:
Sub TTLTask()

  Call WaitForInterrupt(zxPinChange, INT0)        'pin16 = ZC
  cnt = cnt + 1
     
End Sub
The End Sub effectively ends the task. So yes you do need some kind of loop if you want the task to do more work.
Back to top
DH*
Guest





Posted: 19 July 2006, 17:33 PM    Post subject: Re: What am I missing? Reply with quote

mikep wrote:
The End Sub effectively ends the task. So yes you do need some kind of loop if you want the task to do more work.
Thanks - it works as expected with a loop.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZX-40 Time synchro. with the server - Timezone/DST with your computer
Page 1 of 1

 


All content Copyright © 2005-2012 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group