When declaring a Timer Type in a Module, the program stops (hangs) at step Timer Initialize. No error during compile, link & upload.
Main
Module LEDControl
B4X:
Type TLEDControl (PinOut As Pin, PinNr As Byte, Blink As Timer)
Main
B4X:
Private Sub AppStart
serialLine.Initialize(115200)
' Call module
LEDControl.Initialize(13)
End Sub
Module LEDControl
B4X:
Sub Process_Globals
Type TLEDControl (PinOut As Pin, PinNr As Byte, Blink As Timer)
Public LED As TLEDControl
End Sub
Public Sub Initialize(Pin_Nr As Byte)
Log("LED Control Initialize Pin: ", Pin_Nr)
LED.PinOut.Initialize(Pin_Nr, LED.PinOut.MODE_OUTPUT)
Log("LED Control Initialize Blink Timer") '<=== program stops here
LED.Blink.Initialize("Blink_Tick", 2000)
Log("LED Control Blink Timer Enabling")
LED.Blink.Enabled = True
Log("LED Control Initialize Done")
End Sub
Private Sub Blink_Tick
Log("LED Control Blink Tick")
LED.PinOut.DigitalWrite(Not(LED.PinOut.DigitalRead))
End Sub