Fix typo in ATtiny85 docs
make: Properly remove 'extern crate' lines
The previous sed expression would remove arbitrary lines which can break
easily. Instead, only remove actual extern crate lines.
This will provide a seamless upgrade to the next svd2rust version which
contains commit 85615cb0bbc8 ("Use and generate code for Edition 2018
only ") and thus no longer emits 'extern crate' lines.
Signed-off-by: Rahix <rahix@rahix.de>
Only emit inline-assembly when building for AVR
Make sure that we'll never emit AVR assembly on non-AVR targets.
Instead of failing the build, fail at runtime, to allow a potential
application testsuite to run even if those functions somehow get linked
in.
Signed-off-by: Rahix <rahix@rahix.de>
Cause an error in the #[entry] macro instead of avr-device
Add basic support for ATmega168
interrupt: Fix interrupt::free() reading wrong address
The SREG is at IO address 0x3F, not 0x35. Fix interrupt::free() to read
the correct register to make it work as advertised.
Signed-off-by: Rahix <rahix@rahix.de>
interrupt: Make interrupt::enable() unsafe
To bring this crate more in line with cortex-m, mark interrupt::enable()
as unsafe. This also fixes a soundness issue: When the function is
safe, one could call it inside a critical section in entirely safe rust.
This is problematic because lot's of code in critical sections relies on
the fact that interrupts are disabled and it thus can safely perform
non-atomic operations without anything interrupting it.
Signed-off-by: Rahix <rahix@rahix.de>
Add asm module for assembly instructions
Add a new module containing wrapper functions for various assembly
instructions. These functions are marked inline(always) to ensure they
will always just generate the single instruction as expected.
Signed-off-by: Rahix <rahix@rahix.de>
makefile: also clean generic.rs
makefile: all and clean are .PHONY
ci: Get rid of matrix build
Instead of a matrix build just build a single time
with all features enabled.
Signed-off-by: Rahix <rahix@rahix.de>
attiny88: simplify patches thanks to svdpatch fixes
svdpatch: Fix _replace_enum when used on derived fields
Make sure the enum is replaced properly in the case of derived
enumerated values.
Signed-off-by: Rahix <rahix@rahix.de>