clear screen on shutdown

This commit is contained in:
Djeeberjr 2023-06-30 18:15:02 +02:00
parent d2873d6353
commit 90e76c8cd9
2 changed files with 8 additions and 3 deletions

View File

@ -45,7 +45,7 @@ class Init {
// Register default terminate handler // Register default terminate handler
KernelEvents.instance.onTerminate.handle(_->{ KernelEvents.instance.onTerminate.handle(_->{
OS.reboot(); KernelEvents.instance.shutdown();
}); });
Debug.printBuildInfo(); Debug.printBuildInfo();

View File

@ -1,7 +1,6 @@
package kernel; package kernel;
import haxe.MainLoop; import kernel.peripherals.Peripherals.Peripheral;
import cc.OS;
import kernel.log.Log; import kernel.log.Log;
import lib.Pos; import lib.Pos;
import cc.HTTP.HTTPResponse; import cc.HTTP.HTTPResponse;
@ -150,6 +149,12 @@ class KernelEvents {
} }
public function shutdown() { public function shutdown() {
// clearing screens
for (screen in Peripheral.instance.getAllScreens()) {
screen.reset();
}
Log.info('Shutting down event loop'); Log.info('Shutting down event loop');
this.stopLoop = true; this.stopLoop = true;
MainTerm.instance.reset(); MainTerm.instance.reset();