From 25c9fe95c461d42a7c67f06f9267ce62436aaa0e Mon Sep 17 00:00:00 2001 From: Fabrice Desclaux Date: Sun, 26 Feb 2012 22:51:46 +0100 Subject: [PATCH] rc_servos: use define for bypass command --- main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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++) { -- 2.39.5