From 2b25fed2cd4c9889cf9099fcb447b5cd5923aa22 Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Mon, 21 Jul 2025 18:25:17 +0200 Subject: [PATCH] com2w1: follow changes in com2w0. --- avr/modules/com2w/com2w1.asm | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/avr/modules/com2w/com2w1.asm b/avr/modules/com2w/com2w1.asm index c54ad98..a57189c 100644 --- a/avr/modules/com2w/com2w1.asm +++ b/avr/modules/com2w/com2w1.asm @@ -181,6 +181,7 @@ com2w1DataSetLow: ; --------------------------------------------------------------------------- ; @routine com2w1ReadNextBit ; +; @param r17 data from COM_DATAn_INPUT ; @clobbers r16, r17, r18, r20, r22 com2w1ReadNextBit: @@ -188,7 +189,6 @@ com2w1ReadNextBit: ; rcall com2w1WaitForClockHighMulti5Us ; (R20, R22) ; brcc com2w1ReadNextBit_end ; clock is high now, read bit - inr r17, COM_DATA1_INPUT ; reset read timer (for leaving skipping mode) clr r16 std Y+NET_IFACE_OFFS_READTIMER, r16 @@ -566,8 +566,11 @@ COM2W1_ClkChangeIsr: push r15 in r15, SREG push r16 - inr r16, COM_CLK1_INPUT ; read clk state early - rcall COM2W1_HandleClockInterrupt + push r17 + inr r16, COM_CLK1_INPUT ; read clk state early + inr r17, COM_DATA1_INPUT ; read data state early + rcall COM2W1_HandleClockInterrupt + pop r17 pop r16 out SREG, r15 pop r15 @@ -580,6 +583,7 @@ COM2W1_ClkChangeIsr: ; @routine COM2W1_HandleClockInterrupt @global ; ; @param r16 data from COM_CLKn_INPUT +; @param r17 data from COM_DATAn_INPUT ; @clobbers none COM2W1_HandleClockInterrupt: @@ -609,20 +613,30 @@ COM2W1_HandleClockInterrupt: ; @routine com2w1ActOnClock ; ; @param r16 data from COM_CLKn_INPUT +; @param r17 data from COM_DATAn_INPUT ; @clobbers r16 (r17, r18, X) com2w1ActOnClock: andi r16, (1<