summaryrefslogtreecommitdiff
path: root/n/asserv/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'n/asserv/src/main.c')
-rw-r--r--n/asserv/src/main.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/n/asserv/src/main.c b/n/asserv/src/main.c
index c0da1ec..0118540 100644
--- a/n/asserv/src/main.c
+++ b/n/asserv/src/main.c
@@ -78,7 +78,8 @@ uint8_t motor_print_pinc, motor_print_pinc_cpt;
/** Print Sharps. */
uint8_t motor_print_sharps, motor_print_sharps_cpt;
-uint16_t motor_sharps[5];
+uint8_t motor_print_sharps_no_send;
+uint16_t motor_sharps[6];
/** Record timer value at different stage of computing. Used for performance
* analisys. */
@@ -112,6 +113,7 @@ main (void)
eeprom_read_params ();
proto_send0 ('z');
sei ();
+ motor_taz = 1;
main_loop ();
return 0;
}
@@ -196,8 +198,9 @@ main_loop (void)
{
if (twi_master_is_finished ())
{
- proto_send ('H', 10, (uint8_t *) motor_sharps);
- twi_master_read (0x02, (uint8_t *) motor_sharps, 10);
+ if (!motor_print_sharps_no_send)
+ proto_send ('H', 12, (uint8_t *) motor_sharps);
+ twi_master_read (0x02, (uint8_t *) motor_sharps, 12);
}
motor_print_sharps_cpt = motor_print_sharps;
}
@@ -333,7 +336,7 @@ proto_callback (uint8_t cmd, uint8_t size, uint8_t *args)
break;
case c ('H', 1):
/* Sharps stats. */
- twi_master_read (0x02, (uint8_t *) motor_sharps, 10);
+ twi_master_read (0x02, (uint8_t *) motor_sharps, 12);
motor_print_sharps_cpt = motor_print_sharps = args[0];
break;
default: