During testing, I noticed verification errors after page 0 on atmega88a. It turns out, calculating page address is not correct if page size=128. I didn't like hardcoded method to get cfg_write_shift and how that value is used, so I refactored and I think simplified the code.
I've tested this code with atmega32 and atmega88a. Unfortunately I cannot test on attiny13a (mine just isn't responding, probably it's default 1MHz clock is too slow for fixed ch341g SPI speed).
During testing, I noticed verification errors after page 0 on atmega88a. It turns out, calculating page address is not correct if page size=128. I didn't like hardcoded method to get cfg_write_shift and how that value is used, so I refactored and I think simplified the code.
I've tested this code with atmega32 and atmega88a. Unfortunately I cannot test on attiny13a (mine just isn't responding, probably it's default 1MHz clock is too slow for fixed ch341g SPI speed).