Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
13a8afa2
R
rt-thread
项目概览
BaiXuePrincess
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
13a8afa2
编写于
10月 11, 2018
作者:
双月鸟之roc
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
https://github.com/RT-Thread/rt-thread
上级
f93fb14a
33cb916f
变更
20
展开全部
隐藏空白更改
内联
并排
Showing
20 changed file
with
201 addition
and
360 deletion
+201
-360
bsp/stm32f10x-HAL/applications/main.c
bsp/stm32f10x-HAL/applications/main.c
+2
-6
bsp/stm32f10x-HAL/drivers/board.c
bsp/stm32f10x-HAL/drivers/board.c
+51
-7
bsp/stm32f10x-HAL/drivers/board.h
bsp/stm32f10x-HAL/drivers/board.h
+3
-6
bsp/stm32f10x-HAL/drivers/drv_gpio.c
bsp/stm32f10x-HAL/drivers/drv_gpio.c
+3
-6
bsp/stm32f10x-HAL/drivers/drv_gpio.h
bsp/stm32f10x-HAL/drivers/drv_gpio.h
+3
-6
bsp/stm32f10x-HAL/drivers/drv_sdcard.c
bsp/stm32f10x-HAL/drivers/drv_sdcard.c
+2
-15
bsp/stm32f10x-HAL/drivers/drv_sdcard.h
bsp/stm32f10x-HAL/drivers/drv_sdcard.h
+2
-15
bsp/stm32f10x-HAL/drivers/drv_spi.c
bsp/stm32f10x-HAL/drivers/drv_spi.c
+3
-6
bsp/stm32f10x-HAL/drivers/drv_spi.h
bsp/stm32f10x-HAL/drivers/drv_spi.h
+3
-6
bsp/stm32f10x-HAL/drivers/drv_usart.c
bsp/stm32f10x-HAL/drivers/drv_usart.c
+3
-6
bsp/stm32f10x-HAL/drivers/drv_usart.h
bsp/stm32f10x-HAL/drivers/drv_usart.h
+3
-6
bsp/stm32f10x-HAL/drivers/drv_usb.c
bsp/stm32f10x-HAL/drivers/drv_usb.c
+3
-6
bsp/stm32f10x-HAL/drivers/drv_usb.h
bsp/stm32f10x-HAL/drivers/drv_usb.h
+3
-6
bsp/stm32f10x-HAL/project.uvprojx
bsp/stm32f10x-HAL/project.uvprojx
+66
-220
bsp/stm32f10x-HAL/template.uvprojx
bsp/stm32f10x-HAL/template.uvprojx
+13
-12
bsp/stm32f4xx-HAL/Kconfig
bsp/stm32f4xx-HAL/Kconfig
+8
-4
bsp/stm32f4xx-HAL/drivers/drv_i2c.c
bsp/stm32f4xx-HAL/drivers/drv_i2c.c
+5
-4
bsp/stm32f4xx-HAL/drivers/drv_usart.c
bsp/stm32f4xx-HAL/drivers/drv_usart.c
+18
-17
bsp/stm32f4xx-HAL/rtconfig.py
bsp/stm32f4xx-HAL/rtconfig.py
+4
-5
components/net/sal_socket/include/sal_socket.h
components/net/sal_socket/include/sal_socket.h
+3
-1
未找到文件。
bsp/stm32f10x-HAL/applications/main.c
浏览文件 @
13a8afa2
/*
* File : main.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2009, RT-Thread Development Team
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
...
...
bsp/stm32f10x-HAL/drivers/board.c
浏览文件 @
13a8afa2
/*
*
File : board.c
*
This file is part of RT-Thread RTOS
*
COPYRIGHT (C) 2009 RT-Thread Develop Team
*
Copyright (c) 2006-2018, RT-Thread Development Team
*
*
SPDX-License-Identifier: Apache-2.0
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
...
...
@@ -47,6 +44,7 @@ void HAL_MspInit(void)
__HAL_AFIO_REMAP_SWJ_NOJTAG
();
}
void
SystemClock_Config
(
void
)
{
rt_err_t
ret
=
RT_EOK
;
...
...
@@ -63,7 +61,19 @@ void SystemClock_Config(void)
RCC_OscInitStruct
.
PLL
.
PLLSource
=
RCC_PLLSOURCE_HSE
;
RCC_OscInitStruct
.
PLL
.
PLLMUL
=
RCC_PLL_MUL9
;
ret
=
HAL_RCC_OscConfig
(
&
RCC_OscInitStruct
);
RT_ASSERT
(
ret
==
HAL_OK
);
if
(
ret
==
HAL_TIMEOUT
)
{
/* HSE timeout switch to HSI */
rt_memset
(
&
RCC_OscInitStruct
,
0
,
sizeof
(
RCC_OscInitStruct
));
RCC_OscInitStruct
.
OscillatorType
=
RCC_OSCILLATORTYPE_HSI
;
RCC_OscInitStruct
.
HSIState
=
RCC_HSI_ON
;
RCC_OscInitStruct
.
HSICalibrationValue
=
16
;
RCC_OscInitStruct
.
PLL
.
PLLState
=
RCC_PLL_ON
;
RCC_OscInitStruct
.
PLL
.
PLLSource
=
RCC_PLLSOURCE_HSI_DIV2
;
RCC_OscInitStruct
.
PLL
.
PLLMUL
=
RCC_PLL_MUL16
;
ret
=
HAL_RCC_OscConfig
(
&
RCC_OscInitStruct
);
RT_ASSERT
(
ret
==
HAL_OK
);
}
/* Initializes the CPU, AHB and APB busses clocks */
RCC_ClkInitStruct
.
ClockType
=
RCC_CLOCKTYPE_HCLK
|
RCC_CLOCKTYPE_SYSCLK
|
...
...
@@ -103,6 +113,39 @@ void SystemClock_Config(void)
#endif
}
static
void
m3_m4_delay_us
(
rt_uint32_t
us
)
{
__IO
uint32_t
Delay
=
us
*
(
SystemCoreClock
/
8U
/
1000000U
);
do
{
__NOP
();
}
while
(
Delay
--
);
}
void
HAL_Delay
(
__IO
uint32_t
Delay
)
{
m3_m4_delay_us
(
Delay
*
10
);
}
extern
__IO
uint32_t
uwTick
;
uint32_t
HAL_GetTick
(
void
)
{
HAL_Delay
(
1
);
uwTick
++
;
return
uwTick
;
}
void
HAL_SuspendTick
(
void
)
{
/* we should not suspend tick */
}
void
HAL_ResumeTick
(
void
)
{
/* we should not resume tick */
}
/**
* This is the timer interrupt service routine.
*
...
...
@@ -111,6 +154,7 @@ void SysTick_Handler(void)
{
/* enter interrupt */
rt_interrupt_enter
();
HAL_IncTick
();
rt_tick_increase
();
/* leave interrupt */
...
...
bsp/stm32f10x-HAL/drivers/board.h
浏览文件 @
13a8afa2
/*
*
File : board.h
*
This file is part of RT-Thread RTOS
*
COPYRIGHT (C) 2009, RT-Thread Development Team
*
Copyright (c) 2006-2018, RT-Thread Development Team
*
*
SPDX-License-Identifier: Apache-2.0
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
...
...
bsp/stm32f10x-HAL/drivers/drv_gpio.c
浏览文件 @
13a8afa2
/*
*
File : drv_gpio.c
*
This file is part of RT-Thread RTOS
*
COPYRIGHT (C) 2015, RT-Thread Development Team
*
Copyright (c) 2006-2018, RT-Thread Development Team
*
*
SPDX-License-Identifier: Apache-2.0
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
...
...
bsp/stm32f10x-HAL/drivers/drv_gpio.h
浏览文件 @
13a8afa2
/*
*
File : drv_gpio.h
*
This file is part of RT-Thread RTOS
*
COPYRIGHT (C) 2015, RT-Thread Development Team
*
Copyright (c) 2006-2018, RT-Thread Development Team
*
*
SPDX-License-Identifier: Apache-2.0
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
...
...
bsp/stm32f10x-HAL/drivers/drv_sdcard.c
浏览文件 @
13a8afa2
/*
* File : drv_sdcard.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* SPDX-License-Identifier: Apache-2.0
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
bsp/stm32f10x-HAL/drivers/drv_sdcard.h
浏览文件 @
13a8afa2
/*
* File : drv_sdcard.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2017, RT-Thread Development Team
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* SPDX-License-Identifier: Apache-2.0
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
...
...
bsp/stm32f10x-HAL/drivers/drv_spi.c
浏览文件 @
13a8afa2
/*
*
File : dev_gpio.c
*
This file is part of RT-Thread RTOS
*
COPYRIGHT (C) 2015, RT-Thread Development Team
*
Copyright (c) 2006-2018, RT-Thread Development Team
*
*
SPDX-License-Identifier: Apache-2.0
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
...
...
bsp/stm32f10x-HAL/drivers/drv_spi.h
浏览文件 @
13a8afa2
/*
*
File : gpio.c
*
This file is part of RT-Thread RTOS
*
COPYRIGHT (C) 2015, RT-Thread Development Team
*
Copyright (c) 2006-2018, RT-Thread Development Team
*
*
SPDX-License-Identifier: Apache-2.0
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
...
...
bsp/stm32f10x-HAL/drivers/drv_usart.c
浏览文件 @
13a8afa2
/*
*
File : drv_usart.c
*
This file is part of RT-Thread RTOS
*
COPYRIGHT (C) 2006-2013, RT-Thread Development Team
*
Copyright (c) 2006-2018, RT-Thread Development Team
*
*
SPDX-License-Identifier: Apache-2.0
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
...
...
bsp/stm32f10x-HAL/drivers/drv_usart.h
浏览文件 @
13a8afa2
/*
*
File : usart.h
*
This file is part of RT-Thread RTOS
*
COPYRIGHT (C) 2009, RT-Thread Development Team
*
Copyright (c) 2006-2018, RT-Thread Development Team
*
*
SPDX-License-Identifier: Apache-2.0
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
...
...
bsp/stm32f10x-HAL/drivers/drv_usb.c
浏览文件 @
13a8afa2
/*
*
File : drv_usb.c
*
This file is part of RT-Thread RTOS
*
COPYRIGHT (C) 2015, RT-Thread Development Team
*
Copyright (c) 2006-2018, RT-Thread Development Team
*
*
SPDX-License-Identifier: Apache-2.0
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
...
...
bsp/stm32f10x-HAL/drivers/drv_usb.h
浏览文件 @
13a8afa2
/*
*
File : drv_usb.h
*
This file is part of RT-Thread RTOS
*
COPYRIGHT (C) 2015, RT-Thread Development Team
*
Copyright (c) 2006-2018, RT-Thread Development Team
*
*
SPDX-License-Identifier: Apache-2.0
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
...
...
bsp/stm32f10x-HAL/project.uvprojx
浏览文件 @
13a8afa2
此差异已折叠。
点击以展开。
bsp/stm32f10x-HAL/template.uvprojx
浏览文件 @
13a8afa2
...
...
@@ -14,16 +14,16 @@
<uAC6>
0
</uAC6>
<TargetOption>
<TargetCommonOption>
<Device>
STM32F103R
B
</Device>
<Device>
STM32F103R
C
</Device>
<Vendor>
STMicroelectronics
</Vendor>
<PackID>
Keil.STM32F1xx_DFP.2.2.0
</PackID>
<PackURL>
http://www.keil.com/pack/
</PackURL>
<Cpu>
IRAM(0x20000000,0x
5000) IROM(0x08000000,0x2
0000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE
</Cpu>
<Cpu>
IRAM(0x20000000,0x
C000) IROM(0x08000000,0x4
0000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE
</Cpu>
<FlashUtilSpec></FlashUtilSpec>
<StartupFile></StartupFile>
<FlashDriverDll>
UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_
128 -FS08000000 -FL020000 -FP0($$Device:STM32F103RB$Flash\STM32F10x_128
.FLM))
</FlashDriverDll>
<FlashDriverDll>
UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_
512 -FS08000000 -FL080000 -FP0($$Device:STM32F103RC$Flash\STM32F10x_512
.FLM))
</FlashDriverDll>
<DeviceId>
0
</DeviceId>
<RegisterFile>
$$Device:STM32F103R
B
$Device\Include\stm32f10x.h
</RegisterFile>
<RegisterFile>
$$Device:STM32F103R
C
$Device\Include\stm32f10x.h
</RegisterFile>
<MemoryEnv></MemoryEnv>
<Cmp></Cmp>
<Asm></Asm>
...
...
@@ -33,7 +33,7 @@
<SLE66CMisc></SLE66CMisc>
<SLE66AMisc></SLE66AMisc>
<SLE66LinkerMisc></SLE66LinkerMisc>
<SFDFile>
$$Device:STM32F103R
B
$SVD\STM32F103xx.svd
</SFDFile>
<SFDFile>
$$Device:STM32F103R
C
$SVD\STM32F103xx.svd
</SFDFile>
<bCustSvd>
0
</bCustSvd>
<UseEnv>
0
</UseEnv>
<BinPath></BinPath>
...
...
@@ -111,8 +111,8 @@
<DllOption>
<SimDllName>
SARMCM3.DLL
</SimDllName>
<SimDllArguments>
-REMAP
</SimDllArguments>
<SimDlgDll>
D
C
M.DLL
</SimDlgDll>
<SimDlgDllArguments>
-p
CM3
</SimDlgDllArguments>
<SimDlgDll>
D
ARMST
M.DLL
</SimDlgDll>
<SimDlgDllArguments>
-p
STM32F103RC
</SimDlgDllArguments>
<TargetDllName>
SARMCM3.DLL
</TargetDllName>
<TargetDllArguments></TargetDllArguments>
<TargetDlgDll>
TCM.DLL
</TargetDlgDll>
...
...
@@ -138,7 +138,7 @@
</Flash1>
<bUseTDR>
1
</bUseTDR>
<Flash2>
BIN\UL2CM3.DLL
</Flash2>
<Flash3>
"" ()
</Flash3>
<Flash3></Flash3>
<Flash4></Flash4>
<pFcarmOut></pFcarmOut>
<pFcarmGrp></pFcarmGrp>
...
...
@@ -244,12 +244,12 @@
<IRAM>
<Type>
0
</Type>
<StartAddress>
0x20000000
</StartAddress>
<Size>
0x
5
000
</Size>
<Size>
0x
c
000
</Size>
</IRAM>
<IROM>
<Type>
1
</Type>
<StartAddress>
0x8000000
</StartAddress>
<Size>
0x
2
0000
</Size>
<Size>
0x
4
0000
</Size>
</IROM>
<XRAM>
<Type>
0
</Type>
...
...
@@ -274,7 +274,7 @@
<OCR_RVCT4>
<Type>
1
</Type>
<StartAddress>
0x8000000
</StartAddress>
<Size>
0x
2
0000
</Size>
<Size>
0x
4
0000
</Size>
</OCR_RVCT4>
<OCR_RVCT5>
<Type>
1
</Type>
...
...
@@ -299,7 +299,7 @@
<OCR_RVCT9>
<Type>
0
</Type>
<StartAddress>
0x20000000
</StartAddress>
<Size>
0x
5
000
</Size>
<Size>
0x
c
000
</Size>
</OCR_RVCT9>
<OCR_RVCT10>
<Type>
0
</Type>
...
...
@@ -324,6 +324,7 @@
<uThumb>
0
</uThumb>
<uSurpInc>
0
</uSurpInc>
<uC99>
1
</uC99>
<uGnu>
0
</uGnu>
<useXO>
0
</useXO>
<v6Lang>
1
</v6Lang>
<v6LangP>
1
</v6LangP>
...
...
bsp/stm32f4xx-HAL/Kconfig
浏览文件 @
13a8afa2
...
...
@@ -297,20 +297,24 @@ config RT_HSE_VALUE
config RT_HSE_HCLK
int "System Clock Value"
default 84000000
config
RT
_USING_UART1
config
BSP
_USING_UART1
bool "Using UART1"
select RT_USING_SERIAL
default y
config
RT
_USING_UART2
config
BSP
_USING_UART2
bool "Using UART2"
select RT_USING_SERIAL
default n
config
RT
_USING_UART3
config
BSP
_USING_UART3
bool "Using UART3"
select RT_USING_SERIAL
default n
config
RT
_USING_UART6
config
BSP
_USING_UART6
bool "Using UART6"
select RT_USING_SERIAL
default n
if RT_USING_CAN
...
...
bsp/stm32f4xx-HAL/drivers/drv_i2c.c
浏览文件 @
13a8afa2
...
...
@@ -78,11 +78,12 @@ static rt_int32_t drv_get_scl(void *data)
static
void
drv_udelay
(
rt_uint32_t
us
)
{
int
i
=
(
HAL_RCC_GetHCLKFreq
()
/
4000000
*
us
);
while
(
i
)
__IO
uint32_t
Delay
=
us
*
(
SystemCoreClock
/
8U
/
1000000U
);
do
{
i
--
;
}
__NOP
();
}
while
(
Delay
--
);
}
static
const
struct
rt_i2c_bit_ops
drv_bit_ops
=
...
...
bsp/stm32f4xx-HAL/drivers/drv_usart.c
浏览文件 @
13a8afa2
...
...
@@ -147,7 +147,7 @@ static const struct rt_uart_ops drv_uart_ops =
drv_getc
,
};
#if defined(
RT
_USING_UART1)
#if defined(
BSP
_USING_UART1)
/* UART1 device driver structure */
static
struct
drv_uart
uart1
;
struct
rt_serial_device
serial1
;
...
...
@@ -168,9 +168,9 @@ void USART1_IRQHandler(void)
/* leave interrupt */
rt_interrupt_leave
();
}
#endif
/*
RT
_USING_UART1 */
#endif
/*
BSP
_USING_UART1 */
#if defined(
RT
_USING_UART2)
#if defined(
BSP
_USING_UART2)
/* UART2 device driver structure */
static
struct
drv_uart
uart2
;
struct
rt_serial_device
serial2
;
...
...
@@ -191,9 +191,9 @@ void USART2_IRQHandler(void)
/* leave interrupt */
rt_interrupt_leave
();
}
#endif
/*
RT
_USING_UART2 */
#endif
/*
BSP
_USING_UART2 */
#if defined(
RT
_USING_UART3)
#if defined(
BSP
_USING_UART3)
/* UART3 device driver structure */
static
struct
drv_uart
uart3
;
struct
rt_serial_device
serial3
;
...
...
@@ -214,9 +214,9 @@ void USART3_IRQHandler(void)
/* leave interrupt */
rt_interrupt_leave
();
}
#endif
/*
RT
_USING_UART3 */
#endif
/*
BSP
_USING_UART3 */
#if defined(
RT
_USING_UART6)
#if defined(
BSP
_USING_UART6)
/* UART6 device driver structure */
static
struct
drv_uart
uart6
;
struct
rt_serial_device
serial6
;
...
...
@@ -237,7 +237,7 @@ void USART6_IRQHandler(void)
/* leave interrupt */
rt_interrupt_leave
();
}
#endif
/*
RT
_USING_UART6 */
#endif
/*
BSP
_USING_UART6 */
/**
* @brief UART MSP Initialization
...
...
@@ -365,7 +365,7 @@ int hw_usart_init(void)
{
struct
drv_uart
*
uart
;
struct
serial_configure
config
=
RT_SERIAL_CONFIG_DEFAULT
;
#ifdef
RT
_USING_UART1
#ifdef
BSP
_USING_UART1
uart
=
&
uart1
;
uart
->
UartHandle
.
Instance
=
USART1
;
uart
->
irq
=
USART1_IRQn
;
...
...
@@ -375,8 +375,8 @@ int hw_usart_init(void)
rt_hw_serial_register
(
&
serial1
,
"uart1"
,
RT_DEVICE_FLAG_RDWR
|
RT_DEVICE_FLAG_INT_RX
,
uart
);
#endif
/*
RT
_USING_UART1 */
#ifdef
RT
_USING_UART2
#endif
/*
BSP
_USING_UART1 */
#ifdef
BSP
_USING_UART2
uart
=
&
uart2
;
uart
->
UartHandle
.
Instance
=
USART2
;
uart
->
irq
=
USART2_IRQn
;
...
...
@@ -386,8 +386,8 @@ int hw_usart_init(void)
rt_hw_serial_register
(
&
serial2
,
"uart2"
,
RT_DEVICE_FLAG_RDWR
|
RT_DEVICE_FLAG_INT_RX
,
uart
);
#endif
/*
RT
_USING_UART2 */
#ifdef
RT
_USING_UART3
#endif
/*
BSP
_USING_UART2 */
#ifdef
BSP
_USING_UART3
uart
=
&
uart3
;
uart
->
UartHandle
.
Instance
=
USART3
;
uart
->
irq
=
USART3_IRQn
;
...
...
@@ -397,18 +397,19 @@ int hw_usart_init(void)
rt_hw_serial_register
(
&
serial3
,
"uart3"
,
RT_DEVICE_FLAG_RDWR
|
RT_DEVICE_FLAG_INT_RX
,
uart
);
#endif
/*
RT
_USING_UART3 */
#ifdef
RT
_USING_UART6
#endif
/*
BSP
_USING_UART3 */
#ifdef
BSP
_USING_UART6
uart
=
&
uart6
;
uart
->
UartHandle
.
Instance
=
USART6
;
uart
->
irq
=
USART6_IRQn
;
serial6
.
ops
=
&
drv_uart_ops
;
serial6
.
config
=
config
;
/* register UART
2
device */
/* register UART
6
device */
rt_hw_serial_register
(
&
serial6
,
"uart6"
,
RT_DEVICE_FLAG_RDWR
|
RT_DEVICE_FLAG_INT_RX
,
uart
);
#endif
/* RT_USING_UART6 */
#endif
/* BSP_USING_UART6 */
return
0
;
}
INIT_BOARD_EXPORT
(
hw_usart_init
);
bsp/stm32f4xx-HAL/rtconfig.py
浏览文件 @
13a8afa2
...
...
@@ -3,16 +3,15 @@
import
os
# toolchains options
ARCH
=
'arm'
CPU
=
'cortex-m4'
CROSS_TOOL
=
'gcc'
ARCH
=
'arm'
CPU
=
'cortex-m4'
CROSS_TOOL
=
'gcc'
if
os
.
getenv
(
'RTT_CC'
):
CROSS_TOOL
=
os
.
getenv
(
'RTT_CC'
)
#device options
# cross_tool provides the cross compiler
# EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK, IAR
if
CROSS_TOOL
==
'gcc'
:
...
...
@@ -44,7 +43,7 @@ if PLATFORM == 'gcc':
OBJCPY
=
PREFIX
+
'objcopy'
DEVICE
=
' -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections'
CFLAGS
=
DEVICE
+
' -std=c99
-Dgcc'
# -D' + PART_TYPE
CFLAGS
=
DEVICE
+
' -std=c99
'
AFLAGS
=
' -c'
+
DEVICE
+
' -x assembler-with-cpp -Wa,-mimplicit-it=thumb '
LFLAGS
=
DEVICE
+
' -Wl,--gc-sections,-Map=rtthread-stm32.map,-cref,-u,Reset_Handler -T stm32_rom.ld'
...
...
components/net/sal_socket/include/sal_socket.h
浏览文件 @
13a8afa2
...
...
@@ -85,13 +85,15 @@ typedef uint16_t in_port_t;
#define AF_INET6 10
#define AF_CAN 29
/* Controller Area Network */
#define AF_AT 45
/* AT socket */
#define AF_WIZ 46
/* WIZnet socket */
#define PF_INET AF_INET
#define PF_INET6 AF_INET6
#define PF_UNSPEC AF_UNSPEC
#define PF_CAN AF_CAN
#define PF_AT AF_AT
#define PF_WIZ AF_WIZ
#define AF_MAX (AF_
AT
+ 1)
/* For now.. */
#define AF_MAX (AF_
WIZ
+ 1)
/* For now.. */
#define IPPROTO_IP 0
#define IPPROTO_ICMP 1
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录