Skip to content

Commit

Permalink
firmware: drivers: sl_ttc2: Updating driver mutex #343
Browse files Browse the repository at this point in the history
  • Loading branch information
c-porto committed Mar 21, 2024
1 parent e419833 commit 3f3e7c9
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 66 deletions.
24 changes: 24 additions & 0 deletions firmware/drivers/sl_ttc2/sl_ttc2.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
#define SL_TTC2_DEVICE_ID_RADIO_0 0xCC2AU /**< TTC 2.0 device ID (radio 1). */
#define SL_TTC2_DEVICE_ID_RADIO_1 0xCC2BU /**< TTC 2.0 device ID (radio 2). */

/* TTC 2.0 Mutex wait time */
#define SL_TTC2_MUTEX_WAIT_TIME_MS 5000U /**< TTC 2.0 mutex wait time. */

/* TTC 2.0 Preamble byte */
#define SL_TTC2_PKT_PREAMBLE 0x7EU /**< Preamble byte value. */

Expand Down Expand Up @@ -587,6 +590,27 @@ int sl_ttc2_spi_transfer(sl_ttc2_config_t config, uint8_t *wdata, uint8_t *rdata
*/
void sl_ttc2_delay_ms(uint32_t ms);

/**
* \brief Creates the sl_ttc2 create.
*
* \return The status/error code.
*/
int sl_ttc2_mutex_create(void);

/**
* \brief Takes the sl_ttc2 mutex.
*
* \return The status/error code.
*/
int sl_ttc2_mutex_take(void);

/**
* \brief Gives the sl_ttc2 mutex.
*
* \return The status/error code.
*/
int sl_ttc2_mutex_give(void);

#endif /* SL_TTC2_H_ */

/** \} End of sl_ttc2 group */
4 changes: 2 additions & 2 deletions firmware/drivers/sl_ttc2/sl_ttc2_mutex.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@
*
* \date 2024/02/26
*
* \addtogroup sl_ttc2_mutex
* \addtogroup sl_ttc2
* \{
*/


#include <freertos/include/FreeRTOS.h>
#include <freertos/include/semphr.h>

#include "sl_ttc2_mutex.h"
#include "sl_ttc2.h"

static xSemaphoreHandle sl_ttc2_mutex = NULL;

Expand Down
64 changes: 0 additions & 64 deletions firmware/drivers/sl_ttc2/sl_ttc2_mutex.h

This file was deleted.

0 comments on commit 3f3e7c9

Please sign in to comment.