fix(common): Adjust some formatting per indent-cont=120

As we updated astyle configuration to be in line with IDF style
This commit is contained in:
David Cermak
2025-02-12 11:40:21 +01:00
parent b45fe143a4
commit 5b2077e373
5 changed files with 122 additions and 122 deletions

View File

@ -64,7 +64,7 @@ static struct generic_queue_handle *create_generic_queue(queue_type_t type, uint
return h;
}
QueueHandle_t xQueueCreate(uint32_t uxQueueLength, uint32_t uxItemSize )
QueueHandle_t xQueueCreate(uint32_t uxQueueLength, uint32_t uxItemSize)
{
return (QueueHandle_t)create_generic_queue(QUEUE, uxQueueLength, uxItemSize);
}
@ -75,7 +75,7 @@ uint32_t xQueueSend(QueueHandle_t xQueue, const void *pvItemToQueue, TickType_t
return osal_queue_send(h->q, (uint8_t *)pvItemToQueue, h->item_size) ? pdTRUE : pdFAIL;
}
uint32_t xQueueSendToBack(QueueHandle_t xQueue, const void *pvItemToQueue, TickType_t xTicksToWait )
uint32_t xQueueSendToBack(QueueHandle_t xQueue, const void *pvItemToQueue, TickType_t xTicksToWait)
{
return xQueueSend(xQueue, pvItemToQueue, xTicksToWait);
}
@ -86,7 +86,7 @@ uint32_t xQueueReceive(QueueHandle_t xQueue, void *pvBuffer, TickType_t xTicksTo
return osal_queue_recv(h->q, (uint8_t *)pvBuffer, h->item_size, xTicksToWait) ? pdTRUE : pdFAIL;
}
BaseType_t xSemaphoreGive( QueueHandle_t xQueue)
BaseType_t xSemaphoreGive(QueueHandle_t xQueue)
{
struct generic_queue_handle *h = xQueue;
if (h->type == MUTEX) {
@ -96,7 +96,7 @@ BaseType_t xSemaphoreGive( QueueHandle_t xQueue)
return xQueueSend(xQueue, &s_semaphore_data, portMAX_DELAY);
}
BaseType_t xSemaphoreGiveRecursive( QueueHandle_t xQueue)
BaseType_t xSemaphoreGiveRecursive(QueueHandle_t xQueue)
{
struct generic_queue_handle *h = xQueue;
if (h->type == MUTEX_REC) {
@ -106,7 +106,7 @@ BaseType_t xSemaphoreGiveRecursive( QueueHandle_t xQueue)
return pdFALSE;
}
BaseType_t xSemaphoreTake( QueueHandle_t xQueue, TickType_t pvTask )
BaseType_t xSemaphoreTake(QueueHandle_t xQueue, TickType_t pvTask)
{
struct generic_queue_handle *h = xQueue;
if (h->type == MUTEX) {
@ -116,7 +116,7 @@ BaseType_t xSemaphoreTake( QueueHandle_t xQueue, TickType_t pvTask )
return xQueueReceive(xQueue, &s_semaphore_data, portMAX_DELAY);
}
BaseType_t xSemaphoreTakeRecursive( QueueHandle_t xQueue, TickType_t pvTask )
BaseType_t xSemaphoreTakeRecursive(QueueHandle_t xQueue, TickType_t pvTask)
{
struct generic_queue_handle *h = xQueue;
if (h->type == MUTEX_REC) {
@ -126,7 +126,7 @@ BaseType_t xSemaphoreTakeRecursive( QueueHandle_t xQueue, TickType_t pvTask )
return pdFALSE;
}
void vQueueDelete( QueueHandle_t xQueue )
void vQueueDelete(QueueHandle_t xQueue)
{
struct generic_queue_handle *h = xQueue;
if (h->q) {
@ -176,14 +176,14 @@ void vTaskSuspend(void *task)
vTaskDelete(task);
}
TickType_t xTaskGetTickCount( void )
TickType_t xTaskGetTickCount(void)
{
struct timespec spec;
clock_gettime(CLOCK_REALTIME, &spec);
return spec.tv_nsec / 1000000 + spec.tv_sec * 1000;
}
void vTaskDelay( const TickType_t xTicksToDelay )
void vTaskDelay(const TickType_t xTicksToDelay)
{
usleep(xTicksToDelay * 1000);
}
@ -212,21 +212,21 @@ void *pthread_task(void *params)
return NULL;
}
TaskHandle_t xTaskCreateStaticPinnedToCore( TaskFunction_t pxTaskCode,
TaskHandle_t xTaskCreateStaticPinnedToCore(TaskFunction_t pxTaskCode,
const char *const pcName,
const uint32_t ulStackDepth,
void *const pvParameters,
UBaseType_t uxPriority,
StackType_t *const puxStackBuffer,
StaticTask_t *const pxTaskBuffer,
const BaseType_t xCoreID )
const BaseType_t xCoreID)
{
static TaskHandle_t pvCreatedTask;
xTaskCreate(pxTaskCode, pcName, ulStackDepth, pvParameters, uxPriority, &pvCreatedTask);
return pvCreatedTask;
}
BaseType_t xTaskCreatePinnedToCore( TaskFunction_t pvTaskCode,
BaseType_t xTaskCreatePinnedToCore(TaskFunction_t pvTaskCode,
const char *const pcName,
const uint32_t usStackDepth,
void *const pvParameters,
@ -280,7 +280,7 @@ void xTaskNotifyGive(TaskHandle_t task)
}
}
BaseType_t xTaskNotifyWait(uint32_t bits_entry_clear, uint32_t bits_exit_clear, uint32_t *value, TickType_t wait_time )
BaseType_t xTaskNotifyWait(uint32_t bits_entry_clear, uint32_t bits_exit_clear, uint32_t *value, TickType_t wait_time)
{
return true;
}
@ -290,32 +290,32 @@ TaskHandle_t xTaskGetCurrentTaskHandle(void)
return (TaskHandle_t)pthread_self();
}
EventGroupHandle_t xEventGroupCreate( void )
EventGroupHandle_t xEventGroupCreate(void)
{
return osal_signal_create();
}
void vEventGroupDelete( EventGroupHandle_t xEventGroup )
void vEventGroupDelete(EventGroupHandle_t xEventGroup)
{
osal_signal_delete(xEventGroup);
}
EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear )
EventBits_t xEventGroupClearBits(EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear)
{
return osal_signal_clear(xEventGroup, uxBitsToClear);
}
EventBits_t xEventGroupGetBits( EventGroupHandle_t xEventGroup)
EventBits_t xEventGroupGetBits(EventGroupHandle_t xEventGroup)
{
return osal_signal_get(xEventGroup);
}
EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet )
EventBits_t xEventGroupSetBits(EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet)
{
return osal_signal_set(xEventGroup, uxBitsToSet);
}
EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToWaitFor, const BaseType_t xClearOnExit, const BaseType_t xWaitForAllBits, TickType_t xTicksToWait )
EventBits_t xEventGroupWaitBits(EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToWaitFor, const BaseType_t xClearOnExit, const BaseType_t xWaitForAllBits, TickType_t xTicksToWait)
{
return osal_signal_wait(xEventGroup, uxBitsToWaitFor, xWaitForAllBits, xTicksToWait);
}

