Project

General

Profile

Revision 64b6024c

ID64b6024cdecdaae66e3e4918356470f9a25104d5
Parent 46ed9b9b
Child 6185434e

Added by Aaron Perley over 10 years ago

Change twi buffer register to data register

View differences:

scout_avr/bom/tiny-twi.c
70 70
}
71 71

  
72 72
ISR(USI_START_vect) {
73
  PORTB |= _BV(PB4); // DEBUG: LED ON
74 73
  twi_start();
75 74
}
76 75

  
77 76
ISR(USI_OVF_vect) {
78
  uint8_t input = USIBR;
77
  uint8_t input = USIDR; // WTF ASK TOM
79 78
  switch (state) {
80 79

  
81 80
    case IDLE:
......
87 86
      if (input >> 1 == address) {
88 87
        // send ack
89 88
        twi_send_ack(input & 1);
89
        PORTB |= _BV(PB4); // DEBUG LED ON
90 90
      } else {
91 91
        // go back to listening for start condition
92 92
        twi_ready();
......
151 151
  DDRB |= _BV(DDB4);
152 152
  smb_init(testCB);
153 153
  while(1);
154
}
154
}
155

  
156

  
157

  
158

  
159

  
160
/* debug code
161
USICR &= ~_BV(USISIE);
162
USICR &= ~_BV(USIOIE);
163

  
164
int i;
165
for (i=0; i<8; i++) {
166
  _delay_ms(1000);
167
	  PORTB |= _BV(PB4); // DEBUG LED ON
168
  if ((input >> i) & 1) _delay_ms(1000);
169
  else _delay_ms(500);
170
      PORTB &= ~_BV(PB4); // DEBUG LED OFF
171
}
172
*/

Also available in: Unified diff