Commit c767eae
Automate the build system with a
This replaces the AoT processing we did to generate the Rust modules
locally. It generates them on the fly at build-time, and only for the
selected MCUs. The process is mostly the same, just automated, with the
addition of what is described in the next paragraph. Some things became
unnecessary though, such as the `modrs.patch` and `Makefile`, and
therefore were removed. `form` is no longer run, in order to minimize
the number of files and directories. The patches were updated to not
have the `_svd` key, since that's now handled by the build script. Those
that ended up empty were removed.
It also updates our `interrupt` macro, adapting it from a newer
iteration of `cortex-m-rt`'s and adding logic to make the vector module
unnecessary. It would be hard to generate it correctly for the macros
crate, since it compiles before the main one where the build logic is
hosted. Instead, we generate a macro `__avr_device_trampoline` in the
main crate, and `#[interrupt(chip)]` calls into that giving the MCU
name, interrupt name and trampoline item to define. This new macro
converts the interrupt's name into a `__vector_N` symbol, which the
linker understands as being an interrupt, and changes the function's
name to it with `#[export_name = "..."]`.
CI code was updated as well.
Co-authored-by: Rahix <rahix@rahix.de>
Co-authored-by: tones111 <tones111@users.noreply.github.com>build.rs
1 parent 7b4cb83 commit c767eae
File tree
65 files changed
+716
-391
lines changed- .github/workflows
- examples/atmega328p
- src
- macros/src
- patch
- src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
65 files changed
+716
-391
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | 23 | | |
54 | 24 | | |
55 | 25 | | |
56 | 26 | | |
57 | | - | |
| 27 | + | |
58 | 28 | | |
59 | 29 | | |
60 | | - | |
61 | | - | |
62 | 30 | | |
63 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
64 | 34 | | |
65 | 35 | | |
66 | 36 | | |
67 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
68 | 40 | | |
69 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
70 | 44 | | |
71 | 45 | | |
72 | 46 | | |
73 | 47 | | |
74 | 48 | | |
75 | 49 | | |
76 | | - | |
| 50 | + | |
77 | 51 | | |
78 | 52 | | |
79 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
| |||
94 | 98 | | |
95 | 99 | | |
96 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
71 | 49 | | |
72 | 50 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
83 | 102 | | |
84 | 103 | | |
85 | 104 | | |
| |||
0 commit comments