diff options
author | Drashna Jaelre <drashna@live.com> | 2019-07-03 07:54:39 -0700 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2019-07-03 07:54:49 -0700 |
commit | 110622eaa2787cc54818083d4243653b088e5b5a (patch) | |
tree | b1637e4dc8d8aa13e9face4998cf25ae620361e5 /Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c | |
parent | d0fd80affba97b37eb00c650e87cb5982a4f260e (diff) | |
parent | 5ba628d10b54d58d445896290ba9799bd76a73b3 (diff) | |
download | lufa-110622eaa2787cc54818083d4243653b088e5b5a.tar.gz lufa-110622eaa2787cc54818083d4243653b088e5b5a.tar.bz2 lufa-110622eaa2787cc54818083d4243653b088e5b5a.zip |
Merge remote-tracking branch 'abcminiuser/master'
Diffstat (limited to 'Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c')
-rw-r--r-- | Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c b/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c index 0455329c3..3e1955c8b 100644 --- a/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c +++ b/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -39,7 +39,7 @@ #if defined(ENABLE_XPROG_PROTOCOL) || defined(__DOXYGEN__) /** Flag to indicate if the USART is currently in Tx or Rx mode. */ -bool IsSending; +static bool IsSending; /** Enables the target's PDI interface, holding the target in reset until PDI mode is exited. */ void XPROGTarget_EnableTargetPDI(void) @@ -50,10 +50,15 @@ void XPROGTarget_EnableTargetPDI(void) DDRD |= (1 << 5) | (1 << 3); DDRD &= ~(1 << 2); - /* Set DATA line high for at least 90ns to disable /RESET functionality */ - PORTD |= (1 << 3); + /* Set Tx (PDI CLOCK) high, DATA line low for at least 90ns to disable /RESET functionality */ + PORTD |= (1 << 5); + PORTD &= ~(1 << 3); _delay_us(100); + /* Set DATA line high (enables PDI interface after 16 PDI CLK cycles) */ + PORTD |= (1 << 3); + _delay_us(20); + /* Set up the synchronous USART for XMEGA communications - 8 data bits, even parity, 2 stop bits */ UBRR1 = ((F_CPU / 2 / XPROG_HARDWARE_SPEED) - 1); UCSR1B = (1 << TXEN1); |