Skip to content

Commit

Permalink
cpu/esp*: move freertos/task to cpu/esp_common
Browse files Browse the repository at this point in the history
  • Loading branch information
gschorcht committed Feb 21, 2020
1 parent 6133900 commit 9723e3e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 182 deletions.
180 changes: 0 additions & 180 deletions cpu/esp32/freertos/task.c

This file was deleted.

11 changes: 9 additions & 2 deletions cpu/esp8266/freertos/task.c → cpu/esp_common/freertos/task.c
Expand Up @@ -162,7 +162,14 @@ void vTaskEnterCritical( portMUX_TYPE *mux )

/* acquire the mutex with interrupts disabled */
if (mux) {
mutex_lock(mux); /* TODO should be only a spin lock */
/* Locking the given mutex does not work here, as this function can also
be called in the interrupt context. Therefore, the given mutex is not
used. Instead, the basic default FreeRTOS mechanism for critical
sections is used by simply disabling interrupts. Since context
switches for the ESPs are also based on interrupts, there is no
possibility that another thread will enter the critical section
once the interrupts are disabled. */
/* mutex_lock(mux); */ /* TODO should be only a spin lock */
}

/* increment nesting counter and save old interrupt level */
Expand All @@ -189,7 +196,7 @@ void vTaskExitCritical( portMUX_TYPE *mux )

/* release the mutex with interrupts disabled */
if (mux) {
mutex_unlock(mux); /* TODO should be only a spin lock */
/* mutex_unlock(mux); */ /* TODO should be only a spin lock */
}

/* decrement nesting counter and restore old interrupt level */
Expand Down

0 comments on commit 9723e3e

Please sign in to comment.