fix possible overflow in blocking detection, and reindent
[aversive.git] / modules / devices / robot / blocking_detection_manager / blocking_detection_manager.h
index 27b7897..4afce09 100644 (file)
@@ -1,6 +1,6 @@
-/*  
+/*
  *  Copyright Droids Corporation (2007)
- * 
+ *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *  the Free Software Foundation; either version 2 of the License, or
 
 #include <control_system_manager.h>
 
-/* detect blocking based on motor current. 
+/* detect blocking based on motor current.
  * triggers the blocking if:
- *   - the current in the motor is a above a threshold 
+ *   - the current in the motor is a above a threshold
  *     during n tests
  *   - the speed is below the threshold (if specified)
  *
  * We suppose that i = k1.V - k2.w
- * (V is the voltage applied on the motor, and w the current speed 
+ * (V is the voltage applied on the motor, and w the current speed
  * of the motor)
  */
 
@@ -59,34 +59,34 @@ struct blocking_detection {
 };
 
 /** init module, give the cs as parameter */
-void bd_init(struct blocking_detection * bd);
+void bd_init(struct blocking_detection *bd);
 
-/** thresholds for current-based blocking detection. If cpt_thres 
+/** thresholds for current-based blocking detection. If cpt_thres
  *  is 0, disable it. */
-void bd_set_current_thresholds(struct blocking_detection * bd, 
-                              int32_t k1, int32_t k2, 
+void bd_set_current_thresholds(struct blocking_detection *bd,
+                              int32_t k1, int32_t k2,
                               uint32_t i_thres, uint16_t cpt_thres);
 
 /** speed threshold: if speed is above it, disable
- *  blocking_detection. */
-void bd_set_speed_threshold(struct blocking_detection * bd, 
+ * blocking_detection. */
+void bd_set_speed_threshold(struct blocking_detection *bd,
                            uint16_t speed);
 
 /** reset the blocking */
-void bd_reset(struct blocking_detection * bd);
+void bd_reset(struct blocking_detection *bd);
 
-/** function to be called periodicallyn, when we use cs structure */
-void bd_manage_from_cs(struct blocking_detection * bd, struct cs *cs);
+/** function to be called periodically, when we use cs structure */
+void bd_manage_from_cs(struct blocking_detection *bd, struct cs *cs);
 
 /** function to be called periodically, when we use values directly */
-void bd_manage_from_pos_cmd(struct blocking_detection * bd, 
+void bd_manage_from_pos_cmd(struct blocking_detection *bd,
                            int32_t pos, int32_t cmd);
 
 /** function to be called periodically, when we use values directly */
-void bd_manage_from_speed_cmd(struct blocking_detection * bd, 
+void bd_manage_from_speed_cmd(struct blocking_detection *bd,
                              int32_t speed, int32_t cmd);
 
 /** get value of blocking detection */
-uint8_t bd_get(struct blocking_detection * bd);
+uint8_t bd_get(struct blocking_detection *bd);
 
 #endif