From 925106394b8f77c81a7d0eeb35465620b1c105eb Mon Sep 17 00:00:00 2001 From: BlackMark Date: Sun, 23 Aug 2026 06:22:23 +0200 Subject: [PATCH] build: the filed i2c cost comes back, -70 B on the tiny85 1316 -> 1246. libavr took the finding this repo filed when its pin last moved: the shared transaction ladder's cost was never the ladder but the argument list reaching it - AVR passes eight bytes in call-clobbered registers and the rest in call-saved ones, so twelve bytes made every forwarder save four it never reads. A write has no read span, so the write path now passes eight. Worth recording that the candidate this repo suggested was measured and rejected upstream, and the numbers filed from here are why: it wins 66 B on a driver like this one and charges a single-byte reader 20, which is a class rather than one program. The mega328P does not move at 1480 - its TWI backend has its own ladder and was never charged. Net over the whole 22-commit advance the tiny85 is +8 B, and all of it is the bit-period fix that made the wire rate stop following the inliner. Sixteen tests green, cross-mode identity held on both chips. Co-Authored-By: Claude Opus 5 --- README.md | 2 +- libavr | 2 +- test/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8861ff2..13e6824 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ cmake --build --preset attiny85-generated Presets cover attiny85/atmega328p in both libavr modes (generated and reflect); `ctest` runs the consteval battery over the BCD, the hours register's two formats, the weekday and the alarm rate encodings, and holds -the example to its stated size — **1480 B** on the mega328P and **1316 B** +the example to its stated size — **1480 B** on the mega328P and **1246 B** on the tiny85, byte-identical across the two modes. The legacy yazoalfa-based driver lives on the `master` branch. diff --git a/libavr b/libavr index aec9955..e697920 160000 --- a/libavr +++ b/libavr @@ -1 +1 @@ -Subproject commit aec9955ad390bb0888eea4f0c21ea7936c7e879f +Subproject commit e69792013ec53f47defed956fdb93b2ba8c1cc64 diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 8fd0cfc..62dbcea 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -5,7 +5,7 @@ libavr_format_test() if(LIBAVR_MCU STREQUAL "atmega328p") libavr_size_claim_test(clock 1480) elseif(LIBAVR_MCU STREQUAL "attiny85") - libavr_size_claim_test(clock 1316) + libavr_size_claim_test(clock 1246) endif() # The README says the two modes emit the same image, and only a tree with