kopia lustrzana https://github.com/espressif/esp-idf
change(hal): redefine some ll for unsafe calling
rodzic
0766d73e5e
commit
48e6629987
|
@ -30,7 +30,7 @@ extern "C" {
|
|||
* @param group_id Group ID
|
||||
* @param enable true to enable, false to disable
|
||||
*/
|
||||
static inline void timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
static inline void _timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
{
|
||||
uint32_t reg_val = DPORT_READ_PERI_REG(DPORT_PERIP_CLK_EN_REG);
|
||||
if (group_id == 0) {
|
||||
|
@ -45,7 +45,7 @@ static inline void timer_ll_enable_bus_clock(int group_id, bool enable)
|
|||
|
||||
/// use a macro to wrap the function, force the caller to use it in a critical section
|
||||
/// the critical section needs to declare the __DECLARE_RCC_RC_ATOMIC_ENV variable in advance
|
||||
#define timer_ll_enable_bus_clock(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; timer_ll_enable_bus_clock(__VA_ARGS__)
|
||||
#define timer_ll_enable_bus_clock(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; _timer_ll_enable_bus_clock(__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @brief Reset the timer group module
|
||||
|
|
|
@ -30,7 +30,7 @@ extern "C" {
|
|||
* @param group_id Group ID
|
||||
* @param enable true to enable, false to disable
|
||||
*/
|
||||
static inline void timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
static inline void _timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
{
|
||||
(void)group_id;
|
||||
SYSTEM.perip_clk_en0.timergroup_clk_en = enable;
|
||||
|
@ -38,7 +38,7 @@ static inline void timer_ll_enable_bus_clock(int group_id, bool enable)
|
|||
|
||||
/// use a macro to wrap the function, force the caller to use it in a critical section
|
||||
/// the critical section needs to declare the __DECLARE_RCC_RC_ATOMIC_ENV variable in advance
|
||||
#define timer_ll_enable_bus_clock(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; timer_ll_enable_bus_clock(__VA_ARGS__)
|
||||
#define timer_ll_enable_bus_clock(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; _timer_ll_enable_bus_clock(__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @brief Reset the timer group module
|
||||
|
|
|
@ -30,7 +30,7 @@ extern "C" {
|
|||
* @param group_id Group ID
|
||||
* @param enable true to enable, false to disable
|
||||
*/
|
||||
static inline void timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
static inline void _timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
{
|
||||
if (group_id == 0) {
|
||||
SYSTEM.perip_clk_en0.reg_timergroup_clk_en = enable;
|
||||
|
@ -41,7 +41,7 @@ static inline void timer_ll_enable_bus_clock(int group_id, bool enable)
|
|||
|
||||
/// use a macro to wrap the function, force the caller to use it in a critical section
|
||||
/// the critical section needs to declare the __DECLARE_RCC_RC_ATOMIC_ENV variable in advance
|
||||
#define timer_ll_enable_bus_clock(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; timer_ll_enable_bus_clock(__VA_ARGS__)
|
||||
#define timer_ll_enable_bus_clock(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; _timer_ll_enable_bus_clock(__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @brief Reset the timer group module
|
||||
|
|
|
@ -824,14 +824,14 @@ static inline void lp_i2c_ll_set_source_clk(i2c_dev_t *hw, soc_periph_lp_i2c_clk
|
|||
* @param hw_id LP I2C instance ID
|
||||
* @param enable True to enable, False to disable
|
||||
*/
|
||||
static inline void lp_i2c_ll_enable_bus_clock(int hw_id, bool enable)
|
||||
static inline void _lp_i2c_ll_enable_bus_clock(int hw_id, bool enable)
|
||||
{
|
||||
(void)hw_id;
|
||||
LPPERI.clk_en.lp_ext_i2c_ck_en = enable;
|
||||
}
|
||||
|
||||
/// LPPERI.clk_en is a shared register, so this function must be used in an atomic way
|
||||
#define lp_i2c_ll_enable_bus_clock(...) (void)__DECLARE_RCC_ATOMIC_ENV; lp_i2c_ll_enable_bus_clock(__VA_ARGS__)
|
||||
#define lp_i2c_ll_enable_bus_clock(...) (void)__DECLARE_RCC_ATOMIC_ENV; _lp_i2c_ll_enable_bus_clock(__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @brief Reset LP I2C module
|
||||
|
|
|
@ -57,7 +57,7 @@ extern "C" {
|
|||
* @param group_id Group ID
|
||||
* @param enable true to enable, false to disable
|
||||
*/
|
||||
static inline void timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
static inline void _timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
{
|
||||
if (group_id == 0) {
|
||||
PCR.timergroup0_conf.tg0_clk_en = enable;
|
||||
|
@ -68,7 +68,7 @@ static inline void timer_ll_enable_bus_clock(int group_id, bool enable)
|
|||
|
||||
/// use a macro to wrap the function, force the caller to use it in a critical section
|
||||
/// the critical section needs to declare the __DECLARE_RCC_RC_ATOMIC_ENV variable in advance
|
||||
#define timer_ll_enable_bus_clock(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; timer_ll_enable_bus_clock(__VA_ARGS__)
|
||||
#define timer_ll_enable_bus_clock(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; _timer_ll_enable_bus_clock(__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @brief Reset the timer group module
|
||||
|
|
|
@ -176,14 +176,14 @@ FORCE_INLINE_ATTR void lp_uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, ui
|
|||
* @param hw_id LP UART instance ID
|
||||
* @param enable True to enable, False to disable
|
||||
*/
|
||||
static inline void lp_uart_ll_enable_bus_clock(int hw_id, bool enable)
|
||||
static inline void _lp_uart_ll_enable_bus_clock(int hw_id, bool enable)
|
||||
{
|
||||
(void)hw_id;
|
||||
LPPERI.clk_en.lp_uart_ck_en = enable;
|
||||
}
|
||||
|
||||
/// LPPERI.clk_en is a shared register, so this function must be used in an atomic way
|
||||
#define lp_uart_ll_enable_bus_clock(...) (void)__DECLARE_RCC_ATOMIC_ENV; lp_uart_ll_enable_bus_clock(__VA_ARGS__)
|
||||
#define lp_uart_ll_enable_bus_clock(...) (void)__DECLARE_RCC_ATOMIC_ENV; _lp_uart_ll_enable_bus_clock(__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @brief Reset LP UART module
|
||||
|
|
|
@ -57,7 +57,7 @@ extern "C" {
|
|||
* @param group_id Group ID
|
||||
* @param enable true to enable, false to disable
|
||||
*/
|
||||
static inline void timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
static inline void _timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
{
|
||||
if (group_id == 0) {
|
||||
PCR.timergroup0_conf.tg0_clk_en = enable;
|
||||
|
@ -68,7 +68,7 @@ static inline void timer_ll_enable_bus_clock(int group_id, bool enable)
|
|||
|
||||
/// use a macro to wrap the function, force the caller to use it in a critical section
|
||||
/// the critical section needs to declare the __DECLARE_RCC_RC_ATOMIC_ENV variable in advance
|
||||
#define timer_ll_enable_bus_clock(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; timer_ll_enable_bus_clock(__VA_ARGS__)
|
||||
#define timer_ll_enable_bus_clock(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; _timer_ll_enable_bus_clock(__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @brief Reset the timer group module
|
||||
|
|
|
@ -87,7 +87,7 @@ extern "C" {
|
|||
* @param group_id Group ID
|
||||
* @param enable true to enable, false to disable
|
||||
*/
|
||||
static inline void timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
static inline void _timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
{
|
||||
if (group_id == 0) {
|
||||
HP_SYS_CLKRST.soc_clk_ctrl2.reg_timergrp0_apb_clk_en = enable;
|
||||
|
@ -98,7 +98,7 @@ static inline void timer_ll_enable_bus_clock(int group_id, bool enable)
|
|||
|
||||
/// use a macro to wrap the function, force the caller to use it in a critical section
|
||||
/// the critical section needs to declare the __DECLARE_RCC_RC_ATOMIC_ENV variable in advance
|
||||
#define timer_ll_enable_bus_clock(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; timer_ll_enable_bus_clock(__VA_ARGS__)
|
||||
#define timer_ll_enable_bus_clock(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; _timer_ll_enable_bus_clock(__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @brief Reset the timer group module
|
||||
|
|
|
@ -30,7 +30,7 @@ extern "C" {
|
|||
* @param group_id Group ID
|
||||
* @param enable true to enable, false to disable
|
||||
*/
|
||||
static inline void timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
static inline void _timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
{
|
||||
uint32_t reg_val = READ_PERI_REG(DPORT_PERIP_CLK_EN0_REG);
|
||||
if (group_id == 0) {
|
||||
|
@ -45,7 +45,7 @@ static inline void timer_ll_enable_bus_clock(int group_id, bool enable)
|
|||
|
||||
/// use a macro to wrap the function, force the caller to use it in a critical section
|
||||
/// the critical section needs to declare the __DECLARE_RCC_RC_ATOMIC_ENV variable in advance
|
||||
#define timer_ll_enable_bus_clock(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; timer_ll_enable_bus_clock(__VA_ARGS__)
|
||||
#define timer_ll_enable_bus_clock(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; _timer_ll_enable_bus_clock(__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @brief Reset the timer group module
|
||||
|
|
|
@ -30,7 +30,7 @@ extern "C" {
|
|||
* @param group_id Group ID
|
||||
* @param enable true to enable, false to disable
|
||||
*/
|
||||
static inline void timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
static inline void _timer_ll_enable_bus_clock(int group_id, bool enable)
|
||||
{
|
||||
if (group_id == 0) {
|
||||
SYSTEM.perip_clk_en0.timergroup_clk_en = enable;
|
||||
|
@ -41,7 +41,7 @@ static inline void timer_ll_enable_bus_clock(int group_id, bool enable)
|
|||
|
||||
/// use a macro to wrap the function, force the caller to use it in a critical section
|
||||
/// the critical section needs to declare the __DECLARE_RCC_RC_ATOMIC_ENV variable in advance
|
||||
#define timer_ll_enable_bus_clock(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; timer_ll_enable_bus_clock(__VA_ARGS__)
|
||||
#define timer_ll_enable_bus_clock(...) (void)__DECLARE_RCC_RC_ATOMIC_ENV; _timer_ll_enable_bus_clock(__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @brief Reset the timer group module
|
||||
|
|
Ładowanie…
Reference in New Issue