Skip to content

Commit 6307f3d

Browse files
authored
Merge pull request #4448 from mysterywolf/w60x
[w60x][drivers] auto formatted
2 parents b9fca2f + c20c2b6 commit 6307f3d

File tree

11 files changed

+85
-85
lines changed

11 files changed

+85
-85
lines changed

bsp/w60x/drivers/board.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,14 @@ void disp_version_info(void)
9898

9999
void wm_gpio_config(void)
100100
{
101-
/* must call first */
102-
wm_gpio_af_disable();
103-
104-
/*MASTER SPI configuratioin*/
105-
wm_spi_cs_config(WM_IO_PA_02);
106-
wm_spi_ck_config(WM_IO_PA_11);
107-
wm_spi_di_config(WM_IO_PA_03);
108-
wm_spi_do_config(WM_IO_PA_09);
101+
/* must call first */
102+
wm_gpio_af_disable();
103+
104+
/*MASTER SPI configuratioin*/
105+
wm_spi_cs_config(WM_IO_PA_02);
106+
wm_spi_ck_config(WM_IO_PA_11);
107+
wm_spi_di_config(WM_IO_PA_03);
108+
wm_spi_do_config(WM_IO_PA_09);
109109
}
110110

111111
static int wm_infsl_init(void)

bsp/w60x/drivers/drv_crypto.c

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -465,25 +465,25 @@ static rt_err_t _bignum_exptmod(struct hwcrypto_bignum *bignum_ctx,
465465
const struct hw_bignum_mpi *b,
466466
const struct hw_bignum_mpi *c)
467467
{
468-
pstm_int pa, pb, pm, pres;
468+
pstm_int pa, pb, pm, pres;
469469
u32 * buff_a = NULL;
470-
u32 * buff_b = NULL;
471-
u32 * buff_m = NULL;
472-
int err = -1;
470+
u32 * buff_b = NULL;
471+
u32 * buff_m = NULL;
472+
int err = -1;
473473
void *buff;
474474
int buff_len;
475475

476476
pstm_init(NULL, &pres);
477477

478478
buff_a = tls_mem_alloc(a->total);
479-
if(buff_a == NULL)
480-
goto out;
481-
buff_b = tls_mem_alloc(b->total);
482-
if(buff_b == NULL)
483-
goto out;
484-
buff_m = tls_mem_alloc(c->total);
485-
if(buff_m == NULL)
486-
goto out;
479+
if(buff_a == NULL)
480+
goto out;
481+
buff_b = tls_mem_alloc(b->total);
482+
if(buff_b == NULL)
483+
goto out;
484+
buff_m = tls_mem_alloc(c->total);
485+
if(buff_m == NULL)
486+
goto out;
487487

488488
memset(buff_a, 0, a->total);
489489
memset(buff_b, 0, b->total);
@@ -494,29 +494,29 @@ static rt_err_t _bignum_exptmod(struct hwcrypto_bignum *bignum_ctx,
494494
memcpy(buff_m, c->p, c->total);
495495

496496
pstm_reverse((unsigned char *)buff_a, a->total);
497-
pstm_reverse((unsigned char *)buff_b, b->total);
498-
pstm_reverse((unsigned char *)buff_m, c->total);
497+
pstm_reverse((unsigned char *)buff_b, b->total);
498+
pstm_reverse((unsigned char *)buff_m, c->total);
499499

500500
// *((volatile unsigned int *)0x40000710) = *((volatile unsigned int *)0x40000710) | (0x1 << 28);
501501

502-
if ((err = pstm_init_for_read_unsigned_bin(NULL, &pa, a->total)) != PS_SUCCESS){
503-
goto out;
504-
}
505-
if ((err = pstm_read_unsigned_bin(&pa, (unsigned char *)buff_a, a->total)) != PS_SUCCESS) {
506-
goto out;
507-
}
508-
if ((err = pstm_init_for_read_unsigned_bin(NULL, &pb, b->total)) != PS_SUCCESS){
509-
goto out;
510-
}
511-
if ((err = pstm_read_unsigned_bin(&pb, (unsigned char *)buff_b, b->total)) != PS_SUCCESS) {
512-
goto out;
513-
}
514-
if ((err = pstm_init_for_read_unsigned_bin(NULL, &pm, c->total)) != PS_SUCCESS){
515-
goto out;
516-
}
517-
if ((err = pstm_read_unsigned_bin(&pm, (unsigned char *)buff_m, c->total)) != PS_SUCCESS) {
518-
goto out;
519-
}
502+
if ((err = pstm_init_for_read_unsigned_bin(NULL, &pa, a->total)) != PS_SUCCESS){
503+
goto out;
504+
}
505+
if ((err = pstm_read_unsigned_bin(&pa, (unsigned char *)buff_a, a->total)) != PS_SUCCESS) {
506+
goto out;
507+
}
508+
if ((err = pstm_init_for_read_unsigned_bin(NULL, &pb, b->total)) != PS_SUCCESS){
509+
goto out;
510+
}
511+
if ((err = pstm_read_unsigned_bin(&pb, (unsigned char *)buff_b, b->total)) != PS_SUCCESS) {
512+
goto out;
513+
}
514+
if ((err = pstm_init_for_read_unsigned_bin(NULL, &pm, c->total)) != PS_SUCCESS){
515+
goto out;
516+
}
517+
if ((err = pstm_read_unsigned_bin(&pm, (unsigned char *)buff_m, c->total)) != PS_SUCCESS) {
518+
goto out;
519+
}
520520

521521
tls_crypto_exptmod(&pa, &pb, &pm, &pres);
522522
buff_len = pstm_unsigned_bin_size(&pres);
@@ -528,16 +528,16 @@ static rt_err_t _bignum_exptmod(struct hwcrypto_bignum *bignum_ctx,
528528

529529
out:
530530
if(buff_a)
531-
tls_mem_free(buff_a);
532-
if(buff_b)
533-
tls_mem_free(buff_b);
534-
if(buff_m)
535-
tls_mem_free(buff_m);
531+
tls_mem_free(buff_a);
532+
if(buff_b)
533+
tls_mem_free(buff_b);
534+
if(buff_m)
535+
tls_mem_free(buff_m);
536536

537-
pstm_clear(&pa);
538-
pstm_clear(&pb);
539-
pstm_clear(&pm);
540-
pstm_clear(&pres);
537+
pstm_clear(&pa);
538+
pstm_clear(&pb);
539+
pstm_clear(&pm);
540+
pstm_clear(&pres);
541541

542542
if (a->sign < 0)
543543
{
@@ -583,7 +583,7 @@ static const struct hwcrypto_crc_ops crc_ops =
583583
.update = _crc_update,
584584
};
585585

586-
static const struct hwcrypto_bignum_ops bignum_ops =
586+
static const struct hwcrypto_bignum_ops bignum_ops =
587587
{
588588
.add = RT_NULL,
589589
.sub = RT_NULL,
@@ -722,7 +722,7 @@ int wm_hw_crypto_device_init(void)
722722

723723
_crypto_dev.dev.ops = &_ops;
724724
_crypto_dev.dev.id = 0;
725-
rt_memcpy(&_crypto_dev.dev.id, wpa_supplicant_get_mac(),
725+
rt_memcpy(&_crypto_dev.dev.id, wpa_supplicant_get_mac(),
726726
sizeof(_crypto_dev.dev.id) > 6 ?
727727
6 : sizeof(_crypto_dev.dev.id));
728728
_crypto_dev.dev.user_data = &_crypto_dev;

bsp/w60x/drivers/drv_rtc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ static rt_size_t wm_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer,
172172
}
173173

174174
#ifdef RT_USING_DEVICE_OPS
175-
const static struct rt_device_ops _ops =
175+
const static struct rt_device_ops _ops =
176176
{
177177
.init = wm_rtc_init,
178178
.open = wm_rtc_open,

bsp/w60x/drivers/drv_soft_i2c.c

Lines changed: 3 additions & 3 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
*
@@ -198,8 +198,8 @@ int rt_soft_i2c_init(void)
198198
w60x_i2c_bus_unlock(&soft_i2c_config[i]);
199199

200200
LOG_D("software simulation %s init done, pin scl: %d, pin sda %d",
201-
soft_i2c_config[i].bus_name,
202-
soft_i2c_config[i].scl,
201+
soft_i2c_config[i].bus_name,
202+
soft_i2c_config[i].scl,
203203
soft_i2c_config[i].sda);
204204
}
205205

bsp/w60x/drivers/drv_soft_i2c.h

Lines changed: 1 addition & 1 deletion
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
*

bsp/w60x/drivers/drv_standby.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ extern void standby_idr(void);
3333
#if (1 == GCC_COMPILE)
3434
void wm_pm_standby(void)
3535
{
36-
__asm volatile (
36+
__asm volatile (
3737
" cpsid i \n" /* disable irq*/
3838
" dsb \n"
3939
" ldr r0, =0X499 \n"
@@ -76,7 +76,7 @@ void sys_start_standby(int ms)
7676
{
7777
return;
7878
}
79-
tls_irq_enable(PMU_GPIO_WAKEUP_INT); //Open interrupt by default to clear the interrupt flag for IO wake-up
79+
tls_irq_enable(PMU_GPIO_WAKEUP_INT); //Open interrupt by default to clear the interrupt flag for IO wake-up
8080
val = tls_reg_read32(HR_PMU_PS_CR);
8181
val |= 0x01;
8282
tls_reg_write32(HR_PMU_PS_CR, val);

bsp/w60x/drivers/drv_uart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ static int wm_uart_flow_ctrl_set(TLS_UART_REGS_T *UARTx, TLS_UART_FLOW_CTRL_MODE
208208

209209
case TLS_UART_FLOW_CTRL_HARDWARE:
210210
UARTx->UR_FC = (1UL << 0) | (6UL << 2);
211-
break;
211+
break;
212212

213213
default:
214214
break;

bsp/w60x/drivers/pin_config.h

Lines changed: 1 addition & 1 deletion
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
*

bsp/w60x/oneshot/oneshot.c

Lines changed: 21 additions & 21 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
*
@@ -16,37 +16,37 @@
1616
/* start oneshot */
1717
int wm_oneshot_start(WM_ONESHOT_MODE mode, wm_oneshot_callback callback)
1818
{
19-
tls_wifi_oneshot_callback_register(callback);
20-
if(mode == WM_UDP)
21-
{
22-
tls_wifi_set_oneshot_config_mode(0);
23-
}
19+
tls_wifi_oneshot_callback_register(callback);
20+
if(mode == WM_UDP)
21+
{
22+
tls_wifi_set_oneshot_config_mode(0);
23+
}
2424
else if (mode == WM_APSOCKET)
2525
{
2626
tls_wifi_set_oneshot_config_mode(1);
27-
}
28-
else if(mode == WM_APWEB)
29-
{
30-
tls_wifi_set_oneshot_config_mode(2);
31-
}
32-
else
33-
{
34-
return -1;
35-
}
36-
tls_wifi_set_oneshot_flag(1);
37-
return 0;
27+
}
28+
else if(mode == WM_APWEB)
29+
{
30+
tls_wifi_set_oneshot_config_mode(2);
31+
}
32+
else
33+
{
34+
return -1;
35+
}
36+
tls_wifi_set_oneshot_flag(1);
37+
return 0;
3838
}
3939

4040
/* stop oneshot */
4141
int wm_oneshot_stop(void)
4242
{
43-
tls_wifi_oneshot_callback_delete();
44-
tls_wifi_set_oneshot_flag(0);
45-
return 0;
43+
tls_wifi_oneshot_callback_delete();
44+
tls_wifi_set_oneshot_flag(0);
45+
return 0;
4646
}
4747

4848
/* get status */
4949
int wm_oneshot_get(void)
5050
{
51-
return tls_wifi_get_oneshot_flag();
51+
return tls_wifi_get_oneshot_flag();
5252
}

bsp/w60x/oneshot/oneshot.h

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
*
@@ -12,9 +12,9 @@
1212
#define DRV_ONESHOT_H__
1313

1414
typedef enum{
15-
WM_UDP,
15+
WM_UDP,
1616
WM_APSOCKET,
17-
WM_APWEB
17+
WM_APWEB
1818
}WM_ONESHOT_MODE;
1919

2020

0 commit comments

Comments
 (0)