From 70e3a591b2e43e25d37da4a5bd9f33190caacc63 Mon Sep 17 00:00:00 2001 From: stefan-b-jakobsson <70063525+stefan-b-jakobsson@users.noreply.github.com> Date: Wed, 30 Oct 2024 19:24:27 +0200 Subject: [PATCH] Support bootloader version 3 in command offset 0x8E (#55) * Offset 0x8E to return bootloader 3 version * Fix typo * Change order; look for bootloader 3 first * Revert code, check bootloader version at 0x1e00 first * Fix bug that I introduced --- x16-smc.ino | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/x16-smc.ino b/x16-smc.ino index bc48470..cee0f1e 100644 --- a/x16-smc.ino +++ b/x16-smc.ino @@ -605,8 +605,13 @@ void I2C_Send() { case I2C_CMD_GET_BOOTLDR_VER: if (pgm_read_byte(0x1e00) == 0x8a) { + // Bootloader version 1 and 2 smcWire.write(pgm_read_byte(0x1e01)); } + else if (pgm_read_byte(0x1ffe) == 0x8a) { + // From bootloader version 3 + smcWire.write(pgm_read_byte(0x1fff)); + } else { smcWire.write(0xff); }