Stop a pending reset outliving the reset it belonged to
Reset out of picture.bin and CosmOS booted and then halted at once, having been told there was nobody at the keyboard. The button set two things: the machine's reset request, and a flag of the window's own that said "end the next console read, so a machine blocked on a key can get to the point where it notices". The second was only cleared when the console actually asked - and picture.bin never asks. It draws and halts. So the flag survived the restart and answered the NEXT machine's first read with the end of input, which for CosmOS means stop. There is one fact and it now lives in one place. The window asks whether a reset is still waiting rather than remembering that it asked for one, so the read ends only while a restart is genuinely on its way and goes back to normal the moment it has happened. The local flag is gone. Two pieces of state meaning one thing, one of them cleared on a path the other did not need - which is the same shape as the console's line editing flag surviving a second run, a fortnight ago. Worth noticing twice. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E2JrLzFvuFX9fgi1LDRjrW
This commit is contained in:
co-authored by
Claude Opus 5
parent
adefce975b
commit
f2e26c1852
@@ -643,6 +643,10 @@ void consoleResetInput(void) {
|
||||
clearInterrupt(PORT_CONSOLE);
|
||||
}
|
||||
|
||||
int resetIsPending(void) {
|
||||
return resetWanted;
|
||||
}
|
||||
|
||||
int takeResetRequest(void) {
|
||||
int wanted = resetWanted;
|
||||
resetWanted = 0;
|
||||
|
||||
Reference in New Issue
Block a user