functions and timers

OP #1173739
Rate this post
useful
not useful
Hello.

I have functions called 'Func1' and 'Func2'. Both exploit USB CDC
routines taken from Atmel appnote, but they do a little different, i.e.
thay accept connections from different PC applications.
I'd like to do something like this: if there is no connection to Func1
within 30sec, then jump to Func2.

Probably I should use timers, but I'm not sure how.
Do you have any perhaps better ideas?

Thanks.
Moderator #1173740
Rate this post
useful
not useful
Roman Mashak wrote:
> Hello.
>
> I have functions called 'Func1' and 'Func2'. Both exploit USB CDC
> routines taken from Atmel appnote, but they do a little different, i.e.
> thay accept connections from different PC applications.
> I'd like to do something like this: if there is no connection to Func1
> within 30sec, then jump to Func2.
>
> Probably I should use timers, but I'm not sure how.
> Do you have any perhaps better ideas?

Just try it as described and ask more specifically if something does not
work.
OP #1173741
Rate this post
useful
not useful
Martin Thomas wrote:
>> I'd like to do something like this: if there is no connection to Func1
>> within 30sec, then jump to Func2.
>>
>> Probably I should use timers, but I'm not sure how.
>> Do you have any perhaps better ideas?
>
> Just try it as described and ask more specifically if something does not
> work.

Hm... The point is I don't know how to do this: wait for connection via
USB from update Win32 application, and if nothihg has come up, jump to
another part of code, which is also communicating via USB but with
another Win32 application :)  A bit tricky..

Reply

Please log in before posting.

or

Log in with Google account

Registration is free and takes only a minute.

Register now