mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-06-09 02:14:20 +00:00
Fix PDITarget_ReceiveByte() not discarding the start bit properly, and reading in the bits inverted and in the wrong order.
This commit is contained in:
parent
1e3513ed70
commit
7aecda6fda
@ -99,13 +99,15 @@ uint8_t PDITarget_ReceiveByte(void)
|
|||||||
while (PDIDATA_LINE_PIN & PDIDATA_LINE_MASK);
|
while (PDIDATA_LINE_PIN & PDIDATA_LINE_MASK);
|
||||||
TOGGLE_PDI_CLOCK;
|
TOGGLE_PDI_CLOCK;
|
||||||
|
|
||||||
|
TOGGLE_PDI_CLOCK;
|
||||||
|
|
||||||
// Eight Data Bits
|
// Eight Data Bits
|
||||||
for (uint8_t i = 0; i < 8; i++)
|
for (uint8_t i = 0; i < 8; i++)
|
||||||
{
|
{
|
||||||
if (PDIDATA_LINE_PIN & PDIDATA_LINE_MASK)
|
if (!(PDIDATA_LINE_PIN & PDIDATA_LINE_MASK))
|
||||||
ReceivedByte |= 0x01;
|
ReceivedByte |= 0x80;
|
||||||
|
|
||||||
ReceivedByte <<= 1;
|
ReceivedByte >>= 1;
|
||||||
|
|
||||||
TOGGLE_PDI_CLOCK;
|
TOGGLE_PDI_CLOCK;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user