projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed incorrect USB device state set when a suspended LUFA device is woken while...
[pub/USBasp.git]
/
LUFA
/
Drivers
/
Peripheral
/
AVR8
/
TWI_AVR8.c
diff --git
a/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.c
b/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.c
index
cb135a7
..
e7629d5
100644
(file)
--- a/
LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.c
+++ b/
LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.c
@@
-1,13
+1,13
@@
/*
LUFA Library
/*
LUFA Library
- Copyright (C) Dean Camera, 201
2
.
+ Copyright (C) Dean Camera, 201
3
.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
- Copyright 201
2
Dean Camera (dean [at] fourwalledcubicle [dot] com)
+ Copyright 201
3
Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@
-45,7
+45,7
@@
uint8_t TWI_StartTransmission(const uint8_t SlaveAddress,
TWCR = ((1 << TWINT) | (1 << TWSTA) | (1 << TWEN));
TimeoutRemaining = (TimeoutMS * 100);
TWCR = ((1 << TWINT) | (1 << TWSTA) | (1 << TWEN));
TimeoutRemaining = (TimeoutMS * 100);
- while (TimeoutRemaining
--
&& !(BusCaptured))
+ while (TimeoutRemaining && !(BusCaptured))
{
if (TWCR & (1 << TWINT))
{
{
if (TWCR & (1 << TWINT))
{
@@
-65,6
+65,7
@@
uint8_t TWI_StartTransmission(const uint8_t SlaveAddress,
}
_delay_us(10);
}
_delay_us(10);
+ TimeoutRemaining--;
}
if (!(TimeoutRemaining))
}
if (!(TimeoutRemaining))
@@
-77,12
+78,13
@@
uint8_t TWI_StartTransmission(const uint8_t SlaveAddress,
TWCR = ((1 << TWINT) | (1 << TWEN));
TimeoutRemaining = (TimeoutMS * 100);
TWCR = ((1 << TWINT) | (1 << TWEN));
TimeoutRemaining = (TimeoutMS * 100);
- while (TimeoutRemaining
--
)
+ while (TimeoutRemaining)
{
if (TWCR & (1 << TWINT))
break;
_delay_us(10);
{
if (TWCR & (1 << TWINT))
break;
_delay_us(10);
+ TimeoutRemaining--;
}
if (!(TimeoutRemaining))
}
if (!(TimeoutRemaining))