6 #include <avr/interrupt.h>
7 #include <util/delay.h>
10 #include "sabertooth.h"
15 /* Control button at PC7. */
16 DDRC
&= ~(_BV(PC7
)|_BV(PC6
)|_BV(PC5
)|_BV(PC4
)|_BV(PC3
));
18 PORTC
|= (_BV(PC7
)|_BV(PC6
)|_BV(PC5
)|_BV(PC4
)|_BV(PC3
));
28 signed char m1
= 0, m2
= 0;
34 /* Button state changed. */
39 if (serial_waiting()) {
45 /* Buttons override serial. */
47 if (!(PINC
& _BV(PC7
))) {
50 } else if (!(PINC
& _BV(PC6
))) {
54 } else if (!(PINC
& _BV(PC5
))) {
58 } else if (!(PINC
& _BV(PC4
))) {
62 } else if (!(PINC
& _BV(PC3
))) {
71 char x
[40]; snprintf(x
, 40, "brm:%d-%d", m1
, m2
);