Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lufa
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Erik Strand
lufa
Commits
1e3513ed
Commit
1e3513ed
authored
15 years ago
by
Dean Camera
Browse files
Options
Downloads
Patches
Plain Diff
Add even parity bit to the software USART framing in the AVRISP project's PDI programming code.
parent
9c8ed168
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
LUFA/ManPages/ChangeLog.txt
+3
-1
3 additions, 1 deletion
LUFA/ManPages/ChangeLog.txt
Projects/AVRISP/Lib/PDITarget.c
+30
-6
30 additions, 6 deletions
Projects/AVRISP/Lib/PDITarget.c
with
33 additions
and
7 deletions
LUFA/ManPages/ChangeLog.txt
+
3
−
1
View file @
1e3513ed
...
...
@@ -39,6 +39,8 @@
* with the rest of the library errorcodes
* - Make MIDI device demos also turn off the on board LEDs if MIDI Note On messages are sent with a velocity of zero,
* which some devices use instead of Note Off messages (thanks to Robin Green)
* - The CDC demos are now named "VirtualSerial" instead to indicate the demos' function rather than its implemented USB class,
* to reduce confusion and to be in line with the rest of the LUFA demos
*
* <b>Fixed:</b>
* - Added missing CDC_Host_CreateBlockingStream() function code to the CDC Host Class driver
...
...
@@ -56,7 +58,7 @@
* - Fixed TeensyHID bootloader not properly shutting down the USB interface to trigger a disconnection on the host before resetting
* - Fixed MassStorageHost Class driver demo not having USB_STREAM_TIMEOUT_MS compile time option set properly to prevent slow
* devices from timing out the data pipes
* - Fixed the definition of the Endpoint_BytesInEndpoint() macro for the U4 parts
* - Fixed the definition of the Endpoint_BytesInEndpoint() macro for the U4
series AVR
parts
*
* \section Sec_ChangeLog091122 Version 091122
*
...
...
This diff is collapsed.
Click to expand it.
Projects/AVRISP/Lib/PDITarget.c
+
30
−
6
View file @
1e3513ed
...
...
@@ -45,22 +45,40 @@
*/
void
PDITarget_SendByte
(
uint8_t
Byte
)
{
uint8_t
LogicOneBits
=
0
;
// One Start Bit
PDIDATA_LINE_PORT
&=
~
PDIDATA_LINE_MASK
;
TOGGLE_PDI_CLOCK
;
// Eight Data Bits
for
(
uint8_t
i
=
0
;
i
<
8
;
i
++
)
{
if
(
Byte
&
0x01
)
{
PDIDATA_LINE_PORT
&=
~
PDIDATA_LINE_MASK
;
LogicOneBits
++
;
}
else
{
PDIDATA_LINE_PORT
|=
PDIDATA_LINE_MASK
;
}
Byte
>>=
1
;
TOGGLE_PDI_CLOCK
;
}
// Even Parity Bit
if
(
LogicOneBits
&
0x01
)
PDIDATA_LINE_PORT
&=
~
PDIDATA_LINE_MASK
;
else
PDIDATA_LINE_PORT
|=
PDIDATA_LINE_MASK
;
TOGGLE_PDI_CLOCK
;
// Two Stop Bits
PDIDATA_LINE_PORT
|=
PDIDATA_LINE_MASK
;
TOGGLE_PDI_CLOCK
;
...
...
@@ -77,9 +95,11 @@ uint8_t PDITarget_ReceiveByte(void)
PDIDATA_LINE_DDR
&=
~
PDIDATA_LINE_MASK
;
// One Start Bit
while
(
PDIDATA_LINE_PIN
&
PDIDATA_LINE_MASK
);
TOGGLE_PDI_CLOCK
;
// Eight Data Bits
for
(
uint8_t
i
=
0
;
i
<
8
;
i
++
)
{
if
(
PDIDATA_LINE_PIN
&
PDIDATA_LINE_MASK
)
...
...
@@ -90,6 +110,10 @@ uint8_t PDITarget_ReceiveByte(void)
TOGGLE_PDI_CLOCK
;
}
// Even Parity Bit (discarded)
TOGGLE_PDI_CLOCK
;
// Two Stop Bits
TOGGLE_PDI_CLOCK
;
TOGGLE_PDI_CLOCK
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment