summaryrefslogtreecommitdiff
path: root/2004/n/asserv/src/motor.c
diff options
context:
space:
mode:
authorschodet2004-04-24 18:19:22 +0000
committerschodet2004-04-24 18:19:22 +0000
commitb01580be0e68f12420dbaf2492d569642394a9a3 (patch)
treedf5b339b01bd3f7a6a58a16e0d85a7e38c223444 /2004/n/asserv/src/motor.c
parent3ef78b23f7aa93ac9799d325ea164db4a731651e (diff)
Correction du problème du port série.
Supression du calcul sur interruption RB. Passage en 115200.
Diffstat (limited to '2004/n/asserv/src/motor.c')
-rw-r--r--2004/n/asserv/src/motor.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/2004/n/asserv/src/motor.c b/2004/n/asserv/src/motor.c
index 2f05c3a..242ff74 100644
--- a/2004/n/asserv/src/motor.c
+++ b/2004/n/asserv/src/motor.c
@@ -221,12 +221,10 @@ motor_compute_left_pid (void)
signed long pwm;
signed long temp;
/* Récupère les compteurs et calcule l'erreur. */
- disable_interrupts (INT_RB);
diff = motor_g_cpt_av;
motor_g_cpt_av = 0;
diff -= motor_g_cpt_ar;
motor_g_cpt_ar = 0;
- enable_interrupts (INT_RB);
motor_g_cpt += diff;
e = motor_g_vacc - diff;
/* Calcul de l'integrale. */
@@ -262,12 +260,10 @@ motor_compute_right_pid (void)
signed long pwm;
signed long temp;
/* Récupère les compteurs et calcule l'erreur. */
- disable_interrupts (INT_RB);
diff = motor_d_cpt_av;
motor_d_cpt_av = 0;
diff -= motor_d_cpt_ar;
motor_d_cpt_ar = 0;
- disable_interrupts (INT_RB);
motor_d_cpt += diff;
e = motor_d_vacc - diff;
/* Calcul de l'integrale. */
@@ -357,13 +353,6 @@ motor_update_cpt (void)
motor_timer3_old = timer;
}
-/* Interruptions de changement de sens. */
-#int_RB
-RB_isr()
-{
- motor_update_cpt ();
-}
-
/* Interruption de PID. */
#int_TIMER2
TIMER2_isr ()
@@ -379,14 +368,11 @@ motor_main (void)
{
/* Ne fait le traitement que s'il y a eu une interruption. */
while (!motor_int_recv)
- ;
+ motor_update_cpt ();
motor_int_recv = 0;
/* Calcul du PID. */
if ((motor_pid_int & 7) == 0)
{
- disable_interrupts (INT_RB);
- motor_update_cpt ();
- enable_interrupts (INT_RB);
motor_compute_left_pid ();
motor_compute_right_pid ();
/* Information de PWM. */