Change the AVRISP project's RESET LINE makefile tokens to AUX LINE, as it is not always used for target reset.
This commit is contained in:
		
							parent
							
								
									93fe420d89
								
							
						
					
					
						commit
						e1c1c25619
					
				
					 5 changed files with 36 additions and 32 deletions
				
			
		| 
						 | 
				
			
			@ -109,7 +109,7 @@
 | 
			
		|||
 *  </table>
 | 
			
		||||
 *
 | 
			
		||||
 *  <b><sup>1</sup></b> <i>Optional, see \ref SSec_Options section - for USB AVRs with ADC modules only</i> \n
 | 
			
		||||
 *  <b><sup>2</sup></b> <i>See \ref SSec_Options section</i>
 | 
			
		||||
 *  <b><sup>2</sup></b> <i>See AUX line related tokens in the \ref SSec_Options section</i>
 | 
			
		||||
 *
 | 
			
		||||
 *  \section Sec_PDI PDI Connections
 | 
			
		||||
 *  Connections to the device for PDI programming<b><sup>1</sup></b> (when enabled):
 | 
			
		||||
| 
						 | 
				
			
			@ -153,7 +153,8 @@
 | 
			
		|||
 *  </table>
 | 
			
		||||
 *
 | 
			
		||||
 *  <b><sup>1</sup></b> <i>When XPROG_VIA_HARDWARE_USART is set, the AVR's Tx and Rx become the DATA line when connected together
 | 
			
		||||
 *                         via a pair of 300 ohm resistors, and the AVR's XCK pin becomes CLOCK.</i>
 | 
			
		||||
 *                         via a pair of 300 ohm resistors, and the AVR's XCK pin becomes CLOCK.</i> \n
 | 
			
		||||
 *  <b><sup>2</sup></b> <i>See AUX line related tokens in the \ref SSec_Options section</i>
 | 
			
		||||
 *
 | 
			
		||||
 *  \section Sec_TPI TPI Connections
 | 
			
		||||
 *  Connections to the device for TPI programming<b><sup>1</sup></b> (when enabled):
 | 
			
		||||
| 
						 | 
				
			
			@ -197,7 +198,8 @@
 | 
			
		|||
 *  </table>
 | 
			
		||||
 *
 | 
			
		||||
 *  <b><sup>1</sup></b> <i>When XPROG_VIA_HARDWARE_USART is set, the AVR's Tx and Rx become the DATA line when connected together
 | 
			
		||||
 *                         via a pair of 300 ohm resistors, and the AVR's XCK pin becomes CLOCK.</i>
 | 
			
		||||
 *                         via a pair of 300 ohm resistors, and the AVR's XCK pin becomes CLOCK.</i> \n
 | 
			
		||||
 *  <b><sup>2</sup></b> <i>See AUX line related tokens in the \ref SSec_Options section</i>
 | 
			
		||||
 *
 | 
			
		||||
 *  \section SSec_Options Project Options
 | 
			
		||||
 *
 | 
			
		||||
