]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blobdiff - rpp/include/rpp/hbr.h
Make the RPP layer thread safe
[pes-rpp/rpp-lib.git] / rpp / include / rpp / hbr.h
index 8d3c0d7e8867c7054b9544acf78ac6c2abbc1d0a..cb3c9b3cd93b2325afb750bc87fd03c4942b9ecc 100644 (file)
@@ -17,6 +17,8 @@
  *
  * Call this method before using this module.
  *
+ * This function is not thread safe. Do not call it from multiple threads.
+ *
  * @return SUCCESS if initialization successful.\n
  *         FAILURE if module already initialized.
  */
@@ -26,6 +28,8 @@ int8_t rpp_hbr_init();
 /**
  * Enable the H-Bridge output and set PWM frequency.
  *
+ * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
+ *
  * Sets duty cycle to zero, direction to LOW and enables the H-Bridge
  * output. Duty cycle and direction can be later controlled with
  * rpp_hbr_control() (see below).
@@ -55,6 +59,8 @@ int8_t rpp_hbr_enable(int32_t period);
 /**
  * Control the H-Bridge direction and PWM duty cycle.
  *
+ * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
+ *
  * @param[in] cmd       [-1.0, 1.0] A double between the previous range to
  *                      command the H-Bridge in the following manner:
  *                          - cmd > 0 : direction set to HIGH and PWM
@@ -86,6 +92,8 @@ int8_t rpp_hbr_control(double cmd);
 /**
  * Disable the H-Bridge output.
  *
+ * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
+ *
  * Completely disable H-Bridge. After this call the H-Bridge cannot be
  * controlled again until another call to rpp_hbr_enable() is made.
  *