Skip to content

Commit 8d66098

Browse files
committed
update
1 parent ea24a41 commit 8d66098

File tree

12 files changed

+21
-33
lines changed

12 files changed

+21
-33
lines changed

bsp/phytium/libraries/drivers/drv_i2c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ static rt_ssize_t i2c_master_xfer(struct rt_i2c_bus_device *device, struct rt_i2
189189
struct phytium_i2c_bus *i2c_bus;
190190
i2c_bus = (struct phytium_i2c_bus *)(device);
191191
uintptr mem_addr = 0;
192-
192+
193193
for (i = 0; i < num; i++)
194194
{
195195
pmsg = &msgs[i];

bsp/phytium/libraries/drivers/drv_i2s.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static FError FI2sEs8336Init(u32 word_length)
8989
FIOMuxInit();
9090
FIOPadSetI2sMux();
9191

92-
ret = FEs8336DevRegister(&fes8336.fes8336_device);
92+
ret = FEs8336DevRegister(&fes8336.fes8336_device);
9393
if (FT_SUCCESS != ret)
9494
{
9595
printf("ES8336 dev register failed.\r\n");

bsp/phytium/libraries/drivers/drv_sdif.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,12 +481,12 @@ static void sdif_set_iocfg(struct rt_mmcsd_host *host, struct rt_mmcsd_io_cfg *i
481481
// is_ddr = TRUE;
482482
// }
483483
// }
484-
484+
485485
// if (FSDIF_SUCCESS != FSdifSetClkFreqByCalc(&dev->hc, is_ddr, io_cfg->clock))
486486
// {
487487
// LOG_E("FSdifSetClkFreqByCalc fail.")
488488
// }
489-
489+
490490
FSdifTiming timing;
491491
FError ret;
492492
boolean is_ddr = FALSE;

bsp/phytium/libraries/drivers/drv_sdif_msg.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ static void sdif_send_request(struct rt_mmcsd_host *host, struct rt_mmcsd_req *r
560560

561561
rt_err_t err = sdif_pre_request(host, req);
562562
if (err != RT_EOK)
563-
{
563+
{
564564
if (err != RT_EEMPTY)
565565
{
566566
LOG_E("sdif_pre_request fail.");
@@ -583,7 +583,7 @@ static void sdif_send_request(struct rt_mmcsd_host *host, struct rt_mmcsd_req *r
583583
{
584584
LOG_E("SDIF setup DMA failed, err = 0x%x", err);
585585
return;
586-
}
586+
}
587587
}
588588
rt_memset(req_cmd, 0, sizeof(*req_cmd));
589589
request->command = req_cmd;
@@ -627,7 +627,7 @@ static void sdif_set_iocfg(struct rt_mmcsd_host *host, struct rt_mmcsd_io_cfg *i
627627
if (0 != io_cfg->timing)
628628
{
629629
if (host_info->sd_type == SDIF_CARD_TYPE_MICRO_SD)
630-
{
630+
{
631631
if (io_cfg->signal_voltage == MMCSD_SIGNAL_VOLTAGE_330)
632632
{
633633
if (target_ios.ios_clock == FSDIF_CLK_SPEED_400KHZ)
@@ -780,7 +780,7 @@ static rt_err_t sdif_prepare_init_ios(FSdifMsgCtrl *const instance)
780780
if (FSDIF_SUCCESS != FSdifMsgSetIos(instance, &target_ios))
781781
{
782782
LOG_E("Set init IOS failed.");
783-
return RT_ERROR;
783+
return -RT_ERROR;
784784
}
785785

786786
instance->cur_ios.ios_power_mode = FSDIF_MMC_POWER_ON;
@@ -801,9 +801,9 @@ static rt_err_t sdif_prepare_init_volt(FSdifMsgCtrl *const instance, rt_uint32_t
801801
}
802802

803803
if (FSDIF_SUCCESS != FSdifMsgSetVoltage(instance, &target_volt))
804-
{
804+
{
805805
LOG_E("Set init VOLT failed.");
806-
return RT_ERROR;
806+
return -RT_ERROR;
807807
}
808808

809809
return RT_EOK;

bsp/phytium/libraries/drivers/drv_spi_msg.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ static rt_ssize_t spim_xfer(struct rt_spi_device *device, struct rt_spi_message
111111
{
112112
/* send message */
113113
tx_rx_result = FSpiMsgTransfer(xfer_spim_msg_instance, send_buf, RT_NULL, message_length);
114-
115114
}
116115
else if (send_buf != RT_NULL && recv_buf != RT_NULL)
117116
{
@@ -127,7 +126,7 @@ static rt_ssize_t spim_xfer(struct rt_spi_device *device, struct rt_spi_message
127126
}
128127

129128
if (message->cs_release)
130-
{
129+
{
131130
FSpiMsgSetChipSelection(xfer_spim_msg_instance, 0);
132131
}
133132

bsp/phytium/libraries/drivers/drv_usart_msg.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ static rt_err_t uart_msg_control(struct rt_serial_device *serial, int cmd, void
9191
{
9292
struct drv_usart_msg *uart_msg = RT_NULL;
9393
FUartMsg *uart_msg_ptr = RT_NULL;
94-
RT_ASSERT(serial != RT_NULL);
94+
RT_ASSERT(serial != RT_NULL);
9595

9696
uart_msg = rt_container_of(serial, struct drv_usart_msg, serial);
9797
uart_msg_ptr = uart_msg->handle;
@@ -133,11 +133,10 @@ void FUartMsgRecvBufferNoBlocking(FUartMsg *uart_p)
133133
u8 data[16] = {0};
134134
rt_size_t write_length = 0;
135135
u32 received_count = 0;
136-
136+
137137
while (!FUartMsgRxRingBufferIsEmpty(uart_p->config.msg.regfile))
138138
{
139139
received_count += FUartMsgRxChars(&(uart_p->config.msg), data, 16);
140-
141140
}
142141

143142
if(received_count > 0)

bsp/phytium/libraries/drivers/drv_xmac_msg.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ FError FXmacMsgSgsend(FXmacMsgOs *instance_p, struct pbuf *p)
302302
}
303303

304304
/* Start transmit */
305-
FXMAC_MSG_WRITE((&instance_p->instance), FXMAC_MSG_TX_PTR(0), bdindex);
305+
FXMAC_MSG_WRITE((&instance_p->instance), FXMAC_MSG_TX_PTR(0), bdindex);
306306
return status;
307307
}
308308

@@ -1057,29 +1057,25 @@ void FXmacMsgFeatureSetOptions(u32 feature, FXmacMsgCtrl* xmac_p)
10571057
FXmacMsgSendMessage(xmac_p, cmd_id, cmd_subid, NULL, 0, 0);
10581058
LOG_I("FXMAC_MSG_JUMBO_ENABLE_OPTION is ok");
10591059
}
1060-
10611060
/* 单播 */
10621061
if (feature & FXMAC_MSG_OS_CONFIG_UNICAST_ADDRESS_FILITER)
10631062
{
10641063
LOG_I("FXMAC_MSG_UNICAST_OPTION is ok");
10651064
}
1066-
10671065
/* 多播 */
10681066
if (feature & FXMAC_MSG_OS_CONFIG_MULTICAST_ADDRESS_FILITER)
10691067
{
10701068
cmd_subid = FXMAC_MSG_CMD_SET_ENABLE_MC;
10711069
FXmacMsgSendMessage(xmac_p, cmd_id, cmd_subid, NULL, 0, 1);
10721070
LOG_I("FXMAC_MSG_MULTICAST_OPTION is ok");
10731071
}
1074-
10751072
/* 全帧 */
10761073
if (feature & FXMAC_MSG_OS_CONFIG_COPY_ALL_FRAMES)
10771074
{
10781075
cmd_subid = FXMAC_MSG_CMD_SET_ENABLE_PROMISE;
10791076
FXmacMsgSendMessage(xmac_p, cmd_id, cmd_subid, NULL, 0, 0);
10801077
LOG_I("FXMAC_MSG_PROMISC_OPTION is ok");
10811078
}
1082-
10831079
/* 关闭FCS(帧校验序列)校验 */
10841080
if (feature & FXMAC_MSG_OS_CONFIG_CLOSE_FCS_CHECK)
10851081
{
@@ -1190,7 +1186,7 @@ FError FXmacMsgOsInit(FXmacMsgOs *instance_p)
11901186
FXmacMsgGetFeatureAll(xmac_p);
11911187

11921188
/* 硬件重置 */
1193-
FXmacMsgResetHw(xmac_p);
1189+
FXmacMsgResetHw(xmac_p);
11941190

11951191
/* 设置特性 */
11961192
LOG_I("FXmacMsgFeatureSetOptions: config is %x", instance_p->config);

bsp/phytium/libraries/drivers_example/auto_test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void run_all_tests() {
5050
rt_kprintf("\n%s aarch32 test results: \n", BOARD_NAME);
5151
#endif
5252
rt_kprintf("PASS: %d / %d\n", passed_count, test_count);
53-
if (passed_count < test_count)
53+
if (passed_count < test_count)
5454
{
5555
rt_kprintf("[test_failure] example:\n");
5656
for (int i = 0; i < test_count; i++) {
@@ -78,7 +78,7 @@ int auto_test() {
7878
register_test("gpio_sample", gpio_toggle_sample);
7979
#endif
8080
#if defined BSP_USING_I2C
81-
#if defined (PD2408_TEST_A_BOARD) || defined (PD2408_TEST_B_BOARD)
81+
#if defined (PD2408_TEST_A_BOARD) || defined (PD2408_TEST_B_BOARD)
8282
register_test("i2c_msg_sample", i2c_msg_sample);
8383
#else
8484
register_test("i2c_sample", i2c_sample);

bsp/phytium/libraries/drivers_example/can_loopback_sample.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ rt_err_t can_loopback_sample()
131131
{
132132
rt_kprintf("Create can0_rx thread failed.\n");
133133
}
134-
135134
thread = rt_thread_create("can1_rx", can1_rx_thread, RT_NULL, 4096, 10, 10);
136135
if (thread != RT_NULL)
137136
{
@@ -195,7 +194,6 @@ rt_err_t can_loopback_sample()
195194
}
196195
}
197196
}
198-
199197
exit:
200198
/* print message on example run result */
201199
if (res == RT_EOK)

bsp/phytium/libraries/drivers_example/i2c_msg_sample.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,9 @@ int i2c_msg_sample(int argc, char *argv[])
4646
{
4747
if (read_buf[i] != write_content[i])
4848
{
49-
return RT_ERROR;
49+
return -RT_ERROR;
5050
}
51-
5251
}
53-
5452
printf("%s\n", read_buf);
5553
return RT_EOK;
5654
}

0 commit comments

Comments
 (0)