Commit 86660a7
serial: Allow for nested logging
The current serial implementation will panic if you log! within a log!
statment. For example, the following code panics:
fn foo() {
log!("foo: {}, bar()");
}
fn bar() -> u64 {
log!("bar");
42
}
We change the implementation to have the PORT be static rather than
the entire Serial structure.
Signed-off-by: Joe Richey <joerichey@google.com>1 parent efd9748 commit 86660a7
2 files changed
Lines changed: 7 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
24 | 25 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 26 | + | |
37 | 27 | | |
38 | 28 | | |
39 | 29 | | |
| 30 | + | |
40 | 31 | | |
41 | | - | |
| 32 | + | |
42 | 33 | | |
43 | 34 | | |
44 | 35 | | |
| |||
49 | 40 | | |
50 | 41 | | |
51 | 42 | | |
52 | | - | |
| 43 | + | |
53 | 44 | | |
54 | 45 | | |
55 | 46 | | |
| |||
0 commit comments