avr: fixed 1-wire protocol for multiple speeds.

fixed delays won't work with 8MHz when calibrated for 1MHz... use
wait macro instead.
This commit is contained in:
Martin Preuss
2024-10-06 01:30:52 +02:00
parent 072ed88102
commit adcb037976
2 changed files with 33 additions and 18 deletions

View File

@@ -136,7 +136,7 @@ Ds18b20_OnTimer_done:
Ds18b20_SendCommand:
mov r18, r16
rcall OwiMaster_Reset ; (r22)
rcall OwiMaster_Reset ; (r21, r22)
tst r16 ; presence detected?
breq Ds18b20_SendCommand_error ; nope, jump
@@ -166,7 +166,7 @@ Ds18b20_SendCommand_error:
; @clobbers r16, r18, r19, r23, X (r17, r20, r21, r22)
Ds18b20_ReadRom:
rcall OwiMaster_Reset ; (r22)
rcall OwiMaster_Reset ; (r21, r22)
tst r16 ; presence detected?
breq Ds18b20_ReadRom_error ; nope, jump