From 90e76c8cd96b2e779b330701fde365b0c947e17e Mon Sep 17 00:00:00 2001 From: Djeeberjr Date: Fri, 30 Jun 2023 18:15:02 +0200 Subject: [PATCH] clear screen on shutdown --- src/kernel/Init.hx | 2 +- src/kernel/KernelEvents.hx | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/kernel/Init.hx b/src/kernel/Init.hx index 03ea972..c72a407 100644 --- a/src/kernel/Init.hx +++ b/src/kernel/Init.hx @@ -45,7 +45,7 @@ class Init { // Register default terminate handler KernelEvents.instance.onTerminate.handle(_->{ - OS.reboot(); + KernelEvents.instance.shutdown(); }); Debug.printBuildInfo(); diff --git a/src/kernel/KernelEvents.hx b/src/kernel/KernelEvents.hx index b8dd6bf..40498f7 100644 --- a/src/kernel/KernelEvents.hx +++ b/src/kernel/KernelEvents.hx @@ -1,7 +1,6 @@ package kernel; -import haxe.MainLoop; -import cc.OS; +import kernel.peripherals.Peripherals.Peripheral; import kernel.log.Log; import lib.Pos; import cc.HTTP.HTTPResponse; @@ -150,6 +149,12 @@ class KernelEvents { } public function shutdown() { + + // clearing screens + for (screen in Peripheral.instance.getAllScreens()) { + screen.reset(); + } + Log.info('Shutting down event loop'); this.stopLoop = true; MainTerm.instance.reset();