projects
/
sx
/
simavr.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
regExp
home
|
summary
|
tags
|
heads
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
raw
|
patch
| inline |
side by side
(parent:
f4a6e39
)
Commit
47cb0b9b645c98578eb9ec3554cf5d63bdc8b2ab
author
crazyt
<tobias15556@gmx.de>
Mon, 17 Aug 2015 16:59:01 +0000
(18:59 +0200)
committer
crazyt
<tobias15556@gmx.de>
Wed, 19 Aug 2015 16:33:14 +0000
(18:33 +0200)
simavr/sim/avr_twi.c
patch
|
blob
|
history
|
download
diff --git
a/simavr/sim/avr_twi.c
b/simavr/sim/avr_twi.c
index 629f9a4f45ceb73384ed3e42276ef441dde2c3bc..8249ee72e238465a015a49b8370078da2ca551d4 100644
(file)
--- a/
simavr/sim/avr_twi.c
+++ b/
simavr/sim/avr_twi.c
@@
-308,9
+308,15
@@
avr_twi_write(
p->state & TWI_COND_ACK ?
TWI_MRX_ADR_ACK : TWI_MRX_ADR_NACK);
} else {
- _avr_twi_delay_state(p, 9,
- p->state & TWI_COND_ACK ?
- TWI_MTX_ADR_ACK : TWI_MTX_ADR_NACK);
+ if(p->state & TWI_COND_WRITE){
+ _avr_twi_delay_state(p, 0,
+ p->state & TWI_COND_ACK ?
+ TWI_MTX_DATA_ACK : TWI_MTX_DATA_NACK);
+ }else{
+ _avr_twi_delay_state(p, 9,
+ p->state & TWI_COND_ACK ?
+ TWI_MTX_ADR_ACK : TWI_MTX_ADR_NACK);
+ }
}
}
p->state &= ~TWI_COND_WRITE;