diff --git a/pureboot/pureboot.cpp b/pureboot/pureboot.cpp index 96671df..c2f154c 100644 --- a/pureboot/pureboot.cpp +++ b/pureboot/pureboot.cpp @@ -177,7 +177,15 @@ struct hardware_link { // bit-addressable I/O (the classic megas), lds + skip (4) in extended // I/O. A uint32_t countdown pays one more sbci — window_polls() adds it // where the count forces the wide type. Held by the pureboot.window gate. - static constexpr std::uint8_t poll_cycles = avr::hw::usart_of::ucsra::addr < 0x40 ? 7 : 9; + // The lookup rides the baud parameter so it stays dependent: the trait is + // an incomplete type on the USART-less chips, which parse this template + // without ever instantiating it. + template > + static consteval std::uint8_t poll_cost() + { + return U::ucsra::addr < 0x40 ? 7 : 9; + } + static constexpr std::uint8_t poll_cycles = poll_cost(); static void init() {