Revision cbe25c0a scout_avr/bom/tiny-twi.c

View differences:

scout_avr/bom/tiny-twi.c
6 6
#define SDA PB0
7 7
#define SCL PB2
8 8

  
9
#define RECV_BUF_SIZE 2
9
#define RECV_BUF_SIZE 3
10 10
#define SEND_BUF_SIZE 100
11 11

  
12 12
uint8_t address;
......
168 168
  address = addr;
169 169
}
170 170

  
171
void send_data(uint8_t* data, uint8_t length) {
171
void smb_send_data(uint8_t* data, uint8_t length) {
172 172
  uint8_t i;
173 173
  for (i=0; i<length && !send_queue.full; i++) {
174 174
    send_queue.data[send_queue.end++] = data[i];
......
178 178
      send_queue.full = 1;
179 179
  }
180 180
}
181

  
182
void testCB(uint8_t* data, int length) {
183
  send_data(data, length);
184
}
185

  
186

  
187
int main() {
188
  sei();
189
  smb_set_address(5);
190
  DDRB |= _BV(DDB4);
191
  smb_init(testCB);
192
  while(1);
193
}

Also available in: Unified diff