Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Erik Strand
lufa
Commits
9a5ae36a
Commit
9a5ae36a
authored
Mar 17, 2010
by
Dean Camera
Browse files
Software PDI mode breaks unless the software USART has 100 cycles between bits.
parent
7d51e51c
Changes
8
Show whitespace changes
Inline
Side-by-side
Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c
View file @
9a5ae36a
...
...
@@ -147,7 +147,7 @@ int main(void)
(
ReportItem
->
Attributes
.
Usage
.
Usage
==
USAGE_SCROLL_WHEEL
)
&&
(
ReportItem
->
ItemType
==
REPORT_ITEM_TYPE_In
))
{
int16_t
WheelDelta
=
(
int16_t
)
(
ReportItem
->
Value
<<
(
16
-
ReportItem
->
Attributes
.
BitSize
)
);
int16_t
WheelDelta
=
HID_ALIGN_DATA
(
ReportItem
->
Value
,
int16_t
);
if
(
WheelDelta
)
LEDMask
=
(
LEDS_LED1
|
LEDS_LED2
|
((
WheelDelta
>
0
)
?
LEDS_LED3
:
LEDS_LED4
));
...
...
@@ -157,7 +157,7 @@ int main(void)
(
ReportItem
->
Attributes
.
Usage
.
Usage
==
USAGE_Y
))
&&
(
ReportItem
->
ItemType
==
REPORT_ITEM_TYPE_In
))
{
int16_t
DeltaMovement
=
(
int16_t
)
(
ReportItem
->
Value
<<
(
16
-
ReportItem
->
Attributes
.
BitSize
)
);
int16_t
DeltaMovement
=
HID_ALIGN_DATA
(
ReportItem
->
Value
,
int16_t
);
if
(
ReportItem
->
Attributes
.
Usage
.
Usage
==
USAGE_X
)
{
...
...
LUFA/Drivers/USB/LowLevel/Pipe.c
View file @
9a5ae36a
...
...
@@ -80,15 +80,14 @@ bool Pipe_IsEndpointBound(const uint8_t EndpointAddress)
Pipe_SelectPipe
(
PNum
);
uint8_t
PipeToken
=
Pipe_GetPipeToken
();
bool
PipeTokenCorrect
=
true
;
if
(
PipeToken
!=
PIPE_TOKEN_SETUP
)
PipeToken
=
(
PipeToken
==
((
EndpointAddress
&
PIPE_EPDIR_MASK
)
?
PIPE_TOKEN_IN
:
PIPE_TOKEN_OUT
));
PipeToken
Correct
=
(
PipeToken
==
((
EndpointAddress
&
PIPE_EPDIR_MASK
)
?
PIPE_TOKEN_IN
:
PIPE_TOKEN_OUT
));
if
(
Pipe_IsConfigured
()
&&
(
Pipe_BoundEndpointNumber
()
==
(
EndpointAddress
&
PIPE_EPNUM_MASK
))
&&
PipeToken
)
{
if
(
Pipe_IsConfigured
()
&&
PipeTokenCorrect
&&
(
Pipe_BoundEndpointNumber
()
==
(
EndpointAddress
&
PIPE_EPNUM_MASK
)))
return
true
;
}
}
Pipe_SelectPipe
(
PrevPipeNumber
);
return
false
;
...
...
LUFA/ManPages/ChangeLog.txt
View file @
9a5ae36a
...
...
@@ -27,8 +27,6 @@
* - Fixed ADC routines not correctly returning the last result when multiple channels were read
* - Fixed ADC routines failing to read the extended channels (Channels 8 to 13, Internal Temperature Sensor) on the
* U4 series USB AVR parts
* - Fixed PDI programming mode in the AVRISP programmer project not exiting programming mode correctly (clear target
* Reset key twice, possible silicon bug?)
*
* \section Sec_ChangeLog100219 Version 100219
*
...
...
Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c
View file @
9a5ae36a
...
...
@@ -65,7 +65,7 @@ static void TINYNVM_SendReadNVMRegister(const uint8_t Address)
*/
static
void
TINYNVM_SendWriteNVMRegister
(
const
uint8_t
Address
)
{
/* The TPI command for
writing to
the I/O space uses
weird
addressing, where the I/O address's upper
/* The TPI command for
reading from
the I/O space uses
strange
addressing, where the I/O address's upper
* two bits of the 6-bit address are shifted left once */
XPROGTarget_SendByte
(
TPI_CMD_SOUT
|
((
Address
&
0x30
)
<<
1
)
|
(
Address
&
0x0F
));
}
...
...
Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c
View file @
9a5ae36a
...
...
@@ -176,10 +176,6 @@ static void XPROGProtocol_LeaveXPROGMode(void)
XPROGTarget_SendByte
(
PDI_CMD_STCS
|
PDI_RESET_REG
);
XPROGTarget_SendByte
(
0x00
);
/* Clear /RESET key twice (for some reason this needs to be done twice to take effect) */
XPROGTarget_SendByte
(
PDI_CMD_STCS
|
PDI_RESET_REG
);
XPROGTarget_SendByte
(
0x00
);
XPROGTarget_DisableTargetPDI
();
}
else
...
...
Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c
View file @
9a5ae36a
...
...
@@ -162,7 +162,7 @@ void XPROGTarget_EnableTargetPDI(void)
/* Set up the synchronous USART for XMEGA communications -
8 data bits, even parity, 2 stop bits */
UBRR1
=
(
F_CPU
/
500000UL
);
UBRR1
=
(
F_CPU
/
XPROG_HARDWARE_SPEED
);
UCSR1B
=
(
1
<<
TXEN1
);
UCSR1C
=
(
1
<<
UMSEL10
)
|
(
1
<<
UPM11
)
|
(
1
<<
USBS1
)
|
(
1
<<
UCSZ11
)
|
(
1
<<
UCSZ10
)
|
(
1
<<
UCPOL1
);
#else
...
...
@@ -203,7 +203,7 @@ void XPROGTarget_EnableTargetTPI(void)
/* Set up the synchronous USART for TINY communications -
8 data bits, even parity, 2 stop bits */
UBRR1
=
(
F_CPU
/
500000UL
);
UBRR1
=
(
F_CPU
/
XPROG_HARDWARE_SPEED
);
UCSR1B
=
(
1
<<
TXEN1
);
UCSR1C
=
(
1
<<
UMSEL10
)
|
(
1
<<
UPM11
)
|
(
1
<<
USBS1
)
|
(
1
<<
UCSZ11
)
|
(
1
<<
UCSZ10
)
|
(
1
<<
UCPOL1
);
#else
...
...
@@ -239,16 +239,18 @@ void XPROGTarget_DisableTargetPDI(void)
/* Tristate all pins */
DDRD
&=
~
((
1
<<
5
)
|
(
1
<<
3
));
PORTD
&=
~
((
1
<<
3
)
|
(
1
<<
2
));
PORTD
&=
~
((
1
<<
5
)
|
(
1
<<
3
)
|
(
1
<<
2
));
#else
/* Turn off software USART management timer */
TCCR1B
=
0
;
/*
Tristate all pin
s */
/*
Set DATA and CLOCK lines to input
s */
BITBANG_PDIDATA_DDR
&=
~
BITBANG_PDIDATA_MASK
;
BITBANG_PDICLOCK_DDR
&=
~
BITBANG_PDICLOCK_MASK
;
BITBANG_PDICLOCK_PORT
&=
~
BITBANG_PDICLOCK_MASK
;
/* Tristate DATA and CLOCK lines */
BITBANG_PDIDATA_PORT
&=
~
BITBANG_PDIDATA_MASK
;
BITBANG_PDICLOCK_PORT
&=
~
BITBANG_PDICLOCK_MASK
;
#endif
}
...
...
Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.h
View file @
9a5ae36a
...
...
@@ -80,8 +80,11 @@
#define BITBANG_TPICLOCK_MASK (1 << 1)
#endif
/** Serial carrier TPI/PDI speed when hardware TPI/PDI mode is used */
#define XPROG_HARDWARE_SPEED 500000
/** Number of cycles between each clock when software USART mode is used */
#define BITS_BETWEEN_USART_CLOCKS
8
0
#define BITS_BETWEEN_USART_CLOCKS
10
0
/** Total number of bits in a single USART frame */
#define BITS_IN_USART_FRAME 12
...
...
Projects/AVRISP-MKII/makefile
View file @
9a5ae36a
...
...
@@ -66,7 +66,7 @@ MCU = at90usb1287
# Target board (see library "Board Types" documentation, NONE for projects not requiring
# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
# "Board" inside the application directory.
BOARD
=
XPLAIN
BOARD
=
USBKEY
# Processor frequency.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment