Fixed duplicate fail_after on boot which sometime didn't get canceled
All checks were successful
Run test asserts / Test-Asserts (push) Successful in -16s

This commit is contained in:
Willem Cazander 2025-07-14 09:07:14 +02:00
parent 1ea824d39e
commit 4428c413d8
2 changed files with 12 additions and 10 deletions

View file

@ -70,7 +70,7 @@ TODO: Link to example project on github a few ways to compile and test hello.
## Usage Help
When using the `mb_setup_default` this add a help system which works by running: `make @help | grep "*"`
When using the `mb-setup-default` this add a help system which works by running: `make @help | grep "*"`
* @help-variable
* @help-variable-deep
@ -164,7 +164,7 @@ Example output of qa assert graph [https://iupload.distributedrebirth.love/quohb
## Errata
* (?19++) Very sometimes the fail_after "boot_err" watchdog doesn't get canceled
* (FIXED) Very sometimes the fail_after "boot_err" watchdog doesn't get canceled
* Make: @@include-mods will not get chained, it doesn't list ANY dep anymore
* Make: @@include-tree will not get phony, (and thus @@include-root not on top)
* boot_exec_setcolor: does not work on MSX1 vdp TMS9918

View file

@ -38,7 +38,7 @@ proc fail_after_exit {{fail_id "fail_after_exit"} {fail_code 2}} {
proc fail_after { timeout {time_unit "time"} {fail_id "fail_after"} {fail_code 2}} {
global fail_after_prev_timer
global fail_after_prev_id
set msg ""
set msg "mb::fail not installed"
if {$fail_after_prev_timer != 0} {
if {[catch {after cancel $fail_after_prev_timer} err_msg]} {
puts stderr "error: $err_msg"
@ -62,21 +62,23 @@ proc fail_after { timeout {time_unit "time"} {fail_id "fail_after"} {fail_code 2
return $msg
}
proc fail_after_reboot_watchdog {} {
proc fail_after_reboot_watchdog {{skip_preboot_hook 1}} {
global fail_after_boot_timeout
if {$fail_after_boot_timeout != 0} {
if {$skip_preboot_hook != 0} {
if {[catch {fail_after $fail_after_boot_timeout realtime err_boot 124} err_msg]} {
puts stderr "error: $err_msg"
fail_after_exit fail_after_reboot_install_error 1
}
if {[catch {after boot "fail_after_reboot_watchdog"} err_msg]} {
puts stderr "error: $err_msg"
fail_after_exit fail_after_reboot_cycle_error 1
}
}
if {[catch {after boot "fail_after_reboot_watchdog"} err_msg]} {
puts stderr "error: $err_msg"
fail_after_exit fail_after_reboot_cycle_error 1
}
}
if {[info exists ::env(BOOT_WATCHDOG)] && ([string trim $::env(BOOT_WATCHDOG)] != "")} {
set fail_after_boot_timeout [string trim $::env(BOOT_WATCHDOG)]
fail_after_reboot_watchdog
if {$fail_after_boot_timeout != 0} {
fail_after_reboot_watchdog 0
}
}