mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-23 17:17:14 +00:00
portmux: Add vPortCPUAcquireMutexTimeout() function
Refactor app_trace locking to use this function.
This commit is contained in:

committed by
Angus Gratton

parent
397c0bfb4b
commit
4486d4cb10
@@ -59,8 +59,8 @@ static inline uint32_t esp_apptrace_tmo_remaining_us(esp_apptrace_tmo_t *tmo)
|
||||
|
||||
/** Tracing module synchronization lock */
|
||||
typedef struct {
|
||||
volatile unsigned int irq_stat; ///< local (on 1 CPU) IRQ state
|
||||
portMUX_TYPE portmux; ///< mux for synchronization
|
||||
portMUX_TYPE mux;
|
||||
unsigned int_state;
|
||||
} esp_apptrace_lock_t;
|
||||
|
||||
/**
|
||||
@@ -70,8 +70,8 @@ typedef struct {
|
||||
*/
|
||||
static inline void esp_apptrace_lock_init(esp_apptrace_lock_t *lock)
|
||||
{
|
||||
lock->portmux.mux = portMUX_FREE_VAL;
|
||||
lock->irq_stat = 0;
|
||||
vPortCPUInitializeMutex(&lock->mux);
|
||||
lock->int_state = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -163,4 +163,4 @@ uint32_t esp_apptrace_rb_read_size_get(esp_apptrace_rb_t *rb);
|
||||
*/
|
||||
uint32_t esp_apptrace_rb_write_size_get(esp_apptrace_rb_t *rb);
|
||||
|
||||
#endif //ESP_APP_TRACE_UTIL_H_
|
||||
#endif //ESP_APP_TRACE_UTIL_H_
|
||||
|
Reference in New Issue
Block a user