TickTimer

system timer (mwx::periph_ticktimer)

TickTimer is used for internal control of TWENET and is implicitly executed. The period of the timer is 1ms. Only the available() method is defined in loop() for the purpose of describing processing every 1ms by the TickTimer event.

Note that it is not always available in 1ms increments.

There are cases in which events are skipped due to a large delay caused by factors such as the contents of the user program description or the system's internal interrupt processing.

void loop() {
  if (TickTimer.available()) {
    if ((millis() & 0x3FF) == 0) { // This may not be processed (could be skipped)
      Serial << '*';
    }
  }
}

Methods

available()

inline bool available()

It is set after the TickTimer interrupt occurs and becomes true in the loop() immediately following it. It is cleared after loop() ends.

最終更新