Skip to content

Commit 349648f

Browse files
committed
Apply restyle.sh
1 parent 8d440f4 commit 349648f

File tree

4 files changed

+45
-43
lines changed

4 files changed

+45
-43
lines changed

libraries/lwIP_w55rp20/src/utility/w55rp20.cpp

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ uint8_t Wiznet55rp20::wizchip_read(uint8_t block, uint16_t address) {
4848

4949
block |= AccessModeRead;
5050

51-
spi_data[0] = (address & 0x00FF00) >> 8;
52-
spi_data[1] = (address & 0x0000FF) >> 0;
53-
spi_data[2] = block;
51+
spi_data[0] = (address & 0x00FF00) >> 8;
52+
spi_data[1] = (address & 0x0000FF) >> 0;
53+
spi_data[2] = block;
5454
(*wiznet_pio_spi_handle)->write_buffer(spi_data, 3);
5555
ret = (*wiznet_pio_spi_handle)->read_byte();
5656

@@ -70,9 +70,9 @@ void Wiznet55rp20::wizchip_read_buf(uint8_t block, uint16_t address, uint8_t* pB
7070

7171
block |= AccessModeRead;
7272

73-
spi_data[0] = (address & 0x00FF00) >> 8;
74-
spi_data[1] = (address & 0x0000FF) >> 0;
75-
spi_data[2] = block;
73+
spi_data[0] = (address & 0x00FF00) >> 8;
74+
spi_data[1] = (address & 0x0000FF) >> 0;
75+
spi_data[2] = block;
7676
(*wiznet_pio_spi_handle)->write_buffer(spi_data, 3);
7777
(*wiznet_pio_spi_handle)->read_buffer(pBuf, len);
7878

@@ -87,8 +87,8 @@ void Wiznet55rp20::wizchip_write(uint8_t block, uint16_t address, uint8_t wb) {
8787
block |= AccessModeWrite;
8888

8989
spi_data[0] = (address & 0x00FF00) >> 8;
90-
spi_data[1] = (address & 0x0000FF) >> 0;
91-
spi_data[2] = block;
90+
spi_data[1] = (address & 0x0000FF) >> 0;
91+
spi_data[2] = block;
9292
spi_data[3] = wb;
9393
(*wiznet_pio_spi_handle)->write_buffer(spi_data, 4);
9494

@@ -101,7 +101,7 @@ void Wiznet55rp20::wizchip_write_word(uint8_t block, uint16_t address, uint16_t
101101
}
102102

103103
void Wiznet55rp20::wizchip_write_buf(uint8_t block, uint16_t address, const uint8_t* pBuf,
104-
uint16_t len) {
104+
uint16_t len) {
105105
uint16_t i;
106106
uint8_t spi_data[3];
107107

@@ -110,10 +110,10 @@ void Wiznet55rp20::wizchip_write_buf(uint8_t block, uint16_t address, const uint
110110
block |= AccessModeWrite;
111111

112112
spi_data[0] = (address & 0x00FF00) >> 8;
113-
spi_data[1] = (address & 0x0000FF);
114-
spi_data[2] = block;
115-
(*wiznet_pio_spi_handle)->write_buffer(spi_data, 3);
116-
(*wiznet_pio_spi_handle)->write_buffer(pBuf, len);
113+
spi_data[1] = (address & 0x0000FF);
114+
spi_data[2] = block;
115+
(*wiznet_pio_spi_handle)->write_buffer(spi_data, 3);
116+
(*wiznet_pio_spi_handle)->write_buffer(pBuf, len);
117117

118118
wizchip_cs_deselect();
119119
}
@@ -257,8 +257,9 @@ bool Wiznet55rp20::begin(const uint8_t* mac_address, netif *net) {
257257
wiznet_pio_spi_config.data_out_pin = WIZNET_PIO_SPI_MOSI_PIN;
258258
wiznet_pio_spi_config.clock_pin = WIZNET_PIO_SPI_SCK_PIN;
259259

260-
if (wiznet_pio_spi_handle != NULL)
260+
if (wiznet_pio_spi_handle != NULL) {
261261
wiznet_pio_spi_close(wiznet_pio_spi_handle);
262+
}
262263
wiznet_pio_spi_handle = wiznet_pio_spi_open(&wiznet_pio_spi_config);
263264
(*wiznet_pio_spi_handle)->set_active(wiznet_pio_spi_handle);
264265

@@ -267,13 +268,13 @@ bool Wiznet55rp20::begin(const uint8_t* mac_address, netif *net) {
267268

268269
pinMode(WIZNET_PIO_SPI_CS_PIN, OUTPUT);
269270
wizchip_cs_deselect();
270-
271+
271272
wizchip_sw_reset();
272273

273274
// Use the full 16Kb of RAM for Socket 0
274275
setSn_RXBUF_SIZE(16);
275276
setSn_TXBUF_SIZE(16);
276-
277+
277278
// Set our local MAC address
278279
setSHAR(_mac_address);
279280

libraries/lwIP_w55rp20/src/wiznet_pio_spi.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*
2-
* Copyright (c) 2024, WIZnet Co., Ltd.
3-
* Copyright (c) 2023 Raspberry Pi (Trading) Ltd.
4-
*
5-
* SPDX-License-Identifier: BSD-3-Clause
6-
*/
2+
Copyright (c) 2024, WIZnet Co., Ltd.
3+
Copyright (c) 2023 Raspberry Pi (Trading) Ltd.
4+
5+
SPDX-License-Identifier: BSD-3-Clause
6+
*/
77

88
#include <stdio.h>
99
#include <string.h>
@@ -76,7 +76,7 @@ static void wiznet_pio_spi_gpio_setup(wiznet_pio_spi_state_t *state) {
7676

7777
wiznet_pio_spi_handle_t wiznet_pio_spi_open(const wiznet_pio_spi_config_t *wiznet_pio_spi_config) {
7878
wiznet_pio_spi_state_t *state;
79-
for(int i = 0; i < count_of(wiznet_pio_spi_state); i++) {
79+
for (int i = 0; i < count_of(wiznet_pio_spi_state); i++) {
8080
if (!wiznet_pio_spi_state[i].funcs) {
8181
state = &wiznet_pio_spi_state[i];
8282
break;
@@ -119,11 +119,11 @@ wiznet_pio_spi_handle_t wiznet_pio_spi_open(const wiznet_pio_spi_config_t *wizne
119119
hw_write_masked(&pads_bank0_hw->io[state->spi_config->clock_pin],
120120
(uint)PADS_DRIVE_STRENGTH << PADS_BANK0_GPIO0_DRIVE_LSB,
121121
PADS_BANK0_GPIO0_DRIVE_BITS
122-
);
122+
);
123123
hw_write_masked(&pads_bank0_hw->io[state->spi_config->clock_pin],
124124
(uint)1 << PADS_BANK0_GPIO0_SLEWFAST_LSB,
125125
PADS_BANK0_GPIO0_SLEWFAST_BITS
126-
);
126+
);
127127

128128
sm_config_set_out_pins(&sm_config, state->spi_config->data_out_pin, 1);
129129
sm_config_set_in_pins(&sm_config, state->spi_config->data_in_pin);
@@ -158,8 +158,9 @@ void wiznet_pio_spi_close(wiznet_pio_spi_handle_t handle) {
158158
wiznet_pio_spi_state_t *state = (wiznet_pio_spi_state_t *)handle;
159159
if (state) {
160160
if (state->pio_sm >= 0) {
161-
if (state->pio_offset != -1)
161+
if (state->pio_offset != -1) {
162162
pio_remove_program(state->pio, &WIZNET_PIO_SPI_PROGRAM_FUNC, state->pio_offset);
163+
}
163164

164165
pio_sm_unclaim(state->pio, state->pio_sm);
165166
}
@@ -220,7 +221,7 @@ bool wiznet_pio_spi_transfer(const uint8_t *tx, size_t tx_length, uint8_t *rx, s
220221
assert(tx && tx_length && rx_length);
221222

222223
pio_sm_set_enabled(state->pio, state->pio_sm, false); // disable sm
223-
pio_sm_set_wrap(state->pio, state->pio_sm, state->pio_offset + WIZNET_PIO_SPI_OFFSET_WRITE_BITS, state->pio_offset + WIZNET_PIO_SPI_OFFSET_READ_END - 1);
224+
pio_sm_set_wrap(state->pio, state->pio_sm, state->pio_offset + WIZNET_PIO_SPI_OFFSET_WRITE_BITS, state->pio_offset + WIZNET_PIO_SPI_OFFSET_READ_END - 1);
224225
pio_sm_clear_fifos(state->pio, state->pio_sm); // clear fifos from previous run
225226
pio_sm_set_pindirs_with_mask(state->pio, state->pio_sm, 1u << state->spi_config->data_out_pin, 1u << state->spi_config->data_out_pin);
226227
pio_sm_restart(state->pio, state->pio_sm);
@@ -294,7 +295,7 @@ bool wiznet_pio_spi_transfer(const uint8_t *tx, size_t tx_length, uint8_t *rx, s
294295

295296
// To read a byte we must first have been asked to write a 3 byte spi header
296297
static uint8_t wiznet_pio_spi_read_byte(void) {
297-
assert(active_state);
298+
assert(active_state);
298299
assert(active_state->spi_header_count == WIZNET_PIO_SPI_HEADER_LEN);
299300
uint8_t ret;
300301
if (!wiznet_pio_spi_transfer(active_state->spi_header, active_state->spi_header_count, &ret, 1)) {

libraries/lwIP_w55rp20/src/wiznet_pio_spi.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*
2-
* Copyright (c) 2024 WIZnet Co., Ltd.
3-
* Copyright (c) 2023 Raspberry Pi (Trading) Ltd.
4-
*
5-
* SPDX-License-Identifier: BSD-3-Clause
6-
*/
2+
Copyright (c) 2024 WIZnet Co., Ltd.
3+
Copyright (c) 2023 Raspberry Pi (Trading) Ltd.
4+
5+
SPDX-License-Identifier: BSD-3-Clause
6+
*/
77

88
#ifndef _WIZNET_PIO_SPI_H_
99
#define _WIZNET_PIO_SPI_H_

libraries/lwIP_w55rp20/src/wiznet_pio_spi.pio.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@
2020
#define wiznet_pio_spi_write_read_offset_read_end 9u
2121

2222
static const uint16_t wiznet_pio_spi_write_read_program_instructions[] = {
23-
// .wrap_target
24-
0x6001, // 0: out pins, 1 side 0
25-
0x1040, // 1: jmp x--, 0 side 1
26-
0xe000, // 2: set pins, 0 side 0
27-
0xe080, // 3: set pindirs, 0 side 0
28-
0xf026, // 4: set x, 6 side 1
29-
0x4001, // 5: in pins, 1 side 0
30-
0x1045, // 6: jmp x--, 5 side 1
31-
0x4001, // 7: in pins, 1 side 0
32-
0x0084, // 8: jmp y--, 4 side 0
33-
// .wrap
23+
// .wrap_target
24+
0x6001, // 0: out pins, 1 side 0
25+
0x1040, // 1: jmp x--, 0 side 1
26+
0xe000, // 2: set pins, 0 side 0
27+
0xe080, // 3: set pindirs, 0 side 0
28+
0xf026, // 4: set x, 6 side 1
29+
0x4001, // 5: in pins, 1 side 0
30+
0x1045, // 6: jmp x--, 5 side 1
31+
0x4001, // 7: in pins, 1 side 0
32+
0x0084, // 8: jmp y--, 4 side 0
33+
// .wrap
3434
};
3535

3636
#if !PICO_NO_HARDWARE

0 commit comments

Comments
 (0)