summaryrefslogtreecommitdiff
path: root/n/asserv/src/taz.c
diff options
context:
space:
mode:
Diffstat (limited to 'n/asserv/src/taz.c')
-rw-r--r--n/asserv/src/taz.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/n/asserv/src/taz.c b/n/asserv/src/taz.c
index b7e941d..61187b8 100644
--- a/n/asserv/src/taz.c
+++ b/n/asserv/src/taz.c
@@ -28,13 +28,18 @@ uint8_t taz_substate;
/** Positions. */
#define taz_scale 0.05026548245743669181
static const uint16_t taz_rear_16 = taz_scale * 270 / 2;
-static const uint32_t taz_rear_32 = taz_scale * 270 / 2 * 256;
+static const uint32_t taz_rear_32 = taz_rear_16 * 256;
static const uint16_t taz_front_16 = taz_scale * 270 / 2;
-static const uint32_t taz_front_32 = taz_scale * 270 / 2 * 256;
+static const uint32_t taz_front_32 = taz_front_16 * 256;
static const uint16_t taz_side_16 = taz_scale * 340 / 2;
-static const uint32_t taz_side_32 = taz_scale * 340 / 2 * 256;
+static const uint32_t taz_side_32 = taz_side_16 * 256;
+
static const uint16_t taz_start_y_16 = taz_scale * 450 / 2;
+static const uint16_t taz_before_bridge_16 = taz_scale * 1050;
+static const uint16_t taz_after_bridge_16 = taz_scale * (1500 + 22 + 600 + 22
+ + 300);
+
/* +AutoDec */
/* -AutoDec */
@@ -58,12 +63,12 @@ taz_state_0 (void)
{
case 0:
/* Attend que l'on enfonce le jack. */
- if (PINC & _BV (3))
+ if (PINA & _BV (6))
taz_substate = 1;
break;
case 1:
/* Attend que l'on enlève le jack. */
- if (!(PINC & _BV (3)))
+ if (!(PINA & _BV (6)))
{
taz_substate = 2;
/* FTW. */
@@ -113,7 +118,7 @@ taz_state_0 (void)
}
break;
case 5:
- if (goto_finish && (PINC & _BV (3)))
+ if (goto_finish && (PINA & _BV (6)))
{
taz_substate = 6;
/* Recalage. */
@@ -121,7 +126,7 @@ taz_state_0 (void)
goto_a = 0;
}
case 6:
- if (!(PINC & _BV (3)))
+ if (!(PINA & _BV (6)))
{
taz_state = 1;
taz_substate = 0;