From: Xavier L. <Ba...@us...> - 2011-04-21 11:57:04
|
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 731b470ef6cd5b6d93a2b2e2a85182f1c535b4b8 (commit) from 9c40637e10a40854186ed9a50c002088be65a64d (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 731b470ef6cd5b6d93a2b2e2a85182f1c535b4b8 Author: Xavier Lagorce <Xav...@cr...> Date: Thu Apr 21 13:56:21 2011 +0200 [Controller_Motor_STM32] Show differential drive status on LED1 with indicator thread. ----------------------------------------------------------------------- Changes: diff --git a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/differential_drive.c b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/differential_drive.c index a132452..578cbdd 100644 --- a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/differential_drive.c +++ b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/differential_drive.c @@ -343,10 +343,13 @@ uint8_t dd_add_bezier(float x_end, float y_end, float d1, float d2, float end_an } uint8_t dd_get_ghost_state(robot_state_t *state, float *u) { - state->x = params.ghost_state.x; - state->y = params.ghost_state.y; - state->theta = params.ghost_state.theta; - *u = params.u; + if (state != NULL) { + state->x = params.ghost_state.x; + state->y = params.ghost_state.y; + state->theta = params.ghost_state.theta; + } + if (u != NULL) + *u = params.u; if (params.working == 1) return DD_GHOST_MOVING; diff --git a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/differential_drive.h b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/differential_drive.h index 96a8241..73d6944 100644 --- a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/differential_drive.h +++ b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/differential_drive.h @@ -100,6 +100,8 @@ uint8_t dd_add_bezier(float x_end, float y_end, float d1, float d2, float end_an * - state : pointer to a robot_state_t structure where the ghost state will be written * - u : pointer to a float in which to write the current value of the parameter on the spline * + * If one of these pointers is NULL, the associated value won't be written. + * * return value : * - DD_GHOST_MOVING : if a trajectory is currently followed * - DD_GHOST_STOPPED : if the ghost robot is stopped diff --git a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/main.c b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/main.c index 9efbc67..4b10660 100644 --- a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/main.c +++ b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/main.c @@ -94,7 +94,7 @@ static void init(void) static void NORETURN ind_process(void) { while(1) { - if (tc_is_working(MOTOR3 | MOTOR4)) { + if (dd_get_ghost_state(NULL, NULL) == DD_GHOST_MOVING) { LED1_ON(); } else { LED1_OFF(); hooks/post-receive -- krobot |