From 5f9741a97eb9eec7f8f38cf3c98a3ff01b20e58b Mon Sep 17 00:00:00 2001 From: Jérémy Dufour Date: Sat, 22 Mar 2008 16:18:29 +0100 Subject: * digital/io/src - add a function to configure position (vertical/horizontal) of a trapdoor. --- digital/io/src/trap.c | 11 +++++++++++ digital/io/src/trap.h | 9 +++++++++ 2 files changed, 20 insertions(+) (limited to 'digital') diff --git a/digital/io/src/trap.c b/digital/io/src/trap.c index 0995478c..01259d3c 100644 --- a/digital/io/src/trap.c +++ b/digital/io/src/trap.c @@ -116,3 +116,14 @@ trap_setup_path_to_box (trap_box_id_e box) break; } } + +/* Set high time value for horizontal and vertical position of a trap. */ +void +trap_set_high_time (uint8_t servo_id, uint8_t horizontal, uint8_t vertical) +{ + if (servo_id < SERVO_NUMBER) + { + trap_high_time_pos[horizontal][servo_id] = horizontal; + trap_high_time_pos[vertical][servo_id] = vertical; + } +} diff --git a/digital/io/src/trap.h b/digital/io/src/trap.h index 9a1af575..b6bd43af 100644 --- a/digital/io/src/trap.h +++ b/digital/io/src/trap.h @@ -96,4 +96,13 @@ typedef enum trap_box_id_e void trap_setup_path_to_box (trap_box_id_e box); +/** + * Set high time value for horizontal and vertical position of a trap. + * @param servo_id the servo identification number. + * @param horizontal the horizontal high time value. + * @param vertical the vertical high time value. + */ +void +trap_set_high_time (uint8_t servo_id, uint8_t horizontal, uint8_t vertical); + #endif /* trap_h */ -- cgit v1.2.3