mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
just couldn't let it go. figured out the issue is a race condition in how the Litex UARTs are constructed...I don't know how Litex normally handles this kind of situation but they have this funky construction where reading the fifo doesn't advance it, you have to...clear the pending bit. I think it was meant to be a "clever" thing that saves an instruction or something like that since you always have to clear the pending bit. Anyways, the previous incarnation of this loop checked to see if the pending bit was set again and if it was it'd run back and fetch another character. This turns out to be a bad idea because the pending bit goes through a multireg and other stuff before it's readable which means it has a lot of delay on it. This leads to a race condition. This version actually checks if the fifo is empty and if it isn't, it reads the character *and* pumps the pending bit (because the FIFO doesn't auto-advance when you read it, you have to clear the pending bit). This works a lot better, but it's not at all well documented how this works and it's very hard to tell from reading the source code because it's written using really fancy migen abstractions that are also poorly documented and have a lot of cursed constructions. Anyways. At least the console doesn't die now when you type a control character, *but* you do have the problem that the escape codes get mis-interpreted sometimes. If it really really becomes important later on to fix that it would involve tracing out the sequence of keys that arrive at InjectKey and figuring out if things are coming out of order or what is triggering the bad escape codes. |
||
|---|---|---|
| .. | ||
| .vscode | ||
| src | ||
| build.rs | ||
| Cargo.toml | ||
| README.md | ||
Log output
This contains the core kernel for Xous. It is implemented as
a library that you include with your pid 0 program.