esp_system: Fix esp_cpu_compare_and_set()

This commit fixes esp_cpu_compare_and_set() in the following ways

- Removed call to esp_ptr_external_ram() as it incurred > 80 CPU cycles (due to multiple nested
  function calls, and those functions not being in IRAM). We now check manually if the pointer
  is in external RAM for increased speed.
- Fixed infinite wait when attempting to get the external_ram_cas_lock. The function should
  return immediatley if any part of the compare and set call fails.
- The preprocessor conditions of esp_cpu_compare_and_set() to depend on CONFIG_SPIRAM instead
  of SOC_SPIRAM_SUPPORTED. Even if the target supports SPIRAM, we only need the external RAM
  compare and set feature if SPIRAM is enabled.

Also fixed incorrect inclusion of esp_intr_alloc.h in esp_cpu.h
This commit is contained in:
Darian Leung
2022-07-21 19:14:10 +08:00
parent 36f49f361c
commit 64117a0c59
2 changed files with 19 additions and 14 deletions
@@ -17,6 +17,7 @@
#elif __riscv
#include "riscv/rv_utils.h"
#endif
#include "esp_intr_alloc.h"
#include "esp_err.h"
#ifdef __cplusplus