change(lp_i2d): use atomic fsm check

This commit is contained in:
Armando
2024-11-21 10:51:39 +08:00
parent 5618f3eb16
commit f0a4d35e01
2 changed files with 10 additions and 10 deletions

View File

@@ -7,6 +7,7 @@
#pragma once
#include <sys/lock.h>
#include <stdatomic.h>
#include "freertos/FreeRTOS.h"
#include "freertos/semphr.h"
#include "freertos/queue.h"
@@ -199,7 +200,7 @@ struct lp_i2s_channel_obj_t {
i2s_comm_mode_t mode; /*!< lp i2s channel communication mode */
i2s_role_t role; /*!< lp i2s role */
i2s_dir_t dir; /*!< lp i2s channel direction */
i2s_state_t state; /*!< lp i2s driver state. Ensuring the driver working in a correct sequence */
_Atomic i2s_state_t state; /*!< lp i2s driver state. Ensuring the driver working in a correct sequence */
SemaphoreHandle_t semphr; /*!< lp i2s event semphr*/
lp_i2s_trans_t trans; /*!< transaction */
size_t threshold; /*!< lp i2s threshold*/