From: Fabrice Desclaux Date: Sun, 26 Feb 2012 21:51:46 +0000 (+0100) Subject: rc_servos: use define for bypass command X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=25c9fe95c461d42a7c67f06f9267ce62436aaa0e;p=protos%2Frc_servos.git rc_servos: use define for bypass command --- diff --git a/main.c b/main.c index b1083ea..df8fb93 100644 --- a/main.c +++ b/main.c @@ -25,6 +25,8 @@ register uint8_t bypass asm("r2"); register uint8_t done asm("r3"); register uint8_t portval asm("r4"); register uint8_t rxidx asm("r5"); +#define BYPASS_ENABLE 14 +#define BYPASS_DISABLE 15 /* * SPI protocol: @@ -94,10 +96,10 @@ static void poll_spi(void) val += byte1.val_lsb; servo_table[byte0.cmd_num].command = val; } - else if (byte0.cmd_num == 14) { + else if (byte0.cmd_num == BYPASS_ENABLE) { bypass = 1; } - else if (byte0.cmd_num == 15) { + else if (byte0.cmd_num == BYPASS_DISABLE) { bypass = 0; } } @@ -157,6 +159,7 @@ int main(void) sei(); + bypass = 0; while (1) { t = TCNT0; for (i = 0; i < NB_SERVO; i++) {