Skip to content

Commit 2e15ec2

Browse files
committed
modify drv_sdio.c
2 parents 77fd2c4 + 89a1f64 commit 2e15ec2

File tree

89 files changed

+41466
-16
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+41466
-16
lines changed

bsp/CME_M7/drivers/emac.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,19 @@ struct pbuf *rt_cme_eth_rx(rt_device_t dev)
312312
ETH_RX_DESC *desc;
313313
uint32_t framelength;
314314
struct rt_cme_eth * cme_eth = (struct rt_cme_eth *)dev;
315+
rt_err_t result;
315316

316-
rt_mutex_take(&cme_eth->lock, RT_WAITING_FOREVER);
317+
result = rt_mutex_take(&cme_eth->lock, RT_WAITING_FOREVER);
318+
if (result == -RT_ETIMEOUT)
319+
{
320+
rt_kprintf("Take mutex time out.\n");
321+
goto _exit;
322+
}
323+
else if (result == -RT_ERROR)
324+
{
325+
rt_kprintf("Take mutex error.\n");
326+
goto _exit;
327+
}
317328

318329
desc = ETH_AcquireFreeRxDesc();
319330
if(desc == RT_NULL)

bsp/fh8620/drivers/i2c.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ static rt_size_t fh_i2c_xfer(struct rt_i2c_bus_device *dev,
8787

8888
rt_completion_init(&i2c_drv->transfer_completion);
8989

90-
ret = rt_mutex_take(i2c_drv->lock, RT_WAITING_FOREVER );
90+
ret = rt_mutex_take(i2c_drv->lock, RT_WAITING_FOREVER);
91+
if (ret != RT_EOK) {
92+
goto done;
93+
}
9194

9295
i2c_drv->msgs = msgs;
9396
i2c_drv->msgs_num = num;

bsp/gd32103c-eval/Kconfig

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
mainmenu "RT-Thread Configuration"
2+
3+
config BSP_DIR
4+
string
5+
option env="BSP_ROOT"
6+
default "."
7+
8+
config RTT_DIR
9+
string
10+
option env="RTT_ROOT"
11+
default "../.."
12+
13+
# you can change the RTT_ROOT default: "rt-thread"
14+
# example : default "F:/git_repositories/rt-thread"
15+
16+
config PKGS_DIR
17+
string
18+
option env="PKGS_ROOT"
19+
default "packages"
20+
21+
source "$RTT_DIR/Kconfig"
22+
source "$PKGS_DIR/Kconfig"
23+
24+
config SOC_SERIES_GD32F1
25+
bool
26+
default y
27+
28+
config SOC_GD32103C
29+
bool
30+
select RT_USING_COMPONENTS_INIT
31+
select RT_USING_USER_MAIN
32+
select SOC_SERIES_GD32F1
33+
default y
34+
35+
menu "On-chip Peripheral Drivers"
36+
menuconfig BSP_USING_UART
37+
bool "Enable UART"
38+
default y
39+
select RT_USING_SERIAL
40+
if BSP_USING_UART
41+
config BSP_USING_UART0
42+
bool "using uart0"
43+
default n
44+
config BSP_USING_UART1
45+
bool "using uart1"
46+
default n
47+
config BSP_USING_UART2
48+
bool "using uart2"
49+
default y
50+
config BSP_USING_UART3
51+
bool "using uart3"
52+
default n
53+
config BSP_USING_UART4
54+
bool "using uart4"
55+
default n
56+
endif
57+
menuconfig BSP_USING_ADC
58+
bool "Enable ADC"
59+
default n
60+
select RT_USING_ADC
61+
if BSP_USING_ADC
62+
config BSP_USING_ADC0
63+
bool "using adc0"
64+
default n
65+
config BSP_USING_ADC1
66+
bool "using adc1"
67+
default n
68+
endif
69+
70+
endmenu

bsp/gd32103c-eval/Libraries/CMSIS/GD/GD32F1xx/Include/gd32f10x.h

Lines changed: 8033 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**
2+
******************************************************************************
3+
* @brief Configuration file.
4+
******************************************************************************
5+
*/
6+
7+
/* Define to prevent recursive inclusion -------------------------------------*/
8+
#ifndef __GD32F10X_CONF_H
9+
#define __GD32F10X_CONF_H
10+
11+
/* Includes ------------------------------------------------------------------*/
12+
/* Comment the line below to disable peripheral header file inclusion */
13+
#include "gd32f10x_adc.h"
14+
#include "gd32f10x_bkp.h"
15+
#include "gd32f10x_can.h"
16+
#include "gd32f10x_crc.h"
17+
#include "gd32f10x_dac.h"
18+
#include "gd32f10x_dma.h"
19+
#include "gd32f10x_eth.h"
20+
#include "gd32f10x_exmc.h"
21+
#include "gd32f10x_exti.h"
22+
#include "gd32f10x_fmc.h"
23+
#include "gd32f10x_gpio.h"
24+
#include "gd32f10x_i2c.h"
25+
#include "gd32f10x_iwdg.h"
26+
#include "gd32f10x_mcudbg.h"
27+
#include "gd32f10x_misc.h"
28+
#include "gd32f10x_pwr.h"
29+
#include "gd32f10x_rcc.h"
30+
#include "gd32f10x_rcu.h"
31+
#include "gd32f10x_rtc.h"
32+
#include "gd32f10x_sdio.h"
33+
#include "gd32f10x_spi.h"
34+
#include "gd32f10x_timer.h"
35+
#include "gd32f10x_usart.h"
36+
#include "gd32f10x_wwdg.h"
37+
38+
#endif /* __GD32F10X_CONF_H */
39+
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/**
2+
******************************************************************************
3+
* @brief CMSIS Cortex-M3 Device Peripheral Access Layer System Header File.
4+
******************************************************************************
5+
*/
6+
7+
/** @addtogroup CMSIS
8+
* @{
9+
*/
10+
11+
/** @addtogroup GD32F10x_system
12+
* @{
13+
*/
14+
15+
/**
16+
* @brief Define to prevent recursive inclusion
17+
*/
18+
#ifndef __SYSTEM_GD32F10X_H
19+
#define __SYSTEM_GD32F10X_H
20+
21+
#ifdef __cplusplus
22+
extern "C" {
23+
#endif
24+
25+
/** @addtogroup GD32F10x_System_Includes
26+
* @{
27+
*/
28+
29+
/**
30+
* @}
31+
*/
32+
33+
/** @addtogroup GD32F10x_System_Exported_types
34+
* @{
35+
*/
36+
extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
37+
38+
/**
39+
* @}
40+
*/
41+
42+
/** @addtogroup GD32F10x_System_Exported_Functions
43+
* @{
44+
*/
45+
extern void SystemInit(void);
46+
extern void SystemCoreClockUpdate(void);
47+
/**
48+
* @}
49+
*/
50+
51+
#ifdef __cplusplus
52+
}
53+
#endif
54+
55+
#endif /*__SYSTEM_GD32F10X_H */
56+
57+
/**
58+
* @}
59+
*/
60+
61+
/**
62+
* @}
63+
*/
64+

0 commit comments

Comments
 (0)