From 461607020c443b4be5e59f38e26d33908aa0f326 Mon Sep 17 00:00:00 2001
From: Dean Camera <dean@fourwalledcubicle.com>
Date: Wed, 16 Dec 2009 03:17:18 +0000
Subject: [PATCH] Use default NVM base address in the AVRISP programmer project
 in case the host programmer software doesn't set it correctly.

---
 LUFA/ManPages/ChangeLog.txt       | 2 +-
 Projects/AVRISP/Lib/PDIProtocol.c | 2 +-
 Projects/AVRISP/Lib/PDITarget.c   | 7 ++++---
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/LUFA/ManPages/ChangeLog.txt b/LUFA/ManPages/ChangeLog.txt
index a8502f357..4769919f2 100644
--- a/LUFA/ManPages/ChangeLog.txt
+++ b/LUFA/ManPages/ChangeLog.txt
@@ -61,7 +61,7 @@
   *  - Fixed the definition of the Endpoint_BytesInEndpoint() macro for the U4 series AVR parts
   *  - Fixed MIDI host Class driver MIDI_Host_SendEventPacket() routine not properly checking for Pipe ready before writing
   *  - Fixed use of deprecated struct initializers, removed library unused parameter warnings when compiled with -Wextra enabled
-  *  - Fixed Still Image Host Class driver truncating the PIMA response code (thanks to Daniel)
+  *  - Fixed Still Image Host Class driver truncating the PIMA response code (thanks to Daniel Seibert)
   *
   *  \section Sec_ChangeLog091122 Version 091122
   *
diff --git a/Projects/AVRISP/Lib/PDIProtocol.c b/Projects/AVRISP/Lib/PDIProtocol.c
index 1b3fc53c4..43370c730 100644
--- a/Projects/AVRISP/Lib/PDIProtocol.c
+++ b/Projects/AVRISP/Lib/PDIProtocol.c
@@ -38,7 +38,7 @@
 
 #if defined(ENABLE_PDI_PROTOCOL) || defined(__DOXYGEN__)
 /** Base absolute address for the target's NVM controller */
-uint32_t XPROG_Param_NVMBase;
+uint32_t XPROG_Param_NVMBase = 0x010001C0;
 
 /** Size in bytes of the target's EEPROM page */
 uint32_t XPROG_Param_EEPageSize;
diff --git a/Projects/AVRISP/Lib/PDITarget.c b/Projects/AVRISP/Lib/PDITarget.c
index 1bbb4d577..a8fe21e9b 100644
--- a/Projects/AVRISP/Lib/PDITarget.c
+++ b/Projects/AVRISP/Lib/PDITarget.c
@@ -39,14 +39,15 @@
 #if defined(ENABLE_PDI_PROTOCOL) || defined(__DOXYGEN__)
 
 /** Flag to indicate if the USART is currently in Tx or Rx mode. */
-volatile bool     IsSending;
+volatile bool               IsSending;
 
 #if !defined(PDI_VIA_HARDWARE_USART)
 /** Software USART raw frame bits for transmission/reception. */
-volatile uint16_t SoftUSART_Data;
+volatile uint16_t           SoftUSART_Data;
 
 /** Bits remaining to be sent or received via the software USART - set as a GPIOR for speed. */
-#define SoftUSART_BitCount   GPIOR2
+#define SoftUSART_BitCount  GPIOR2
+
 
 /** ISR to manage the software USART when bit-banged USART mode is selected. */
 ISR(TIMER1_COMPA_vect, ISR_BLOCK)
-- 
GitLab