kopia lustrzana https://github.com/espressif/esp-idf
soc: introduce hal function for cpu delay
rodzic
cf155161c4
commit
39ef904fba
|
@ -107,6 +107,13 @@ void cpu_hal_set_watchpoint(int id, const void* addr, size_t size, watchpoint_tr
|
||||||
*/
|
*/
|
||||||
void cpu_hal_clear_watchpoint(int id);
|
void cpu_hal_clear_watchpoint(int id);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Insert a delay.
|
||||||
|
*
|
||||||
|
* @param delay_us length of delay in microseconds
|
||||||
|
*/
|
||||||
|
void cpu_hal_delay_us(uint32_t delay_us);
|
||||||
|
|
||||||
#endif // SOC_CPU_WATCHPOINTS_NUM > 0
|
#endif // SOC_CPU_WATCHPOINTS_NUM > 0
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -22,6 +22,14 @@
|
||||||
|
|
||||||
#include "soc/cpu_caps.h"
|
#include "soc/cpu_caps.h"
|
||||||
|
|
||||||
|
#include "sdkconfig.h"
|
||||||
|
|
||||||
|
#if CONFIG_IDF_TARGET_ESP32
|
||||||
|
#include "esp32/rom/ets_sys.h"
|
||||||
|
#elif CONFIG_IDF_TARGET_ESP32S2
|
||||||
|
#include "esp32s2/rom/ets_sys.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if SOC_CPU_BREAKPOINTS_NUM > 0
|
#if SOC_CPU_BREAKPOINTS_NUM > 0
|
||||||
void cpu_hal_set_breakpoint(int id, const void* addr)
|
void cpu_hal_set_breakpoint(int id, const void* addr)
|
||||||
{
|
{
|
||||||
|
@ -60,3 +68,8 @@ void cpu_hal_set_vecbase(const void* base)
|
||||||
{
|
{
|
||||||
cpu_ll_set_vecbase(base);
|
cpu_ll_set_vecbase(base);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cpu_hal_delay_us(uint32_t delay_us)
|
||||||
|
{
|
||||||
|
ets_delay_us(delay_us);
|
||||||
|
}
|
Ładowanie…
Reference in New Issue