CI: fixing the files to be complient with pre-commit hooks

This commit is contained in:
Suren Gabrielyan
2022-10-11 16:31:57 +02:00
parent 9d45d505d5
commit 945bd17701
205 changed files with 3130 additions and 3441 deletions

View File

@ -29,7 +29,7 @@
extern esp_netif_netstack_config_t *netstack_default_slip;
typedef struct slip_modem* slip_modem_handle;
typedef struct slip_modem *slip_modem_handle;
// Filter callbacks for handling application specific slip messages
typedef bool slip_rx_filter_cb_t(slip_modem_handle slip, uint8_t *data, uint32_t len);

View File

@ -66,9 +66,9 @@ void esp_netif_lwip_slip_input(void *h, void *buffer, unsigned int len, void *eb
// Update slip netif with data
const int max_batch = 255;
int sent = 0;
while(sent < len) {
while (sent < len) {
int batch = (len - sent) > max_batch ? max_batch : (len - sent);
slipif_received_bytes(netif, buffer+sent, batch);
slipif_received_bytes(netif, buffer + sent, batch);
sent += batch;
}
@ -105,7 +105,7 @@ void slip_modem_netif_raw_write(esp_netif_t *netif, void *buffer, size_t len)
/** @brief Get esp-netif object corresponding to registration index
*/
static esp_netif_t * get_netif_with_esp_index(int index)
static esp_netif_t *get_netif_with_esp_index(int index)
{
esp_netif_t *netif = NULL;
int counter = 0;
@ -120,7 +120,7 @@ static esp_netif_t * get_netif_with_esp_index(int index)
/** @brief Return list registration index of the supplied netif ptr
*/
static int get_esp_netif_index(esp_netif_t * esp_netif)
static int get_esp_netif_index(esp_netif_t *esp_netif)
{
esp_netif_t *netif = NULL;
int counter = 0;
@ -151,10 +151,10 @@ static err_t esp_slipif_init(struct netif *netif)
}
const struct esp_netif_netstack_config s_netif_config_slip = {
.lwip = {
.init_fn = esp_slipif_init,
.input_fn = esp_netif_lwip_slip_input,
}
.lwip = {
.init_fn = esp_slipif_init,
.input_fn = esp_netif_lwip_slip_input,
}
};
const esp_netif_netstack_config_t *netstack_default_slip = &s_netif_config_slip;

View File

@ -1,10 +1,11 @@
/* SLIP Client Example
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*/
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
/*
* SLIP Client Example
*/
#include <string.h>
#include <sys/socket.h>
@ -168,7 +169,7 @@ static bool slip_rx_filter(slip_modem_handle slip, uint8_t *data, uint32_t len)
#if CONFIG_EXAMPLE_IPV4
static const esp_netif_ip_info_t s_slip_ip4 = {
.ip = { .addr = ESP_IP4TOADDR( 10, 0, 0, 2) },
.ip = { .addr = ESP_IP4TOADDR( 10, 0, 0, 2) },
};
#endif
@ -179,11 +180,12 @@ esp_netif_t *slip_if_init(void)
esp_netif_inherent_config_t base_cfg = ESP_NETIF_INHERENT_DEFAULT_SLIP()
#if CONFIG_EXAMPLE_IPV4
base_cfg.ip_info = &s_slip_ip4;
base_cfg.ip_info = &s_slip_ip4;
#endif
esp_netif_config_t cfg = { .base = &base_cfg,
.driver = NULL,
.stack = netstack_default_slip };
.stack = netstack_default_slip
};
esp_netif_t *slip_netif = esp_netif_new(&cfg);
@ -229,7 +231,7 @@ void app_main(void)
ESP_ERROR_CHECK(esp_event_loop_create_default());
// Setup slip interface
esp_netif_t* esp_netif = slip_if_init();
esp_netif_t *esp_netif = slip_if_init();
assert(esp_netif);
// Start the UDP user application