View File

@ -19,7 +19,7 @@ extern "C" {
typedef void *StackType_t;
typedef void *StaticTask_t;
void vTaskDelay( const TickType_t xTicksToDelay );
void vTaskDelay(const TickType_t xTicksToDelay);
void xTaskNotifyGive(TaskHandle_t task);
@ -27,18 +27,18 @@ void ulTaskNotifyTake(bool stuff, uint32_t timeout);
TaskHandle_t xTaskGetCurrentTaskHandle(void);
BaseType_t xTaskNotifyWait(uint32_t bits_entry_clear, uint32_t bits_exit_clear, uint32_t *value, TickType_t wait_time );
BaseType_t xTaskNotifyWait(uint32_t bits_entry_clear, uint32_t bits_exit_clear, uint32_t *value, TickType_t wait_time);
TaskHandle_t xTaskCreateStaticPinnedToCore( TaskFunction_t pxTaskCode,
TaskHandle_t xTaskCreateStaticPinnedToCore(TaskFunction_t pxTaskCode,
const char *const pcName,
const uint32_t ulStackDepth,
void *const pvParameters,
UBaseType_t uxPriority,
StackType_t *const puxStackBuffer,
StaticTask_t *const pxTaskBuffer,
const BaseType_t xCoreID );
const BaseType_t xCoreID);
BaseType_t xTaskCreatePinnedToCore( TaskFunction_t pvTaskCode,
BaseType_t xTaskCreatePinnedToCore(TaskFunction_t pvTaskCode,
const char *const pcName,
const uint32_t usStackDepth,
void *const pvParameters,
@ -48,27 +48,27 @@ BaseType_t xTaskCreatePinnedToCore( TaskFunction_t pvTaskCode,
BaseType_t xTaskCreate(TaskFunction_t pvTaskCode, const char *const pcName, const uint32_t usStackDepth, void *const pvParameters, UBaseType_t uxPriority, TaskHandle_t *const pvCreatedTask);
TickType_t xTaskGetTickCount( void );
TickType_t xTaskGetTickCount(void);
void vQueueDelete( QueueHandle_t xQueue );
void vQueueDelete(QueueHandle_t xQueue);
QueueHandle_t xSemaphoreCreateBinary(void);
QueueHandle_t xSemaphoreCreateMutex(void);
QueueHandle_t xSemaphoreCreateRecursiveMutex(void);
BaseType_t xSemaphoreGive( QueueHandle_t xQueue);
BaseType_t xSemaphoreGive(QueueHandle_t xQueue);
BaseType_t xSemaphoreTake( QueueHandle_t xQueue, TickType_t pvTask );
BaseType_t xSemaphoreTake(QueueHandle_t xQueue, TickType_t pvTask);
BaseType_t xSemaphoreGiveRecursive( QueueHandle_t xQueue);
BaseType_t xSemaphoreGiveRecursive(QueueHandle_t xQueue);
BaseType_t xSemaphoreTakeRecursive( QueueHandle_t xQueue, TickType_t pvTask );
BaseType_t xSemaphoreTakeRecursive(QueueHandle_t xQueue, TickType_t pvTask);
void vTaskDelete(TaskHandle_t *task);
QueueHandle_t xQueueCreate( uint32_t uxQueueLength,
uint32_t uxItemSize );
QueueHandle_t xQueueCreate(uint32_t uxQueueLength,
uint32_t uxItemSize);
uint32_t xQueueSend(QueueHandle_t xQueue, const void *pvItemToQueue, TickType_t xTicksToWait);
@ -76,26 +76,26 @@ uint32_t xQueueReceive(QueueHandle_t xQueue, void *pvBuffer, TickType_t xTicksTo
void vTaskSuspend(void *task);
EventGroupHandle_t xEventGroupCreate( void );
void vEventGroupDelete( EventGroupHandle_t xEventGroup );
EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup,
const EventBits_t uxBitsToClear );
EventGroupHandle_t xEventGroupCreate(void);
void vEventGroupDelete(EventGroupHandle_t xEventGroup);
EventBits_t xEventGroupClearBits(EventGroupHandle_t xEventGroup,
const EventBits_t uxBitsToClear);
EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
EventBits_t xEventGroupWaitBits(EventGroupHandle_t xEventGroup,
const EventBits_t uxBitsToWaitFor,
const BaseType_t xClearOnExit,
const BaseType_t xWaitForAllBits,
TickType_t xTicksToWait );
TickType_t xTicksToWait);
EventBits_t xEventGroupGetBits( EventGroupHandle_t xEventGroup);
EventBits_t xEventGroupGetBits(EventGroupHandle_t xEventGroup);
EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup,
const EventBits_t uxBitsToSet );
EventBits_t xEventGroupSetBits(EventGroupHandle_t xEventGroup,
const EventBits_t uxBitsToSet);
uint32_t xQueueSendToBack(QueueHandle_t xQueue, const void *pvItemToQueue, TickType_t xTicksToWait );
uint32_t xQueueSendToBack(QueueHandle_t xQueue, const void *pvItemToQueue, TickType_t xTicksToWait);
void *heap_caps_malloc( size_t size, uint32_t caps);
void heap_caps_free( void *ptr);
void *heap_caps_malloc(size_t size, uint32_t caps);
void heap_caps_free(void *ptr);
#ifdef __cplusplus
}

View File

@ -1238,7 +1238,7 @@ static uint16_t _mdns_append_question(uint8_t *packet, uint16_t *index, mdns_out
* @brief Helper to get either ETH or STA if the other is provided
* Used when two interfaces are on the same subnet
*/
static mdns_if_t _mdns_get_other_if (mdns_if_t tcpip_if)
static mdns_if_t _mdns_get_other_if(mdns_if_t tcpip_if)
{
if (tcpip_if < MDNS_MAX_INTERFACES) {
return s_esp_netifs[tcpip_if].duplicate;
@ -1251,7 +1251,7 @@ static mdns_if_t _mdns_get_other_if (mdns_if_t tcpip_if)
*/
static bool _mdns_if_is_dup(mdns_if_t tcpip_if)
{
mdns_if_t other_if = _mdns_get_other_if (tcpip_if);
mdns_if_t other_if = _mdns_get_other_if(tcpip_if);
if (other_if == MDNS_MAX_INTERFACES) {
return false;
}
@ -1324,7 +1324,7 @@ static uint8_t _mdns_append_reverse_ptr_record(uint8_t *packet, uint16_t *index,
return 0;
}
if (!_mdns_append_type(packet, index, MDNS_ANSWER_PTR, false, 10 /* TTL set to 10s*/ )) {
if (!_mdns_append_type(packet, index, MDNS_ANSWER_PTR, false, 10 /* TTL set to 10s*/)) {
return 0;
}
@ -1426,7 +1426,7 @@ static uint8_t _mdns_append_answer(uint8_t *packet, uint16_t *index, mdns_out_an
if (!_mdns_if_is_dup(tcpip_if)) {
return 1;
}
mdns_if_t other_if = _mdns_get_other_if (tcpip_if);
mdns_if_t other_if = _mdns_get_other_if(tcpip_if);
if (esp_netif_get_ip_info(_mdns_get_esp_netif(other_if), &if_ip_info)) {
return 1;
}
@ -3029,7 +3029,7 @@ static esp_err_t mdns_pcb_deinit_local(mdns_if_t tcpip_if, mdns_ip_protocol_t ip
static void _mdns_dup_interface(mdns_if_t tcpip_if)
{
uint8_t i;
mdns_if_t other_if = _mdns_get_other_if (tcpip_if);
mdns_if_t other_if = _mdns_get_other_if(tcpip_if);
if (other_if == MDNS_MAX_INTERFACES) {
return; // no other interface found
}
@ -3065,7 +3065,7 @@ static int _mdns_check_a_collision(esp_ip4_addr_t *ip, mdns_if_t tcpip_if)
return -1;//we win
} else if (ret < 0) {
//is it the other interface?
mdns_if_t other_if = _mdns_get_other_if (tcpip_if);
mdns_if_t other_if = _mdns_get_other_if(tcpip_if);
if (other_if == MDNS_MAX_INTERFACES) {
return 1;//AP interface! They win
}
@ -3101,7 +3101,7 @@ static int _mdns_check_aaaa_collision(esp_ip6_addr_t *ip, mdns_if_t tcpip_if)
return -1;//we win
} else if (ret < 0) {
//is it the other interface?
mdns_if_t other_if = _mdns_get_other_if (tcpip_if);
mdns_if_t other_if = _mdns_get_other_if(tcpip_if);
if (other_if == MDNS_MAX_INTERFACES) {
return 1;//AP interface! They win
}
@ -3295,7 +3295,7 @@ static bool _mdns_name_is_selfhosted(mdns_name_t *name)
// hostname only -- check if selfhosted name
if (_str_null_or_empty(name->service) && _str_null_or_empty(name->proto) &&
strcasecmp(name->host, _mdns_server->hostname) == 0 ) {
strcasecmp(name->host, _mdns_server->hostname) == 0) {
return true;
}
@ -3313,11 +3313,11 @@ static bool _mdns_name_is_selfhosted(mdns_name_t *name)
static bool _mdns_name_is_ours(mdns_name_t *name)
{
//domain have to be "local"
if (_str_null_or_empty(name->domain) || ( strcasecmp(name->domain, MDNS_DEFAULT_DOMAIN)
if (_str_null_or_empty(name->domain) || (strcasecmp(name->domain, MDNS_DEFAULT_DOMAIN)
#ifdef CONFIG_MDNS_RESPOND_REVERSE_QUERIES
&& strcasecmp(name->domain, "arpa")
#endif /* CONFIG_MDNS_RESPOND_REVERSE_QUERIES */
) ) {
)) {
return false;
}
@ -4373,7 +4373,7 @@ void _mdns_disable_pcb(mdns_if_t tcpip_if, mdns_ip_protocol_t ip_protocol)
if (mdns_is_netif_ready(tcpip_if, ip_protocol)) {
_mdns_clear_pcb_tx_queue_head(tcpip_if, ip_protocol);
mdns_pcb_deinit_local(tcpip_if, ip_protocol);
mdns_if_t other_if = _mdns_get_other_if (tcpip_if);
mdns_if_t other_if = _mdns_get_other_if(tcpip_if);
if (other_if != MDNS_MAX_INTERFACES && _mdns_server->interfaces[other_if].pcbs[ip_protocol].state == PCB_DUP) {
_mdns_server->interfaces[other_if].pcbs[ip_protocol].state = PCB_OFF;
_mdns_enable_pcb(other_if, ip_protocol);
@ -5473,7 +5473,7 @@ static esp_err_t _mdns_task_create_with_caps(void)
_mdns_stack_buffer = heap_caps_malloc(MDNS_SERVICE_STACK_DEPTH, MDNS_TASK_MEMORY_CAPS);
ESP_GOTO_ON_FALSE(_mdns_stack_buffer != NULL, ESP_FAIL, err, TAG, "failed to allocate memory for the mDNS task's stack");
_mdns_service_task_handle = xTaskCreateStaticPinnedToCore( _mdns_service_task, "mdns", MDNS_SERVICE_STACK_DEPTH, NULL, MDNS_TASK_PRIORITY, _mdns_stack_buffer, &mdns_task_buffer, MDNS_TASK_AFFINITY );
_mdns_service_task_handle = xTaskCreateStaticPinnedToCore(_mdns_service_task, "mdns", MDNS_SERVICE_STACK_DEPTH, NULL, MDNS_TASK_PRIORITY, _mdns_stack_buffer, &mdns_task_buffer, MDNS_TASK_AFFINITY);
ESP_GOTO_ON_FALSE(_mdns_service_task_handle != NULL, ESP_FAIL, err, TAG, "failed to create task for the mDNS");
return ret;

View File

@ -59,7 +59,7 @@ uint32_t xTaskGetTickCount(void)
}
/// Queue mock
QueueHandle_t xQueueCreate( uint32_t uxQueueLength, uint32_t uxItemSize )
QueueHandle_t xQueueCreate(uint32_t uxQueueLength, uint32_t uxItemSize)
{
g_size = uxItemSize;
g_queue = malloc((uxQueueLength) * (uxItemSize));
@ -67,7 +67,7 @@ QueueHandle_t xQueueCreate( uint32_t uxQueueLength, uint32_t uxItemSize )
}
void vQueueDelete( QueueHandle_t xQueue )
void vQueueDelete(QueueHandle_t xQueue)
{
free(xQueue);
}
@ -131,7 +131,7 @@ void *heap_caps_malloc(size_t size, uint32_t caps)
return malloc(size);
}
void heap_caps_free( void *ptr)
void heap_caps_free(void *ptr)
{
free(ptr);
}

View File

@ -117,10 +117,10 @@ uint32_t xTaskGetTickCount(void);
typedef void (*esp_timer_cb_t)(void *arg);
// Queue mock
QueueHandle_t xQueueCreate( uint32_t uxQueueLength,
uint32_t uxItemSize );
QueueHandle_t xQueueCreate(uint32_t uxQueueLength,
uint32_t uxItemSize);
void vQueueDelete( QueueHandle_t xQueue );
void vQueueDelete(QueueHandle_t xQueue);
uint32_t xQueueSend(QueueHandle_t xQueue, const void *pvItemToQueue, TickType_t xTicksToWait);
@ -137,7 +137,7 @@ esp_err_t esp_event_handler_unregister(const char *event_base, int32_t event_id,
TaskHandle_t xTaskGetCurrentTaskHandle(void);
void xTaskNotifyGive(TaskHandle_t task);
BaseType_t xTaskNotifyWait(uint32_t bits_entry_clear, uint32_t bits_exit_clear, uint32_t *value, TickType_t wait_time );
BaseType_t xTaskNotifyWait(uint32_t bits_entry_clear, uint32_t bits_exit_clear, uint32_t *value, TickType_t wait_time);
void *heap_caps_malloc(size_t size, uint32_t caps);
void heap_caps_free(void *ptr);