]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blobdiff - rpp/include/rpp/can.h
Make the RPP layer thread safe
[pes-rpp/rpp-lib.git] / rpp / include / rpp / can.h
index e9b72f7b98ccb318f19f1b5145de6b45170cd7ff..a125800a3ae7c289599013871547f9c89c957233 100644 (file)
@@ -169,6 +169,8 @@ struct rpp_can_config {
  *
  * Call this method before using this module.
  *
+ * This function is not thread safe. Do not call it from multiple threads.
+ *
  * @param[in] config Configuration of CAN controllers and message objects
  *
  * @return @c SUCCESS if initialization was successful,\n
@@ -179,6 +181,8 @@ int8_t rpp_can_init(const struct rpp_can_config *config);
 /**
  * Submit a CAN message for transmission.
  *
+ * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0
+ *
  * Data pointed by @a pdu is copied to the given message object for
  * transmission. A successful call to this function also resets the TX
  * pending flag that can be retrieved with rpp_can_check_tx_pend().
@@ -203,6 +207,8 @@ int8_t rpp_can_write(rpp_can_hw_obj hw_obj, const struct rpp_can_pdu *pdu);
 /**
  * Checks whether message transmission is pending.
  *
+ * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0
+ *
  * Call this function to check whether a message previously submitted
  * for transmission with rpp_can_write() still waits for transmission
  * or has already been transmitted to the bus.
@@ -218,6 +224,8 @@ int8_t rpp_can_check_tx_pend(rpp_can_hw_obj hw_obj, bool *tx_pend);
 /**
  * Read a message from a message object.
  *
+ * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0
+ *
  * Data in the given message object is copied to @a pdu. A successful
  * call to this function also clears the indication that can be
  * retrieved with rpp_can_check_rx_ind().
@@ -236,6 +244,8 @@ int8_t rpp_can_read(rpp_can_hw_obj hw_obj, struct rpp_can_pdu *pdu);
 /**
  * Checks whether a message was received by the message object.
  *
+ * The function is thread safe, unless compiled with -DRPP_THREADSAFE=0
+ *
  * @param[in] hw_obj Hardware object to be checked.
  * @param[out] rx_ind Where to store the RX indication flag. Its value
  * will be @c true if a message was received, @c false otherwise.