This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "krobot".
The branch, master has been updated
via 6372a8e32c1daf34673376822b685c0f6468ecb1 (commit)
from a5fddbe02e67831b0025060be4a9ca30827f82f4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 6372a8e32c1daf34673376822b685c0f6468ecb1
Author: Xavier Lagorce <Xav...@cr...>
Date: Mon Apr 11 16:23:13 2011 +0200
[Controller_Motor_STM32] More relevant blinky in HIL mode
-----------------------------------------------------------------------
Changes:
diff --git a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/motor_controller.c b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/motor_controller.c
index 4875872..14f0777 100644
--- a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/motor_controller.c
+++ b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/motor_controller.c
@@ -34,7 +34,7 @@ typedef struct
uint16_t last_encoder_pos; // Last encoder position measured
float F[4]; // evolution matrix
float G[2]; // command application matrix
- ticks_t T; // sampling period in seconds
+ float T; // sampling period in seconds
} control_params_t;
static control_params_t controllers[4];
@@ -196,17 +196,41 @@ static void NORETURN motorController_HIL_process(void) {
} else {
timer_add(&timer);
- if (last_t >= 1.0) {
+ if (last_t >= 0.2) {
if (led_state == 0) {
led_state = 1;
- LED3_ON();
- LED4_ON();
+ switch (params->motor) {
+ case MOTOR1:
+ LED1_ON();
+ break;
+ case MOTOR2:
+ LED2_ON();
+ break;
+ case MOTOR3:
+ LED3_ON();
+ break;
+ case MOTOR4:
+ LED4_ON();
+ break;
+ }
} else {
led_state = 0;
- LED3_ON();
- LED4_ON();
+ switch (params->motor) {
+ case MOTOR1:
+ LED1_OFF();
+ break;
+ case MOTOR2:
+ LED2_OFF();
+ break;
+ case MOTOR3:
+ LED3_OFF();
+ break;
+ case MOTOR4:
+ LED4_OFF();
+ break;
+ }
}
- last_t -= 1.0;
+ last_t -= 0.2;
}
// Compute "state estimation"
hooks/post-receive
--
krobot
|