Hello David,
I want to know if it is possible to find a solution to my needs.
As you have seen in the use of the module ISRTimer I was able to use the address of a normal subroutine as the destination of the timer call (and really do not understand as well as even in the help you have specified that the destination MUST BE an event) .
Now this happens .. in the chaos of my sources more than once in the subroutine call destination timer I entered public subroutine of different modules and now I want to know if they are forced to
1) turn into any EVENT SUB called by the timer
2) having to define a new timer for each external subroutine that was previously in the program's main subroutine OnTimer although the timing of the initial timer was 10ms.
from this :
Code: Select all
Private Sub OnTimer()
Module1.TimerSub()
Module2.TimerSub()
End Sub
to this:
Code: Select all
Module Module1
Public Event Timer1Sub()
....
End Event
....
End Module
Code: Select all
Module Module2
Public Event Timer2Sub()
....
End Event
....
End Module
Main program
Code: Select all
Const Timer1 = 0, // Timer per flashing Health
Timer2 = 1
....
Timer.Initialize(2)
Timer.Items(Timer1).Interval = 10 // 10ms
Timer.Items(Timer1).OnTimer = @Module1.Timer1Sub // timer 1 event handler
Timer.Items(Timer1).Enabled = False
Timer.Items(Timer2).Interval = 10 // 10ms
Timer.Items(Timer2).OnTimer = @Module2.Timer2Sub // timer 2 event handler
Timer.Items(Timer2).Enabled = True
Timer.Start
DelayMS(1)
Timer.Items(Timer1).Enabled = True
I ask because with version 2.2.2.2 subroutine OnTimer () that contained more than a subroutine call different external modules but it was in the module of the main program I had never given any overlap problem.