sejf-ng/0001-Disable-RS485-transceiver-when-running-the-bootloade.patch

29 lines
861 B
Diff

From e2ff1e8bf05f0f8677e57c91b8cea78551f99413 Mon Sep 17 00:00:00 2001
From: Piotr Dobrowolski <admin@tastycode.pl>
Date: Mon, 25 Feb 2019 10:57:44 +0100
Subject: [PATCH] Disable RS485 transceiver when running the bootloader
---
optiboot/bootloaders/optiboot/optiboot.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/optiboot/bootloaders/optiboot/optiboot.c b/optiboot/bootloaders/optiboot/optiboot.c
index 9a2c80b..2bae2a8 100644
--- a/optiboot/bootloaders/optiboot/optiboot.c
+++ b/optiboot/bootloaders/optiboot/optiboot.c
@@ -690,6 +690,11 @@ int main(void) {
#endif
#endif
+ /* 2019/02/24 inf - disable rs485 transceiver */
+ PORTD &= ~_BV(3); // 0b1000;
+ PORTD |= _BV(2); // 0b0100;
+ DDRD |= _BV(2) | _BV(3); // 0b1100;
+
/* Forever loop: exits by causing WDT reset */
for (;;) {
/* get character from UART */
--
2.29.2