\ hwutils ERS 17Aug2005 needs zstrings module hwutils private: variable libref sysLibTrapCustom dup constant kHWUtilsTrapBlinkLED 1+ dup constant kHWUtilsTrapSetBlinkRate 1+ dup constant kHWUtilsTrapEnableDisplay 1+ constant kHWUtilsTrapGetDisplayState : HUlibname z" HardwareUtils" drop ; public: : HUlibfind ( --- err ) libref >abs HUlibname >abs sysLibFind ; : HUlibload ( --- err ) libref >abs [id] HWut [id] libr sysLibLoad ; : HUlibopen ( --- err ) libref @ sysLibTrapOpen systrap drop d0.l drop ; : HUlibclose ( --- err ) libref @ sysLibTrapClose systrap drop d0.l drop ; : blinkLED ( bool --- err ) libref @ kHWUtilsTrapBlinkLED systrap 2drop d0.l drop ; \ True blinks LED, False stops blinking : LEDblinkrate ( rate --- err ) libref @ kHWUtilsTrapSetBlinkRate systrap 2drop d0.l drop ; : EnableDisplay ( bool --- err ) libref @ kHWUtilsTrapEnableDisplay systrap 2drop d0.l drop ; \ False disables, True (re-)enables display : DisplayState ( --- bool ) libref @ kHWUtilsTrapGetDisplayState systrap drop d0.l drop ; : HUlibremove ( --- err ) libref @ sysLibRemove ; : InitHUlib ( --- err ) HUlibload dup if drop HUlibfind then ; end-module