// Test-fixture application for the pureboot protocol test: prints "APP" on // the chip's serial link (the same link the loader uses) and idles — the // proof that the loader's hand-over, and on the tinies the host's // reset-vector surgery, actually launched it. Linked normally (crt, vectors // at 0); on the tinies its reset vector is the rjmp the host re-homes. #include using namespace avr::literals; namespace { consteval avr::hertz_t clock() { if (avr::hw::db.name == "ATtiny13A") return 9.6_MHz; if (avr::hw::db.name == "ATtiny85") return 8_MHz; return 16_MHz; } using dev = avr::device<{.clock = clock()}>; template struct link { using tx_t = avr::uart::usart0; static void tx(char c) { tx_t::write(static_cast(c)); } }; template struct link { using tx_t = avr::uart::software_tx; static void tx(char c) { tx_t::write(static_cast(c)); } }; } // namespace int main() { avr::init::tx_t>(); link::tx('A'); link::tx('P'); link::tx('P'); while (true) { } }