portmux: Add vPortCPUAcquireMutexTimeout() function

Refactor app_trace locking to use this function.
This commit is contained in:
Angus Gratton
2017-07-20 16:34:45 +10:00
committed by Angus Gratton
parent 397c0bfb4b
commit 4486d4cb10
6 changed files with 95 additions and 91 deletions

View File

@@ -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_