Skip to content
Snippets Groups Projects
  • Gaius Mulley's avatar
    cf4dcfa6
    PR modula2/108344 disable default opening of /dev/tty · cf4dcfa6
    Gaius Mulley authored
    
    This patch changes removes the static initialisation code for KeyBoardLEDs.cc.
    The module is only initialised if one of the exported functions is called.
    This is useful as the module will access /dev/tty which might not be
    available.  TimerHandler.mod has also been changed to disable the scroll
    lock LED as a sign of life.
    
    gcc/m2/ChangeLog:
    
    	PR modula2/108344
    	* gm2-libs-coroutines/TimerHandler.mod (EnableLED): New constant.
    	(Timer): Test EnableLED before switching on the scroll LED.
    
    libgm2/ChangeLog:
    
    	PR modula2/108344
    	* libm2cor/KeyBoardLEDs.cc (initialize_module): New function.
    	(SwitchScroll): Call initialize_module.
    	(SwitchNum): Call initialize_module.
    	(SwitchCaps): Call initialize_module.
    	(SwitchLEDs): Call initialize_module.
    	(M2EXPORT): Remove initialization code.
    
    Signed-off-by: default avatarGaius Mulley <gaiusmod2@gmail.com>
    cf4dcfa6
    History
    PR modula2/108344 disable default opening of /dev/tty
    Gaius Mulley authored
    
    This patch changes removes the static initialisation code for KeyBoardLEDs.cc.
    The module is only initialised if one of the exported functions is called.
    This is useful as the module will access /dev/tty which might not be
    available.  TimerHandler.mod has also been changed to disable the scroll
    lock LED as a sign of life.
    
    gcc/m2/ChangeLog:
    
    	PR modula2/108344
    	* gm2-libs-coroutines/TimerHandler.mod (EnableLED): New constant.
    	(Timer): Test EnableLED before switching on the scroll LED.
    
    libgm2/ChangeLog:
    
    	PR modula2/108344
    	* libm2cor/KeyBoardLEDs.cc (initialize_module): New function.
    	(SwitchScroll): Call initialize_module.
    	(SwitchNum): Call initialize_module.
    	(SwitchCaps): Call initialize_module.
    	(SwitchLEDs): Call initialize_module.
    	(M2EXPORT): Remove initialization code.
    
    Signed-off-by: default avatarGaius Mulley <gaiusmod2@gmail.com>