LazyHardware
Lazily initializes a hardware object on first access.
The cached object is discarded when an OpMode stops (see RobotController), so the next access re-runs the initializer against the new hardware map. Blocks passed to applyAfterInit are re-applied on every initialization.
Functions
Link copied to clipboard
Runs block on the hardware object now if it is initialized, and again after every (re-)initialization.
Like applyAfterInit, but replaces any earlier block registered with the same key, so repeatedly updating one setting does not accumulate blocks.
Link copied to clipboard
Runs block every time the cached object is discarded (for example when an OpMode stops). Use this to invalidate state that mirrors the hardware, such as write caches.