| 
						 | 
				
			
			@ -210,27 +212,29 @@
 | 
			
		|||
 *    <td><b>Description:</b></td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td>RESET_LINE_PORT</td>
 | 
			
		||||
 *    <td>AUX_LINE_PORT</td>
 | 
			
		||||
 *    <td>Makefile CDEFS</td>
 | 
			
		||||
 *    <td>PORT register for the programmer's target RESET line. <i>Ignored when compiled for the XPLAIN board.</i></td>
 | 
			
		||||
 *    <td>PORT register for the programmer's AUX target line. The use of this line varies between the programming protocols,
 | 
			
		||||
 *        but is generally used for the target's /RESET line. <i>Ignored when compiled for the XPLAIN board.</i></td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td>RESET_LINE_PIN</td>
 | 
			
		||||
 *    <td>AUX_LINE_PIN</td>
 | 
			
		||||
 *    <td>Makefile CDEFS</td>
 | 
			
		||||
 *    <td>PIN register for the programmer's target RESET line. <i>Ignored when compiled for the XPLAIN board.</i></td>
 | 
			
		||||
 *    <td>PIN register for the programmer's AUX target line. The use of this line varies between the programming protocols,
 | 
			
		||||
 *        but is generally used for the target's /RESET line. <i>Ignored when compiled for the XPLAIN board.</i></td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td>RESET_LINE_DDR</td>
 | 
			
		||||
 *    <td>AUX_LINE_DDR</td>
 | 
			
		||||
 *    <td>Makefile CDEFS</td>
 | 
			
		||||
 *    <td>DDR register for the programmer's target RESET line. <i>Ignored when compiled for the XPLAIN board.</i></td>
 | 
			
		||||
 *    <td>DDR register for the programmer's AUX target line. The use of this line varies between the programming protocols,
 | 
			
		||||
 *        but is generally used for the target's /RESET line. <i>Ignored when compiled for the XPLAIN board.</i></td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td>RESET_LINE_MASK</td>
 | 
			
		||||
 *    <td>AUX_LINE_MASK</td>
 | 
			
		||||
 *    <td>Makefile CDEFS</td>
 | 
			
		||||
 *    <td>Mask for the programmer's target RESET line on the chosen port. <b>Must not be the AVR's /SS pin</b>, as the
 | 
			
		||||
 *        target pins are tri-stated when not in use, and low signals on the /SS pin will force SPI slave mode when the
 | 
			
		||||
 *        pin is configured as an input. When in PDI programming mode, this is the target clock pin.
 | 
			
		||||
 *        <i>Ignored when compiled for the XPLAIN board.</i></td>
 | 
			
		||||
 *    <td>Mask for the programmer's AUX target line. The use of this line varies between the programming protocols,
 | 
			
		||||
 *        but is generally used for the target's /RESET line. <b>Must not be the AVR's /SS pin</b>. <i>Ignored when
 | 
			
		||||
 *        compiled for the XPLAIN board.</i></td>
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *   <tr>
 | 
			
		||||
 *    <td>VTARGET_ADC_CHANNEL</td>
 | 
			
		||||
