]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blobdiff - rpp/include/rpp/irc.h
Make the RPP layer thread safe
[pes-rpp/rpp-lib.git] / rpp / include / rpp / irc.h
index 71b3aa26207772af549f7c4a8c327e25a219f24c..8b1a000b292d280826cb210befb80f84a4c94ddb 100644 (file)
  */
 #define RPP_IRC_2 2U
 
-extern boolean_t rpp_irc1_enabled;     /**< Flag for indicating the state of IRC1. */
-extern boolean_t rpp_irc2_enabled;     /**< Flag for indicating the state of IRC2. */
-
 /**
  * IRC module initialization.
  *
- * Call this fuction before using this module.
+ * This function is not thread safe. Do not call it from multiple threads.
+ *
+ * Call this function before using this module.
  *
  * @return SUCCESS    if initialization successful.\n
  *         FAILURE    if module already initialized.
@@ -37,6 +36,8 @@ int8_t rpp_irc_init();
 /**
  * IRC enable
  *
+ * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
+ *
  * Call this function to enable IRC.
  * Reconfigures PINMUX register and enables N2HET program for specified IRC.
  * After calling this method corresponding pins are not usable as DIN.
@@ -54,6 +55,8 @@ int8_t rpp_irc_enable(uint8_t irc);
 /**
  * Check IRC status.
  *
+ * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
+ *
  * @param[in] irc IRC sensor connection number.\n
  *                RPP_IRC_1 IRC connected to DIN10, DIN11\n
  *                RPP_IRC_2 IRC connected to DIN14, DIN15\n
@@ -68,6 +71,8 @@ int8_t rpp_irc_status(uint8_t irc);
 /**
  * Get the current value.
  *
+ * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
+ *
  * @param[in] irc IRC sensor connection number.\n
  *                RPP_IRC_1 IRC connected to DIN10, DIN11\n
  *                RPP_IRC_2 IRC connected to DIN14, DIN15\n
@@ -79,6 +84,8 @@ int32_t rpp_irc_get(uint8_t irc);
 /**
  * IRC disable
  *
+ * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0.
+ *
  * Call this function to disable IRC.
  * This function reenables the DIN functionality.
  *