Rahix/avr-device

Startup

Rahix opened this issue · 5 comments

Rahix commented

Right now, the startup is not as pretty as I would like it to be. Ideally, we should add a #[entry] procedural macro as cortex-m did.

Rahix commented

We should also think about pulling in the startup code written by @shepmaster in their rust-arduino-blink-led-no-core-with-cargo project instead of relying on avr-gcc. Though this does not have a high priority for now.

@Rahix What would be the material benefits?

Rahix commented

Right now, not that much. But looking into the future, it would mean independence from avr-gcc and avr-libc and ideally the ability to build the entire binary using just llvm tools. Though I think we are still a long way away from that.

Rahix commented

Oh, and now that I put some work into #19, I can tell that using custom startup code would also make the interrupt macro a lot less painful to implement.

Rahix commented

I think it makes sense to add a stub #[entry] macro now, before publishing on crates.io, so we can later just switch the underlying implementation without breaking user code.