public interface MainClass
Modifier and Type | Method and Description |
---|---|
void |
onCheck(int id)
Method called each time a TapNLinkVar (and derived classes) are updated.
|
default void |
onEvent(java.lang.Object event)
Method called each time a JVM event occurs.
|
default void |
onException(int errcode,
int par1,
int par2)
onException is called by the JVM whenever a running error is encountered.
|
static void |
startTimer(int period)
Starts a timer that will call the onEvent method each time a period
has passed.
|
static void |
stopTimer()
Stops the timer set in the
startTimer(int) method, if any. |
default void onException(int errcode, int par1, int par2)
errcode
- the error code of the exception. Error codes are described in the TapNLinkException class.par1
- the program counter of the last executed instruction. Can be used for debugging purpose with Ride7.par2
- the stack pointer of the last executed instruction Can be used for debugging purpose with Ride7.TapNLinkException
,
Debug JVM with Ride7void onCheck(int id)
id
- the id of the updated variabledefault void onEvent(java.lang.Object event)
public void onEvent(Object event) { if (event instance of MainClass) { onTimer(); } else if (event instance of Pin) { onInterrupt((Pin) event); } else if (event instance of MqttInput) { onMqttMessage((MqttInput) event); } }
static void startTimer(int period)
period
- period of the timer, in milliseconds#onEvent}
static void stopTimer()
startTimer(int)
method, if any.