projects
/
pub
/
USBasp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
7d51e51
)
Software PDI mode breaks unless the software USART has 100 cycles between bits.
author
Dean Camera
<dean@fourwalledcubicle.com>
Wed, 17 Mar 2010 11:48:39 +0000
(11:48 +0000)
committer
Dean Camera
<dean@fourwalledcubicle.com>
Wed, 17 Mar 2010 11:48:39 +0000
(11:48 +0000)
Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c
patch
|
blob
|
blame
|
history
LUFA/Drivers/USB/LowLevel/Pipe.c
patch
|
blob
|
blame
|
history
LUFA/ManPages/ChangeLog.txt
patch
|
blob
|
blame
|
history
Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c
patch
|
blob
|
blame
|
history
Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
patch
|
blob
|
blame
|
history
Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c
patch
|
blob
|
blame
|
history
Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.h
patch
|
blob
|
blame
|
history
Projects/AVRISP-MKII/makefile
patch
|
blob
|
blame
|
history
diff --git
a/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c
b/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c
index
b641185
..
6339a92
100644
(file)
--- a/
Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c
+++ b/
Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c
@@
-147,7
+147,7
@@
int main(void)
(ReportItem->Attributes.Usage.Usage == USAGE_SCROLL_WHEEL) &&
\r
(ReportItem->ItemType == REPORT_ITEM_TYPE_In))
\r
{
\r
(ReportItem->Attributes.Usage.Usage == USAGE_SCROLL_WHEEL) &&
\r
(ReportItem->ItemType == REPORT_ITEM_TYPE_In))
\r
{
\r
- int16_t WheelDelta =
(int16_t)(ReportItem->Value << (16 - ReportItem->Attributes.BitSize)
);
\r
+ int16_t WheelDelta =
HID_ALIGN_DATA(ReportItem->Value, int16_t
);
\r
\r
if (WheelDelta)
\r
LEDMask = (LEDS_LED1 | LEDS_LED2 | ((WheelDelta > 0) ? LEDS_LED3 : LEDS_LED4));
\r
\r
if (WheelDelta)
\r
LEDMask = (LEDS_LED1 | LEDS_LED2 | ((WheelDelta > 0) ? LEDS_LED3 : LEDS_LED4));
\r
@@
-157,7
+157,7
@@
int main(void)
(ReportItem->Attributes.Usage.Usage == USAGE_Y)) &&
\r
(ReportItem->ItemType == REPORT_ITEM_TYPE_In))
\r
{
\r
(ReportItem->Attributes.Usage.Usage == USAGE_Y)) &&
\r
(ReportItem->ItemType == REPORT_ITEM_TYPE_In))
\r
{
\r
- int16_t DeltaMovement =
(int16_t)(ReportItem->Value << (16 - ReportItem->Attributes.BitSize)
);
\r
+ int16_t DeltaMovement =
HID_ALIGN_DATA(ReportItem->Value, int16_t
);
\r
\r
if (ReportItem->Attributes.Usage.Usage == USAGE_X)
\r
{
\r
\r
if (ReportItem->Attributes.Usage.Usage == USAGE_X)
\r
{
\r
diff --git
a/LUFA/Drivers/USB/LowLevel/Pipe.c
b/LUFA/Drivers/USB/LowLevel/Pipe.c
index
78c82e8
..
8784bea
100644
(file)
--- a/
LUFA/Drivers/USB/LowLevel/Pipe.c
+++ b/
LUFA/Drivers/USB/LowLevel/Pipe.c
@@
-80,14
+80,13
@@
bool Pipe_IsEndpointBound(const uint8_t EndpointAddress)
Pipe_SelectPipe(PNum);
\r
\r
uint8_t PipeToken = Pipe_GetPipeToken();
\r
Pipe_SelectPipe(PNum);
\r
\r
uint8_t PipeToken = Pipe_GetPipeToken();
\r
+ bool PipeTokenCorrect = true;
\r
\r
if (PipeToken != PIPE_TOKEN_SETUP)
\r
\r
if (PipeToken != PIPE_TOKEN_SETUP)
\r
- PipeToken = (PipeToken == ((EndpointAddress & PIPE_EPDIR_MASK) ? PIPE_TOKEN_IN : PIPE_TOKEN_OUT));
\r
+ PipeToken
Correct
= (PipeToken == ((EndpointAddress & PIPE_EPDIR_MASK) ? PIPE_TOKEN_IN : PIPE_TOKEN_OUT));
\r
\r
\r
- if (Pipe_IsConfigured() && (Pipe_BoundEndpointNumber() == (EndpointAddress & PIPE_EPNUM_MASK)) && PipeToken)
\r
- {
\r
- return true;
\r
- }
\r
+ if (Pipe_IsConfigured() && PipeTokenCorrect && (Pipe_BoundEndpointNumber() == (EndpointAddress & PIPE_EPNUM_MASK)))
\r
+ return true;
\r
}
\r
\r
Pipe_SelectPipe(PrevPipeNumber);
\r
}
\r
\r
Pipe_SelectPipe(PrevPipeNumber);
\r
diff --git
a/LUFA/ManPages/ChangeLog.txt
b/LUFA/ManPages/ChangeLog.txt
index
b776175
..
8ce9f22
100644
(file)
--- a/
LUFA/ManPages/ChangeLog.txt
+++ b/
LUFA/ManPages/ChangeLog.txt
@@
-27,8
+27,6
@@
* - Fixed ADC routines not correctly returning the last result when multiple channels were read
\r
* - Fixed ADC routines failing to read the extended channels (Channels 8 to 13, Internal Temperature Sensor) on the
\r
* U4 series USB AVR parts
\r
* - Fixed ADC routines not correctly returning the last result when multiple channels were read
\r
* - Fixed ADC routines failing to read the extended channels (Channels 8 to 13, Internal Temperature Sensor) on the
\r
* U4 series USB AVR parts
\r
- * - Fixed PDI programming mode in the AVRISP programmer project not exiting programming mode correctly (clear target
\r
- * Reset key twice, possible silicon bug?)
\r
*
\r
* \section Sec_ChangeLog100219 Version 100219
\r
*
\r
*
\r
* \section Sec_ChangeLog100219 Version 100219
\r
*
\r
diff --git
a/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c
b/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c
index
a894793
..
c0f04c6
100644
(file)
--- a/
Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c
+++ b/
Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c
@@
-65,7
+65,7
@@
static void TINYNVM_SendReadNVMRegister(const uint8_t Address)
*/
\r
static void TINYNVM_SendWriteNVMRegister(const uint8_t Address)
\r
{
\r
*/
\r
static void TINYNVM_SendWriteNVMRegister(const uint8_t Address)
\r
{
\r
- /* The TPI command for
writing to the I/O space uses weird
addressing, where the I/O address's upper
\r
+ /* The TPI command for
reading from the I/O space uses strange
addressing, where the I/O address's upper
\r
* two bits of the 6-bit address are shifted left once */
\r
XPROGTarget_SendByte(TPI_CMD_SOUT | ((Address & 0x30) << 1) | (Address & 0x0F));
\r
}
\r
* two bits of the 6-bit address are shifted left once */
\r
XPROGTarget_SendByte(TPI_CMD_SOUT | ((Address & 0x30) << 1) | (Address & 0x0F));
\r
}
\r
diff --git
a/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
b/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
index
08936a2
..
07dce50
100644
(file)
--- a/
Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
+++ b/
Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
@@
-175,10
+175,6
@@
static void XPROGProtocol_LeaveXPROGMode(void)
/* Clear the RESET key in the RESET PDI register to allow the XMEGA to run */
\r
XPROGTarget_SendByte(PDI_CMD_STCS | PDI_RESET_REG);
\r
XPROGTarget_SendByte(0x00);
\r
/* Clear the RESET key in the RESET PDI register to allow the XMEGA to run */
\r
XPROGTarget_SendByte(PDI_CMD_STCS | PDI_RESET_REG);
\r
XPROGTarget_SendByte(0x00);
\r
-
\r
- /* Clear /RESET key twice (for some reason this needs to be done twice to take effect) */
\r
- XPROGTarget_SendByte(PDI_CMD_STCS | PDI_RESET_REG);
\r
- XPROGTarget_SendByte(0x00);
\r
\r
XPROGTarget_DisableTargetPDI();
\r
}
\r
\r
XPROGTarget_DisableTargetPDI();
\r
}
\r
diff --git
a/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c
b/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c
index
3a74e15
..
15467fe
100644
(file)
--- a/
Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c
+++ b/
Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c
@@
-162,7
+162,7
@@
void XPROGTarget_EnableTargetPDI(void)
\r
/* Set up the synchronous USART for XMEGA communications -
\r
8 data bits, even parity, 2 stop bits */
\r
\r
/* Set up the synchronous USART for XMEGA communications -
\r
8 data bits, even parity, 2 stop bits */
\r
- UBRR1 = (F_CPU /
500000UL
);
\r
+ UBRR1 = (F_CPU /
XPROG_HARDWARE_SPEED
);
\r
UCSR1B = (1 << TXEN1);
\r
UCSR1C = (1 << UMSEL10) | (1 << UPM11) | (1 << USBS1) | (1 << UCSZ11) | (1 << UCSZ10) | (1 << UCPOL1);
\r
#else
\r
UCSR1B = (1 << TXEN1);
\r
UCSR1C = (1 << UMSEL10) | (1 << UPM11) | (1 << USBS1) | (1 << UCSZ11) | (1 << UCSZ10) | (1 << UCPOL1);
\r
#else
\r
@@
-203,7
+203,7
@@
void XPROGTarget_EnableTargetTPI(void)
\r
/* Set up the synchronous USART for TINY communications -
\r
8 data bits, even parity, 2 stop bits */
\r
\r
/* Set up the synchronous USART for TINY communications -
\r
8 data bits, even parity, 2 stop bits */
\r
- UBRR1 = (F_CPU /
500000UL
);
\r
+ UBRR1 = (F_CPU /
XPROG_HARDWARE_SPEED
);
\r
UCSR1B = (1 << TXEN1);
\r
UCSR1C = (1 << UMSEL10) | (1 << UPM11) | (1 << USBS1) | (1 << UCSZ11) | (1 << UCSZ10) | (1 << UCPOL1);
\r
#else
\r
UCSR1B = (1 << TXEN1);
\r
UCSR1C = (1 << UMSEL10) | (1 << UPM11) | (1 << USBS1) | (1 << UCSZ11) | (1 << UCSZ10) | (1 << UCPOL1);
\r
#else
\r
@@
-239,16
+239,18
@@
void XPROGTarget_DisableTargetPDI(void)
\r
/* Tristate all pins */
\r
DDRD &= ~((1 << 5) | (1 << 3));
\r
\r
/* Tristate all pins */
\r
DDRD &= ~((1 << 5) | (1 << 3));
\r
- PORTD &= ~((1 << 3) | (1 << 2));
\r
+ PORTD &= ~((1 <<
5) | (1 <<
3) | (1 << 2));
\r
#else
\r
/* Turn off software USART management timer */
\r
TCCR1B = 0;
\r
\r
#else
\r
/* Turn off software USART management timer */
\r
TCCR1B = 0;
\r
\r
- /*
Tristate all pin
s */
\r
+ /*
Set DATA and CLOCK lines to input
s */
\r
BITBANG_PDIDATA_DDR &= ~BITBANG_PDIDATA_MASK;
\r
BITBANG_PDICLOCK_DDR &= ~BITBANG_PDICLOCK_MASK;
\r
BITBANG_PDIDATA_DDR &= ~BITBANG_PDIDATA_MASK;
\r
BITBANG_PDICLOCK_DDR &= ~BITBANG_PDICLOCK_MASK;
\r
- BITBANG_PDICLOCK_PORT &= ~BITBANG_PDICLOCK_MASK;
\r
+
\r
+ /* Tristate DATA and CLOCK lines */
\r
BITBANG_PDIDATA_PORT &= ~BITBANG_PDIDATA_MASK;
\r
BITBANG_PDIDATA_PORT &= ~BITBANG_PDIDATA_MASK;
\r
+ BITBANG_PDICLOCK_PORT &= ~BITBANG_PDICLOCK_MASK;
\r
#endif
\r
}
\r
\r
#endif
\r
}
\r
\r
diff --git
a/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.h
b/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.h
index
0c54ad4
..
7166c10
100644
(file)
--- a/
Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.h
+++ b/
Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.h
@@
-58,7
+58,7
@@
/* Defines: */
\r
#if ((BOARD == BOARD_XPLAIN) || (BOARD == BOARD_XPLAIN_REV1))
\r
#define XPROG_VIA_HARDWARE_USART
\r
/* Defines: */
\r
#if ((BOARD == BOARD_XPLAIN) || (BOARD == BOARD_XPLAIN_REV1))
\r
#define XPROG_VIA_HARDWARE_USART
\r
- #else
\r
+ #else
\r
#define BITBANG_PDIDATA_PORT PORTB
\r
#define BITBANG_PDIDATA_DDR DDRB
\r
#define BITBANG_PDIDATA_PIN PINB
\r
#define BITBANG_PDIDATA_PORT PORTB
\r
#define BITBANG_PDIDATA_DDR DDRB
\r
#define BITBANG_PDIDATA_PIN PINB
\r
@@
-80,8
+80,11
@@
#define BITBANG_TPICLOCK_MASK (1 << 1)
\r
#endif
\r
\r
#define BITBANG_TPICLOCK_MASK (1 << 1)
\r
#endif
\r
\r
+ /** Serial carrier TPI/PDI speed when hardware TPI/PDI mode is used */
\r
+ #define XPROG_HARDWARE_SPEED 500000
\r
+
\r
/** Number of cycles between each clock when software USART mode is used */
\r
/** Number of cycles between each clock when software USART mode is used */
\r
- #define BITS_BETWEEN_USART_CLOCKS
8
0
\r
+ #define BITS_BETWEEN_USART_CLOCKS
10
0
\r
\r
/** Total number of bits in a single USART frame */
\r
#define BITS_IN_USART_FRAME 12
\r
\r
/** Total number of bits in a single USART frame */
\r
#define BITS_IN_USART_FRAME 12
\r
diff --git
a/Projects/AVRISP-MKII/makefile
b/Projects/AVRISP-MKII/makefile
index
b2c139c
..
b0b26c2
100644
(file)
--- a/
Projects/AVRISP-MKII/makefile
+++ b/
Projects/AVRISP-MKII/makefile
@@
-66,7
+66,7
@@
MCU = at90usb1287
# Target board (see library "Board Types" documentation, NONE for projects not requiring
\r
# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
\r
# "Board" inside the application directory.
\r
# Target board (see library "Board Types" documentation, NONE for projects not requiring
\r
# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
\r
# "Board" inside the application directory.
\r
-BOARD =
XPLAIN
\r
+BOARD =
USBKEY
\r
\r
\r
# Processor frequency.
\r
\r
\r
# Processor frequency.
\r