Skip to content

Commit 77b8db8

Browse files
committed
[imxrt] format codes
1 parent 2962a86 commit 77b8db8

File tree

17 files changed

+171
-173
lines changed

17 files changed

+171
-173
lines changed

bsp/imxrt/libraries/drivers/drv_can.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2006-2018, RT-Thread Development Team
2+
* Copyright (c) 2006-2021, RT-Thread Development Team
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
@@ -375,7 +375,7 @@ static int can_send(struct rt_can_device *can_dev, const void *buf, rt_uint32_t
375375
ret = RT_EBUSY;
376376
break;
377377
}
378-
378+
379379
return ret;
380380
}
381381

bsp/imxrt/libraries/drivers/drv_can.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/*
2-
* Copyright (c) 2006-2018, RT-Thread Development Team
2+
* Copyright (c) 2006-2021, RT-Thread Development Team
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
66
* Change Logs:
77
* Date Author Notes
88
* 2019-06-28 misonyo the first version.
99
*/
10-
10+
1111
#ifndef DRV_CAN_H__
1212
#define DRV_CAN_H__
1313

bsp/imxrt/libraries/drivers/drv_eth.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2006-2019, RT-Thread Development Team
2+
* Copyright (c) 2006-2021, RT-Thread Development Team
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
@@ -329,7 +329,7 @@ static status_t _ENET_SendFrame(ENET_Type *base, enet_handle_t *handle, const ui
329329
#endif /* FSL_FEATURE_MEMORY_HAS_ADDRESS_OFFSET */
330330

331331
pbuf_copy_partial((const struct pbuf *)data, (void *)address, length, 0);
332-
332+
333333
/* Set data length. */
334334
curBuffDescrip->length = length;
335335
#ifdef ENET_ENHANCEDBUFFERDESCRIPTOR_MODE
@@ -434,7 +434,7 @@ static status_t _ENET_SendFrame(ENET_Type *base, enet_handle_t *handle, const ui
434434
address = (uint32_t)curBuffDescrip->buffer;
435435
#endif /* FSL_FEATURE_MEMORY_HAS_ADDRESS_OFFSET */
436436
DCACHE_CleanByRange(address, handle->txBuffSizeAlign[0]);
437-
#endif /* FSL_SDK_ENABLE_DRIVER_CACHE_CONTROL */
437+
#endif /* FSL_SDK_ENABLE_DRIVER_CACHE_CONTROL */
438438
/* Active the transmit buffer descriptor. */
439439
_ENET_ActiveSend(base, 0);
440440

@@ -454,8 +454,8 @@ static status_t _ENET_SendFrame(ENET_Type *base, enet_handle_t *handle, const ui
454454
/* transmit packet. */
455455
rt_err_t rt_imxrt_eth_tx(rt_device_t dev, struct pbuf *p)
456456
{
457-
rt_err_t result = RT_EOK;
458-
enet_handle_t * enet_handle = &imxrt_eth_device.enet_handle;
457+
rt_err_t result = RT_EOK;
458+
enet_handle_t * enet_handle = &imxrt_eth_device.enet_handle;
459459

460460
RT_ASSERT(p != NULL);
461461
RT_ASSERT(enet_handle != RT_NULL);

bsp/imxrt/libraries/drivers/drv_gpio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2006-2018, RT-Thread Development Team
2+
* Copyright (c) 2006-2021, RT-Thread Development Team
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
@@ -70,7 +70,7 @@ const struct pin_mask mask_tab[5] =
7070
#endif
7171
};
7272

73-
const rt_int8_t reg_offset[] =
73+
const rt_int8_t reg_offset[] =
7474
{
7575
#if defined(SOC_IMXRT1015_SERIES)
7676
38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 64, 65, 66, 67, 68, 69,

bsp/imxrt/libraries/drivers/drv_gpio.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
/*
2-
* Copyright (c) 2006-2018, RT-Thread Development Team
2+
* Copyright (c) 2006-2021, RT-Thread Development Team
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
66
* Change Logs:
77
* Date Author Notes
88
* 2018-4-30 misonyo the first version.
99
*/
10-
10+
1111
#ifndef DRV_GPIO_H__
1212
#define DRV_GPIO_H__
1313

14-
#include <rtthread.h>
15-
#include <rtdevice.h>
14+
#include <rtthread.h>
15+
#include <rtdevice.h>
1616

1717
#define GET_PIN(PORTx, PIN) (32 * (PORTx - 1) + (PIN & 31)) /* PORTx:1,2,3,4,5 */
1818

bsp/imxrt/libraries/drivers/drv_i2c.c

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2006-2018, RT-Thread Development Team
2+
* Copyright (c) 2006-2021, RT-Thread Development Team
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
@@ -35,9 +35,9 @@ struct imxrt_i2c_bus
3535
volatile rt_uint32_t msg_ptr;
3636
volatile rt_uint32_t dptr;
3737
char *device_name;
38-
#ifdef SOC_IMXRT1170_SERIES
39-
clock_root_t clock_root;
40-
#endif
38+
#ifdef SOC_IMXRT1170_SERIES
39+
clock_root_t clock_root;
40+
#endif
4141
};
4242

4343
#if defined (BSP_USING_I2C1)
@@ -70,7 +70,7 @@ struct imxrt_i2c_bus
7070

7171
/* Select USB1 PLL (360 MHz) as master lpi2c clock source */
7272
#define LPI2C_CLOCK_SOURCE_SELECT (1U)
73-
#ifdef SOC_IMXRT1170_SERIES
73+
#ifdef SOC_IMXRT1170_SERIES
7474
/* Clock divider for master lpi2c clock source */
7575
#define LPI2C_CLOCK_SOURCE_DIVIDER (12U)
7676
#else
@@ -157,19 +157,19 @@ static rt_err_t imxrt_lpi2c_configure(struct imxrt_i2c_bus *bus, lpi2c_master_co
157157
RT_ASSERT(cfg != RT_NULL);
158158

159159
bus->parent.ops = &imxrt_i2c_ops;
160-
#ifdef SOC_IMXRT1170_SERIES
161-
clock_root_config_t rootCfg = {0};
162-
rootCfg.mux = LPI2C_CLOCK_SOURCE_SELECT;
163-
rootCfg.div = LPI2C_CLOCK_SOURCE_DIVIDER + 1;
164-
CLOCK_SetRootClock(bus->clock_root, &rootCfg);
165-
volatile uint32_t freq = CLOCK_GetRootClockFreq(bus->clock_root);
166-
LPI2C_MasterInit(bus->I2C, cfg, freq);
160+
#ifdef SOC_IMXRT1170_SERIES
161+
clock_root_config_t rootCfg = {0};
162+
rootCfg.mux = LPI2C_CLOCK_SOURCE_SELECT;
163+
rootCfg.div = LPI2C_CLOCK_SOURCE_DIVIDER + 1;
164+
CLOCK_SetRootClock(bus->clock_root, &rootCfg);
165+
volatile uint32_t freq = CLOCK_GetRootClockFreq(bus->clock_root);
166+
LPI2C_MasterInit(bus->I2C, cfg, freq);
167167
#else
168-
CLOCK_SetMux(kCLOCK_Lpi2cMux, LPI2C_CLOCK_SOURCE_SELECT);
169-
CLOCK_SetDiv(kCLOCK_Lpi2cDiv, LPI2C_CLOCK_SOURCE_DIVIDER);
168+
CLOCK_SetMux(kCLOCK_Lpi2cMux, LPI2C_CLOCK_SOURCE_SELECT);
169+
CLOCK_SetDiv(kCLOCK_Lpi2cDiv, LPI2C_CLOCK_SOURCE_DIVIDER);
170170
LPI2C_MasterInit(bus->I2C, cfg, LPI2C_CLOCK_FREQUENCY);
171-
#endif
172-
171+
#endif
172+
173173
return RT_EOK;
174174
}
175175

@@ -267,36 +267,36 @@ static rt_size_t imxrt_i2c_mst_xfer(struct rt_i2c_bus_device *bus,
267267
{
268268
if (imxrt_i2c->msg[i].flags & RT_I2C_RD)
269269
{
270-
if ((imxrt_i2c->msg[i].flags & RT_I2C_NO_START) != RT_I2C_NO_START)
271-
{
272-
if (LPI2C_MasterStart(imxrt_i2c->I2C, imxrt_i2c->msg[i].addr, kLPI2C_Write) != kStatus_Success)
273-
{
274-
i = 0;
275-
break;
276-
}
277-
278-
while (LPI2C_MasterGetStatusFlags(imxrt_i2c->I2C) & kLPI2C_MasterNackDetectFlag)
279-
{
280-
}
281-
282-
if (LPI2C_MasterRepeatedStart(imxrt_i2c->I2C, imxrt_i2c->msg[i].addr, kLPI2C_Read) != kStatus_Success)
283-
{
284-
i = 0;
285-
break;
286-
}
287-
}
288-
else
289-
{
290-
if (LPI2C_MasterStart(imxrt_i2c->I2C, imxrt_i2c->msg[i].addr, kLPI2C_Read) != kStatus_Success)
291-
{
292-
i = 0;
293-
break;
294-
}
295-
296-
while (LPI2C_MasterGetStatusFlags(imxrt_i2c->I2C) & kLPI2C_MasterNackDetectFlag)
297-
{
298-
}
299-
}
270+
if ((imxrt_i2c->msg[i].flags & RT_I2C_NO_START) != RT_I2C_NO_START)
271+
{
272+
if (LPI2C_MasterStart(imxrt_i2c->I2C, imxrt_i2c->msg[i].addr, kLPI2C_Write) != kStatus_Success)
273+
{
274+
i = 0;
275+
break;
276+
}
277+
278+
while (LPI2C_MasterGetStatusFlags(imxrt_i2c->I2C) & kLPI2C_MasterNackDetectFlag)
279+
{
280+
}
281+
282+
if (LPI2C_MasterRepeatedStart(imxrt_i2c->I2C, imxrt_i2c->msg[i].addr, kLPI2C_Read) != kStatus_Success)
283+
{
284+
i = 0;
285+
break;
286+
}
287+
}
288+
else
289+
{
290+
if (LPI2C_MasterStart(imxrt_i2c->I2C, imxrt_i2c->msg[i].addr, kLPI2C_Read) != kStatus_Success)
291+
{
292+
i = 0;
293+
break;
294+
}
295+
296+
while (LPI2C_MasterGetStatusFlags(imxrt_i2c->I2C) & kLPI2C_MasterNackDetectFlag)
297+
{
298+
}
299+
}
300300

301301
if (LPI2C_MasterStart(imxrt_i2c->I2C, imxrt_i2c->msg[i].addr, kLPI2C_Read) != kStatus_Success)
302302
{
@@ -321,16 +321,16 @@ static rt_size_t imxrt_i2c_mst_xfer(struct rt_i2c_bus_device *bus,
321321
i = 0;
322322
break;
323323
}
324-
324+
325325
if(LPI2C_MasterWaitForTxFifoAllEmpty(imxrt_i2c->I2C) != kStatus_Success)
326326
{
327327
i = 0;
328328
break;
329329
}
330-
331-
if (LPI2C_MasterGetStatusFlags(imxrt_i2c->I2C) & kLPI2C_MasterNackDetectFlag)
330+
331+
if (LPI2C_MasterGetStatusFlags(imxrt_i2c->I2C) & kLPI2C_MasterNackDetectFlag)
332332
{
333-
i = 0;
333+
i = 0;
334334
break;
335335
}
336336

@@ -346,12 +346,12 @@ static rt_size_t imxrt_i2c_mst_xfer(struct rt_i2c_bus_device *bus,
346346
break;
347347
}
348348
}
349-
350-
if (LPI2C_MasterStop(imxrt_i2c->I2C) != kStatus_Success)
351-
{
352-
i = 0;
353-
}
354-
349+
350+
if (LPI2C_MasterStop(imxrt_i2c->I2C) != kStatus_Success)
351+
{
352+
i = 0;
353+
}
354+
355355
}
356356

357357
imxrt_i2c->msg = RT_NULL;
@@ -434,7 +434,7 @@ int rt_hw_i2c_init(void)
434434
#elif defined(HW_I2C5_BADURATE_100kHZ)
435435
masterConfig.baudRate_Hz = 100000U;
436436
#endif /* HW_I2C5_BADURATE_400kHZ */
437-
lpi2c5.clock_root = kCLOCK_Root_Lpi2c5;
437+
lpi2c5.clock_root = kCLOCK_Root_Lpi2c5;
438438
imxrt_lpi2c_configure(&lpi2c5, &masterConfig);
439439
rt_i2c_bus_device_register(&lpi2c5.parent, lpi2c5.device_name);
440440
#endif /* BSP_USING_I2C5 */
@@ -446,7 +446,7 @@ int rt_hw_i2c_init(void)
446446
#elif defined(HW_I2C6_BADURATE_100kHZ)
447447
masterConfig.baudRate_Hz = 100000U;
448448
#endif /* HW_I2C6_BADURATE_400kHZ */
449-
lpi2c6.clock_root = kCLOCK_Root_Lpi2c6;
449+
lpi2c6.clock_root = kCLOCK_Root_Lpi2c6;
450450
imxrt_lpi2c_configure(&lpi2c6, &masterConfig);
451451
rt_i2c_bus_device_register(&lpi2c6.parent, lpi2c6.device_name);
452452
#endif /* BSP_USING_I2C6 */

bsp/imxrt/libraries/drivers/drv_mdio.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
21
/*
3-
* Copyright (c) 2006-2020, RT-Thread Development Team
2+
* Copyright (c) 2006-2021, RT-Thread Development Team
43
*
54
* SPDX-License-Identifier: Apache-2.0
65
*

bsp/imxrt/libraries/drivers/drv_mdio.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
21
/*
3-
* Copyright (c) 2006-2020, RT-Thread Development Team
2+
* Copyright (c) 2006-2021, RT-Thread Development Team
43
*
54
* SPDX-License-Identifier: Apache-2.0
65
*

bsp/imxrt/libraries/drivers/drv_pulse_encoder.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2006-2018, RT-Thread Development Team
2+
* Copyright (c) 2006-2021, RT-Thread Development Team
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
@@ -22,7 +22,7 @@
2222
#if !defined(BSP_USING_PULSE_ENCODER1) && !defined(BSP_USING_PULSE_ENCODER2) && !defined(BSP_USING_PULSE_ENCODER3) \
2323
&& !defined(BSP_USING_PULSE_ENCODER4)
2424
#error "Please define at least one BSP_USING_PULSE_ENCODERx"
25-
/* this driver can be disabled at menuconfig RT-Thread Components Device Drivers */
25+
/* this driver can be disabled at menuconfig -> RT-Thread Components -> Device Drivers */
2626
#elif (defined(BSP_USING_PULSE_ENCODER2) || defined(BSP_USING_PULSE_ENCODER3) || defined(BSP_USING_PULSE_ENCODER4)) || defined(SOC_IMXRT1015_SERIES)
2727
#error "IMXRT1015 had only one quadrature decoder module"
2828
#elif (defined(BSP_USING_PULSE_ENCODER3) || defined(BSP_USING_PULSE_ENCODER4)) || defined(SOC_IMXRT1020_SERIES)
@@ -157,4 +157,4 @@ int rt_hw_pulse_encoder_init(void)
157157
}
158158
INIT_BOARD_EXPORT(rt_hw_pulse_encoder_init);
159159

160-
#endif
160+
#endif

bsp/imxrt/libraries/drivers/drv_sai.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/*
2-
* Copyright (c) 2006-2018, RT-Thread Development Team
2+
* Copyright (c) 2006-2021, RT-Thread Development Team
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
66
* Change Logs:
77
* Date Author Notes
88
* 2018-4-30 misonyo the first version.
99
*/
10-
10+
1111
#include <rtthread.h>
1212
#include <rthw.h>
1313
#include <rtdef.h>

0 commit comments

Comments
 (0)