| 
						 | 
				
			
			@ -252,7 +256,7 @@
 | 
			
		|||
 *    <td>Makefile CDEFS</td>
 | 
			
		||||
 *    <td>Define to force the PDI and TPI protocols (when enabled) to use the much faster hardware USART instead of bit-banging
 | 
			
		||||
 *        to match the official AVRISP pinout. This breaks pinout compatibility with the official AVRISP MKII (and requires 
 | 
			
		||||
 *        seperate ISP and PDI/TPI programming headers) but increases programming speed dramatically.
 | 
			
		||||
 *        seperate ISP, PDI, and TPI programming headers) but increases programming speed dramatically.
 | 
			
		||||
 *        <i>Ignored when compiled for the XPLAIN board.</i></td>  
 | 
			
		||||
 *   </tr>
 | 
			
		||||
 *  </table>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -84,15 +84,15 @@ void ISPTarget_ChangeTargetResetLine(const bool ResetTarget)
 | 
			
		|||
{
 | 
			
		||||
	if (ResetTarget)
 | 
			
		||||
	{
 | 
			
		||||
		RESET_LINE_DDR |= RESET_LINE_MASK;
 | 
			
		||||
		AUX_LINE_DDR |= AUX_LINE_MASK;
 | 
			
		||||
		
 | 
			
		||||
		if (!(V2Params_GetParameterValue(PARAM_RESET_POLARITY)))
 | 
			
		||||
		  RESET_LINE_PORT |= RESET_LINE_MASK;
 | 
			
		||||
		  AUX_LINE_PORT |= AUX_LINE_MASK;
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
	{
 | 
			
		||||
		RESET_LINE_DDR  &= ~RESET_LINE_MASK;
 | 
			
		||||
		RESET_LINE_PORT &= ~RESET_LINE_MASK;
 | 
			
		||||
		AUX_LINE_DDR  &= ~AUX_LINE_MASK;
 | 
			
		||||
		AUX_LINE_PORT &= ~AUX_LINE_MASK;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -144,7 +144,7 @@ uint8_t ISPTarget_WaitForProgComplete(const uint8_t ProgrammingMode, const uint1
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
/** Waits until the target has completed the last operation, by continuously polling the device's
 | 
			
		||||
 *  BUSY flag until it is cleared, or until the \ref TARGET_BUSY_TIMEOUT_MS timeout period has expired.
 | 
			
		||||
 *  BUSY flag until it is cleared, or until the command timeout period has expired.
 | 
			
		||||
 *
 | 
			
		||||
 *  \return V2 Protocol status \ref STATUS_CMD_OK if the no timeout occurred, \ref STATUS_RDY_BSY_TOUT otherwise
 | 
			
		||||
 */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -189,8 +189,8 @@ void XPROGTarget_EnableTargetTPI(void)
 | 
			
		|||
	IsSending = false;
 | 
			
		||||
 | 
			
		||||
	/* Set /RESET line low for at least 90ns to enable TPI functionality */
 | 
			
		||||
	RESET_LINE_DDR  |= RESET_LINE_MASK;
 | 
			
		||||
	RESET_LINE_PORT &= ~RESET_LINE_MASK;
 | 
			
		||||
	AUX_LINE_DDR  |=  AUX_LINE_MASK;
 | 
			
		||||
	AUX_LINE_PORT &= ~AUX_LINE_MASK;
 | 
			
		||||
	asm volatile ("NOP"::);
 | 
			
		||||
	asm volatile ("NOP"::);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -269,8 +269,8 @@ void XPROGTarget_DisableTargetTPI(void)
 | 
			
		|||
#endif
 | 
			
		||||
 | 
			
		||||
	/* Tristate target /RESET line */
 | 
			
		||||
	RESET_LINE_DDR  &= ~RESET_LINE_MASK;
 | 
			
		||||
	RESET_LINE_PORT &= ~RESET_LINE_MASK;
 | 
			
		||||
	AUX_LINE_DDR  &= ~AUX_LINE_MASK;
 | 
			
		||||
	AUX_LINE_PORT &= ~AUX_LINE_MASK;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/** Sends a byte via the USART.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -63,10 +63,10 @@
 | 
			
		|||
			#define BITBANG_PDIDATA_PIN      PINB
 | 
			
		||||
			#define BITBANG_PDIDATA_MASK     (1 << 3)
 | 
			
		||||
			
 | 
			
		||||
			#define BITBANG_PDICLOCK_PORT    RESET_LINE_PORT
 | 
			
		||||
			#define BITBANG_PDICLOCK_DDR     RESET_LINE_DDR
 | 
			
		||||
			#define BITBANG_PDICLOCK_PIN     RESET_LINE_PIN
 | 
			
		||||
			#define BITBANG_PDICLOCK_MASK    RESET_LINE_MASK
 | 
			
		||||
			#define BITBANG_PDICLOCK_PORT    AUX_LINE_PORT
 | 
			
		||||
			#define BITBANG_PDICLOCK_DDR     AUX_LINE_DDR
 | 
			
		||||
			#define BITBANG_PDICLOCK_PIN     AUX_LINE_PIN
 | 
			
		||||
			#define BITBANG_PDICLOCK_MASK    AUX_LINE_MASK
 | 
			
		||||
 | 
			
		||||
			#define BITBANG_TPIDATA_PORT     PORTB
 | 
			
		||||
			#define BITBANG_TPIDATA_DDR      DDRB
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -191,10 +191,10 @@ CSTANDARD = -std=gnu99
 | 
			
		|||
 | 
			
		||||
# Place -D or -U options here for C sources
 | 
			
		||||
CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)
 | 
			
		||||
CDEFS += -DRESET_LINE_PORT=PORTB
 | 
			
		||||
CDEFS += -DRESET_LINE_PIN=PINB
 | 
			
		||||
CDEFS += -DRESET_LINE_DDR=DDRB
 | 
			
		||||
CDEFS += -DRESET_LINE_MASK="(1 << 4)"
 | 
			
		||||
CDEFS += -DAUX_LINE_PORT=PORTB
 | 
			
		||||
CDEFS += -DAUX_LINE_PIN=PINB
 | 
			
		||||
CDEFS += -DAUX_LINE_DDR=DDRB
 | 
			
		||||
CDEFS += -DAUX_LINE_MASK="(1 << 4)"
 | 
			
		||||
CDEFS += -DVTARGET_ADC_CHANNEL=2
 | 
			
		||||
CDEFS += -DENABLE_ISP_PROTOCOL
 | 
			
		||||
CDEFS += -DENABLE_XPROG_PROTOCOL
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue