mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-09 00:23:00 +00:00
refactor(system): reformated esp_timer, linux and log comp with astyle
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2010-2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2010-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -65,25 +65,24 @@ void ets_timer_setfn(ETSTimer *ptimer, ETSTimerFunc *pfunction, void *parg)
|
||||
|
||||
if (ESP_TIMER(ptimer) == NULL) {
|
||||
const esp_timer_create_args_t create_args = {
|
||||
.callback = pfunction,
|
||||
.arg = parg,
|
||||
.name = "ETSTimer",
|
||||
.dispatch_method = ESP_TIMER_TASK
|
||||
.callback = pfunction,
|
||||
.arg = parg,
|
||||
.name = "ETSTimer",
|
||||
.dispatch_method = ESP_TIMER_TASK
|
||||
};
|
||||
|
||||
ESP_ERROR_CHECK( esp_timer_create(&create_args, (esp_timer_handle_t*)&(ptimer->timer_arg)) );
|
||||
ESP_ERROR_CHECK(esp_timer_create(&create_args, (esp_timer_handle_t*) & (ptimer->timer_arg)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void IRAM_ATTR ets_timer_arm_us(ETSTimer *ptimer, uint32_t time_us, bool repeat_flag)
|
||||
{
|
||||
assert(timer_initialized(ptimer));
|
||||
esp_timer_stop(ESP_TIMER(ptimer)); // no error check
|
||||
if (!repeat_flag) {
|
||||
ESP_ERROR_CHECK( esp_timer_start_once(ESP_TIMER(ptimer), time_us) );
|
||||
ESP_ERROR_CHECK(esp_timer_start_once(ESP_TIMER(ptimer), time_us));
|
||||
} else {
|
||||
ESP_ERROR_CHECK( esp_timer_start_periodic(ESP_TIMER(ptimer), time_us) );
|
||||
ESP_ERROR_CHECK(esp_timer_start_periodic(ESP_TIMER(ptimer), time_us));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,9 +92,9 @@ void IRAM_ATTR ets_timer_arm(ETSTimer *ptimer, uint32_t time_ms, bool repeat_fla
|
||||
assert(timer_initialized(ptimer));
|
||||
esp_timer_stop(ESP_TIMER(ptimer)); // no error check
|
||||
if (!repeat_flag) {
|
||||
ESP_ERROR_CHECK( esp_timer_start_once(ESP_TIMER(ptimer), time_us) );
|
||||
ESP_ERROR_CHECK(esp_timer_start_once(ESP_TIMER(ptimer), time_us));
|
||||
} else {
|
||||
ESP_ERROR_CHECK( esp_timer_start_periodic(ESP_TIMER(ptimer), time_us) );
|
||||
ESP_ERROR_CHECK(esp_timer_start_periodic(ESP_TIMER(ptimer), time_us));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +114,6 @@ void IRAM_ATTR ets_timer_disarm(ETSTimer *ptimer)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ets_timer_init(void)
|
||||
{
|
||||
|
||||
@@ -128,6 +126,6 @@ void ets_timer_deinit(void)
|
||||
|
||||
void os_timer_setfn(ETSTimer *ptimer, ETSTimerFunc *pfunction, void *parg) __attribute__((alias("ets_timer_setfn")));
|
||||
void os_timer_disarm(ETSTimer *ptimer) __attribute__((alias("ets_timer_disarm")));
|
||||
void os_timer_arm_us(ETSTimer *ptimer,uint32_t u_seconds,bool repeat_flag) __attribute__((alias("ets_timer_arm_us")));
|
||||
void os_timer_arm(ETSTimer *ptimer,uint32_t milliseconds,bool repeat_flag) __attribute__((alias("ets_timer_arm")));
|
||||
void os_timer_arm_us(ETSTimer *ptimer, uint32_t u_seconds, bool repeat_flag) __attribute__((alias("ets_timer_arm_us")));
|
||||
void os_timer_arm(ETSTimer *ptimer, uint32_t milliseconds, bool repeat_flag) __attribute__((alias("ets_timer_arm")));
|
||||
void os_timer_done(ETSTimer *ptimer) __attribute__((alias("ets_timer_done")));
|
||||
|
Reference in New Issue
Block a user