Revision e92b8d00
Changed twi_run() loop to smb_poll() in a loop
scout_avr/bom/bootloader.c | ||
---|---|---|
64 | 64 |
} |
65 | 65 |
} |
66 | 66 |
|
67 |
static void timer_init(void) { |
|
68 |
TCNT0 = 0; |
|
69 |
|
|
70 |
OCR0A = 200; |
|
71 |
|
|
72 |
// clear on compare match A |
|
73 |
TCCR0A |= _BV(WGM01); |
|
74 |
// 1024 prescaler |
|
75 |
TCCR0B |= _BV(CS02) | _BV(CS00); |
|
76 |
} |
|
77 |
|
|
67 | 78 |
int main() { |
68 | 79 |
smb_init(slave_rx); |
69 | 80 |
smb_set_address(3); // TODO parameterize address |
70 |
twi_run(); |
|
71 |
// TODO timeout |
|
81 |
while (1) { |
|
82 |
smb_poll(); |
|
83 |
} |
|
72 | 84 |
return 0; |
73 | 85 |
} |
Also available in: Unified diff