From 36247503cac88319ebfb76d37c6e1df1ed960553 Mon Sep 17 00:00:00 2001 From: Matthew Wilkes Date: Sun, 24 Aug 2025 18:08:07 +0100 Subject: [PATCH 1/3] Fix reading hexpansion headers The documentation for reading a hexpansion header had sample code that has been broken since v1.8.0, due to a backwards-incompatible. Fix these, by adding the addr length. --- docs/hexpansions/writing-hexpansion-apps.md | 4 ++-- docs/tildagon-apps/examples/detect-hexpansion.md | 4 ++-- docs/tildagon-apps/reference/badge-hardware.md | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/hexpansions/writing-hexpansion-apps.md b/docs/hexpansions/writing-hexpansion-apps.md index 07bc94d..5b48b7c 100644 --- a/docs/hexpansions/writing-hexpansion-apps.md +++ b/docs/hexpansions/writing-hexpansion-apps.md @@ -126,14 +126,14 @@ Below is an example of how you find which port your hexpansion is plugged in to for port in range(1, 7): print(f"Searching for hexpansion on port: {port}") i2c = I2C(port) - addr,addr_len = detect_eeprom_addr(i2c) # Firmware version 1.8 and upwards only! + addr, addr_len = detect_eeprom_addr(i2c) # Firmware version 1.8 and upwards only! if addr is None: continue else: print("Found EEPROM at addr " + hex(addr)) - header = read_hexpansion_header(i2c, addr) + header = read_hexpansion_header(i2c, addr, addr_len=addr_len) if header is None: continue else: diff --git a/docs/tildagon-apps/examples/detect-hexpansion.md b/docs/tildagon-apps/examples/detect-hexpansion.md index 9ea269a..5922adb 100644 --- a/docs/tildagon-apps/examples/detect-hexpansion.md +++ b/docs/tildagon-apps/examples/detect-hexpansion.md @@ -56,14 +56,14 @@ class ExampleApp(app.App): for port in range(1, 7): print(f"Searching for hexpansion on port: {port}") i2c = I2C(port) - addr = detect_eeprom_addr(i2c) + addr, addr_len = detect_eeprom_addr(i2c) if addr is None: continue else: print("Found EEPROM at addr " + hex(addr)) - header = read_hexpansion_header(i2c, addr) + header = read_hexpansion_header(i2c, addr, addr_len=addr_len) if header is None: continue else: diff --git a/docs/tildagon-apps/reference/badge-hardware.md b/docs/tildagon-apps/reference/badge-hardware.md index 6c5c998..595b2fb 100644 --- a/docs/tildagon-apps/reference/badge-hardware.md +++ b/docs/tildagon-apps/reference/badge-hardware.md @@ -698,14 +698,14 @@ bus = I2C(1) for port in range(1, 7): print(f"Searching for hexpansion on port: {port}") i2c = I2C(port) - addr = detect_eeprom_addr(i2c) + addr, addr_len = detect_eeprom_addr(i2c) if addr is None: continue else: print("Found EEPROM at addr " + hex(addr)) - header = read_hexpansion_header(i2c, addr) + header = read_hexpansion_header(i2c, addr, addr_len=addr_len) if header is None: continue else: From 99797e9e3706d1fbfbff392f9f70fb574fd5ede0 Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 29 Aug 2025 22:15:24 +0100 Subject: [PATCH 2/3] fix indentation error in python linter --- docs/tildagon-apps/backgrounds.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/tildagon-apps/backgrounds.md b/docs/tildagon-apps/backgrounds.md index a5762b2..52e42ba 100644 --- a/docs/tildagon-apps/backgrounds.md +++ b/docs/tildagon-apps/backgrounds.md @@ -46,11 +46,11 @@ from app_components.background import Background as bg then call the update and draw functions from the same functions in your app: ```python - def draw(self, ctx): - bg.draw(ctx) - # add you code +def draw(self, ctx): + bg.draw(ctx) + # add you code - def update(self, delta): - bg.update(delta) - # add you code +def update(self, delta): + bg.update(delta) + # add you code ``` From 9fa3be00e4abbb0d86c734cea0b45720c10771e5 Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 29 Aug 2025 22:17:04 +0100 Subject: [PATCH 3/3] extra blank line --- docs/tildagon-apps/backgrounds.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/tildagon-apps/backgrounds.md b/docs/tildagon-apps/backgrounds.md index 52e42ba..2fae503 100644 --- a/docs/tildagon-apps/backgrounds.md +++ b/docs/tildagon-apps/backgrounds.md @@ -50,6 +50,7 @@ def draw(self, ctx): bg.draw(ctx) # add you code + def update(self, delta): bg.update(delta) # add you code