Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Mozi
rt-thread
提交
b104bbc4
R
rt-thread
项目概览
Mozi
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
0
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
b104bbc4
编写于
8月 06, 2021
作者:
C
chen zx
提交者:
GitHub
8月 06, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'RT-Thread:master' into master
上级
eb29bb53
054f6db3
变更
80
展开全部
隐藏空白更改
内联
并排
Showing
80 changed file
with
1502 addition
and
819 deletion
+1502
-819
.github/workflows/action.yml
.github/workflows/action.yml
+1
-0
bsp/efm32/drv_rtc.c
bsp/efm32/drv_rtc.c
+12
-44
bsp/imxrt/docs/AN13232 - RT-Thread Board Port and Application Development.pdf
...32 - RT-Thread Board Port and Application Development.pdf
+0
-0
bsp/imxrt/imxrt1064-nxp-evk/.config
bsp/imxrt/imxrt1064-nxp-evk/.config
+251
-16
bsp/imxrt/imxrt1064-nxp-evk/board/board.c
bsp/imxrt/imxrt1064-nxp-evk/board/board.c
+1
-1
bsp/imxrt/imxrt1064-nxp-evk/rtconfig.h
bsp/imxrt/imxrt1064-nxp-evk/rtconfig.h
+24
-7
bsp/imxrt/libraries/MIMXRT1064/SConscript
bsp/imxrt/libraries/MIMXRT1064/SConscript
+3
-0
bsp/imxrt/libraries/drivers/drv_lcd.c
bsp/imxrt/libraries/drivers/drv_lcd.c
+1
-1
bsp/raspberry-pi/raspi4-32/.config
bsp/raspberry-pi/raspi4-32/.config
+96
-55
bsp/raspberry-pi/raspi4-32/Kconfig
bsp/raspberry-pi/raspi4-32/Kconfig
+1
-0
bsp/raspberry-pi/raspi4-32/driver/drv_eth.c
bsp/raspberry-pi/raspi4-32/driver/drv_eth.c
+141
-150
bsp/raspberry-pi/raspi4-32/link.lds
bsp/raspberry-pi/raspi4-32/link.lds
+1
-1
bsp/raspberry-pi/raspi4-32/rtconfig.h
bsp/raspberry-pi/raspi4-32/rtconfig.h
+19
-10
bsp/raspberry-pi/raspi4-32/rtconfig.py
bsp/raspberry-pi/raspi4-32/rtconfig.py
+1
-1
bsp/stm32/libraries/HAL_Drivers/drv_eth.c
bsp/stm32/libraries/HAL_Drivers/drv_eth.c
+16
-8
bsp/stm32/libraries/HAL_Drivers/drv_eth.h
bsp/stm32/libraries/HAL_Drivers/drv_eth.h
+4
-8
bsp/stm32/libraries/HAL_Drivers/drv_rtc.c
bsp/stm32/libraries/HAL_Drivers/drv_rtc.c
+3
-3
bsp/stm32/stm32f407-atk-explorer/.config
bsp/stm32/stm32f407-atk-explorer/.config
+220
-20
bsp/stm32/stm32f407-atk-explorer/board/Kconfig
bsp/stm32/stm32f407-atk-explorer/board/Kconfig
+20
-11
bsp/stm32/stm32f407-atk-explorer/board/SConscript
bsp/stm32/stm32f407-atk-explorer/board/SConscript
+2
-2
bsp/stm32/stm32f407-atk-explorer/board/ports/drv_filesystem.c
...stm32/stm32f407-atk-explorer/board/ports/drv_filesystem.c
+105
-0
bsp/stm32/stm32f407-atk-explorer/rtconfig.h
bsp/stm32/stm32f407-atk-explorer/rtconfig.h
+19
-10
components/dfs/include/dfs_select.h
components/dfs/include/dfs_select.h
+1
-1
components/drivers/include/drivers/mmcsd_core.h
components/drivers/include/drivers/mmcsd_core.h
+0
-1
components/drivers/include/drivers/rtc.h
components/drivers/include/drivers/rtc.h
+32
-2
components/drivers/include/drivers/rtc_core.h
components/drivers/include/drivers/rtc_core.h
+0
-45
components/drivers/include/ipc/workqueue.h
components/drivers/include/ipc/workqueue.h
+2
-3
components/drivers/rtc/SConscript
components/drivers/rtc/SConscript
+1
-1
components/drivers/rtc/rtc.c
components/drivers/rtc/rtc.c
+114
-18
components/drivers/rtc/rtc_core.c
components/drivers/rtc/rtc_core.c
+0
-123
components/drivers/sdio/block_dev.c
components/drivers/sdio/block_dev.c
+0
-12
components/drivers/src/ringbuffer.c
components/drivers/src/ringbuffer.c
+3
-1
components/drivers/src/workqueue.c
components/drivers/src/workqueue.c
+3
-3
components/libc/Kconfig
components/libc/Kconfig
+2
-2
components/libc/aio/posix_aio.c
components/libc/aio/posix_aio.c
+0
-6
components/libc/aio/posix_aio.h
components/libc/aio/posix_aio.h
+4
-0
components/libc/compilers/common/none-gcc/sys/errno.h
components/libc/compilers/common/none-gcc/sys/errno.h
+2
-2
components/libc/compilers/common/none-gcc/sys/stat.h
components/libc/compilers/common/none-gcc/sys/stat.h
+5
-0
components/libc/compilers/common/none-gcc/sys/types.h
components/libc/compilers/common/none-gcc/sys/types.h
+2
-2
components/libc/compilers/common/none-gcc/sys/unistd.h
components/libc/compilers/common/none-gcc/sys/unistd.h
+2
-2
components/libc/compilers/common/sys/select.h
components/libc/compilers/common/sys/select.h
+49
-0
components/libc/compilers/common/sys/signal.h
components/libc/compilers/common/sys/signal.h
+70
-60
components/libc/compilers/common/sys/time.h
components/libc/compilers/common/sys/time.h
+22
-15
components/libc/compilers/common/time.c
components/libc/compilers/common/time.c
+85
-41
components/libc/pthreads/mqueue.c
components/libc/pthreads/mqueue.c
+2
-1
components/libc/pthreads/pthread_cond.c
components/libc/pthreads/pthread_cond.c
+1
-1
components/libc/pthreads/semaphore.c
components/libc/pthreads/semaphore.c
+1
-1
components/libc/signal/posix_signal.c
components/libc/signal/posix_signal.c
+3
-4
components/libc/signal/posix_signal.h
components/libc/signal/posix_signal.h
+0
-1
components/net/at/at_socket/at_socket.c
components/net/at/at_socket/at_socket.c
+12
-5
components/net/at/src/at_client.c
components/net/at/src/at_client.c
+5
-15
components/net/lwip-1.4.1/src/lwipopts.h
components/net/lwip-1.4.1/src/lwipopts.h
+7
-0
components/net/lwip-1.4.1/src/netif/ethernetif.c
components/net/lwip-1.4.1/src/netif/ethernetif.c
+4
-4
components/net/lwip-2.0.2/src/lwipopts.h
components/net/lwip-2.0.2/src/lwipopts.h
+9
-2
components/net/lwip-2.0.2/src/netif/ethernetif.c
components/net/lwip-2.0.2/src/netif/ethernetif.c
+4
-4
components/net/lwip-2.0.3/src/lwipopts.h
components/net/lwip-2.0.3/src/lwipopts.h
+9
-2
components/net/lwip-2.0.3/src/netif/ethernetif.c
components/net/lwip-2.0.3/src/netif/ethernetif.c
+4
-4
components/net/lwip-2.1.2/src/lwipopts.h
components/net/lwip-2.1.2/src/lwipopts.h
+9
-2
components/net/lwip-2.1.2/src/netif/ethernetif.c
components/net/lwip-2.1.2/src/netif/ethernetif.c
+4
-4
components/net/sal_socket/include/socket/netdb.h
components/net/sal_socket/include/socket/netdb.h
+1
-1
examples/kernel/event_simple.c
examples/kernel/event_simple.c
+1
-1
examples/kernel/mbox_send_wait.c
examples/kernel/mbox_send_wait.c
+1
-1
examples/kernel/mbox_simple.c
examples/kernel/mbox_simple.c
+1
-1
examples/kernel/messageq_simple.c
examples/kernel/messageq_simple.c
+1
-1
examples/kernel/mutex_priority.c
examples/kernel/mutex_priority.c
+1
-1
examples/kernel/mutex_simple.c
examples/kernel/mutex_simple.c
+1
-1
examples/kernel/semaphore_buffer_worker.c
examples/kernel/semaphore_buffer_worker.c
+1
-1
examples/kernel/semaphore_dynamic.c
examples/kernel/semaphore_dynamic.c
+1
-1
examples/kernel/semaphore_producer_consumer.c
examples/kernel/semaphore_producer_consumer.c
+3
-3
examples/kernel/semaphore_static.c
examples/kernel/semaphore_static.c
+1
-1
examples/kernel/tc_comm.c
examples/kernel/tc_comm.c
+1
-1
examples/kernel/timer_timeout.c
examples/kernel/timer_timeout.c
+1
-1
examples/pm/wakeup_app.c
examples/pm/wakeup_app.c
+1
-1
include/rtdef.h
include/rtdef.h
+1
-1
include/rtlibc.h
include/rtlibc.h
+0
-3
src/Kconfig
src/Kconfig
+8
-0
src/idle.c
src/idle.c
+2
-2
src/ipc.c
src/ipc.c
+51
-51
src/kservice.c
src/kservice.c
+3
-1
src/scheduler.c
src/scheduler.c
+7
-7
未找到文件。
.github/workflows/action.yml
浏览文件 @
b104bbc4
...
...
@@ -131,6 +131,7 @@ jobs:
-
{
RTT_BSP
:
"
at32/at32f407-start"
,
RTT_TOOL_CHAIN
:
"
sourcery-arm"
}
-
{
RTT_BSP
:
"
smartfusion2"
,
RTT_TOOL_CHAIN
:
"
sourcery-arm"
}
-
{
RTT_BSP
:
"
raspberry-pico"
,
RTT_TOOL_CHAIN
:
"
sourcery-arm"
}
-
{
RTT_BSP
:
"
raspberry-pi/raspi4-32"
,
RTT_TOOL_CHAIN
:
"
sourcery-arm"
}
steps
:
-
uses
:
actions/checkout@v2
-
name
:
Set up Python
...
...
bsp/efm32/drv_rtc.c
浏览文件 @
b104bbc4
...
...
@@ -128,49 +128,6 @@ void rt_hw_rtc_isr(rt_device_t device)
RTC
->
IFC
=
_RTC_IFC_MASK
;
}
/***************************************************************************//**
* @brief
* Register RTC device
*
* @details
*
* @note
*
* @param[in] device
* Pointer to device descriptor
*
* @param[in] name
* Device name
*
* @param[in] flag
* Configuration flags
*
* @return
* Error code
******************************************************************************/
rt_err_t
rt_hw_rtc_register
(
rt_device_t
device
,
const
char
*
name
,
rt_uint32_t
flag
)
{
RT_ASSERT
(
device
!=
RT_NULL
);
device
->
type
=
RT_Device_Class_RTC
;
device
->
rx_indicate
=
RT_NULL
;
device
->
tx_complete
=
RT_NULL
;
device
->
init
=
RT_NULL
;
device
->
open
=
rt_rtc_open
;
device
->
close
=
RT_NULL
;
device
->
read
=
rt_rtc_read
;
device
->
write
=
RT_NULL
;
device
->
control
=
rt_rtc_control
;
device
->
user_data
=
RT_NULL
;
/* no private */
/* register a character device */
return
rt_device_register
(
device
,
name
,
RT_DEVICE_FLAG_RDWR
|
flag
);
}
/***************************************************************************//**
* @brief
* Initialize all RTC module related hardware and register RTC device to kernel
...
...
@@ -224,7 +181,18 @@ void rt_hw_rtc_init(void)
}
/* register rtc device */
rt_hw_rtc_register
(
&
rtc
,
RT_RTC_NAME
,
EFM32_NO_DATA
);
rtc
.
type
=
RT_Device_Class_RTC
;
rtc
.
rx_indicate
=
RT_NULL
;
rtc
.
tx_complete
=
RT_NULL
;
rtc
.
init
=
RT_NULL
;
rtc
.
open
=
rt_rtc_open
;
rtc
.
close
=
RT_NULL
;
rtc
.
read
=
rt_rtc_read
;
rtc
.
write
=
RT_NULL
;
rtc
.
control
=
rt_rtc_control
;
rtc
.
user_data
=
RT_NULL
;
/* no private */
rt_device_register
(
&
rtc
,
RT_RTC_NAME
,
RT_DEVICE_FLAG_RDWR
|
EFM32_NO_DATA
);
}
#endif
...
...
bsp/imxrt/docs/AN13232 - RT-Thread Board Port and Application Development.pdf
0 → 100644
浏览文件 @
b104bbc4
文件已添加
bsp/imxrt/imxrt1064-nxp-evk/.config
浏览文件 @
b104bbc4
...
...
@@ -7,6 +7,7 @@
# RT-Thread Kernel
#
CONFIG_RT_NAME_MAX
=
8
# CONFIG_RT_USING_ARCH_DATA_TYPE is not set
# CONFIG_RT_USING_SMP is not set
CONFIG_RT_ALIGN_SIZE
=
4
# CONFIG_RT_THREAD_PRIORITY_8 is not set
...
...
@@ -20,6 +21,12 @@ CONFIG_RT_USING_IDLE_HOOK=y
CONFIG_RT_IDLE_HOOK_LIST_SIZE
=
4
CONFIG_IDLE_THREAD_STACK_SIZE
=
256
# CONFIG_RT_USING_TIMER_SOFT is not set
#
# kservice optimization
#
# CONFIG_RT_KSERVICE_USING_STDLIB is not set
# CONFIG_RT_KSERVICE_USING_TINY_SIZE is not set
CONFIG_RT_DEBUG
=
y
CONFIG_RT_DEBUG_COLOR
=
y
# CONFIG_RT_DEBUG_INIT_CONFIG is not set
...
...
@@ -52,6 +59,8 @@ CONFIG_RT_USING_MEMHEAP=y
# CONFIG_RT_USING_SMALL_MEM is not set
# CONFIG_RT_USING_SLAB is not set
CONFIG_RT_USING_MEMHEAP_AS_HEAP
=
y
# CONFIG_RT_USING_USERHEAP is not set
# CONFIG_RT_USING_MEMTRACE is not set
CONFIG_RT_USING_HEAP
=
y
#
...
...
@@ -63,7 +72,8 @@ CONFIG_RT_USING_DEVICE=y
CONFIG_RT_USING_CONSOLE
=
y
CONFIG_RT_CONSOLEBUF_SIZE
=
128
CONFIG_RT_CONSOLE_DEVICE_NAME
=
"uart1"
CONFIG_RT_VER_NUM
=
0
x40001
CONFIG_RT_VER_NUM
=
0
x40004
# CONFIG_RT_USING_CPU_FFS is not set
# CONFIG_ARCH_CPU_STACK_GROWS_UPWARD is not set
#
...
...
@@ -108,19 +118,23 @@ CONFIG_FINSH_ARG_MAX=10
#
CONFIG_RT_USING_DEVICE_IPC
=
y
CONFIG_RT_PIPE_BUFSZ
=
512
# CONFIG_RT_USING_SYSTEM_WORKQUEUE is not set
CONFIG_RT_USING_SERIAL
=
y
CONFIG_RT_USING_SERIAL_V1
=
y
# CONFIG_RT_USING_SERIAL_V2 is not set
# CONFIG_RT_SERIAL_USING_DMA is not set
CONFIG_RT_SERIAL_RB_BUFSZ
=
64
# CONFIG_RT_USING_CAN is not set
# CONFIG_RT_USING_HWTIMER is not set
CONFIG_RT_USING_CPUTIME
=
y
# CONFIG_RT_USING_I2C is not set
# CONFIG_RT_USING_PHY is not set
CONFIG_RT_USING_PIN
=
y
# CONFIG_RT_USING_ADC is not set
# CONFIG_RT_USING_DAC is not set
# CONFIG_RT_USING_PWM is not set
# CONFIG_RT_USING_MTD_NOR is not set
# CONFIG_RT_USING_MTD_NAND is not set
# CONFIG_RT_USING_MTD is not set
# CONFIG_RT_USING_PM is not set
# CONFIG_RT_USING_RTC is not set
# CONFIG_RT_USING_SDIO is not set
...
...
@@ -128,10 +142,10 @@ CONFIG_RT_USING_PIN=y
# CONFIG_RT_USING_WDT is not set
# CONFIG_RT_USING_AUDIO is not set
# CONFIG_RT_USING_SENSOR is not set
#
#
Using WiFi
#
# CONFIG_RT_USING_TOUCH is not set
#
CONFIG_RT_USING_HWCRYPTO is not set
#
CONFIG_RT_USING_PULSE_ENCODER is not set
#
CONFIG_RT_USING_INPUT_CAPTURE is not set
# CONFIG_RT_USING_WIFI is not set
#
...
...
@@ -145,6 +159,8 @@ CONFIG_RT_USING_PIN=y
#
CONFIG_RT_USING_LIBC
=
y
# CONFIG_RT_USING_PTHREADS is not set
# CONFIG_RT_USING_MODULE is not set
CONFIG_RT_LIBC_FIXED_TIMEZONE
=
8
#
# Network
...
...
@@ -156,14 +172,14 @@ CONFIG_RT_USING_LIBC=y
# CONFIG_RT_USING_SAL is not set
#
#
light weight TCP/IP stack
#
Network interface device
#
# CONFIG_RT_USING_
LWIP
is not set
# CONFIG_RT_USING_
NETDEV
is not set
#
#
Modbus master and slave
stack
#
light weight TCP/IP
stack
#
# CONFIG_RT_USING_
MODBUS
is not set
# CONFIG_RT_USING_
LWIP
is not set
#
# AT commands
...
...
@@ -178,10 +194,15 @@ CONFIG_RT_USING_LIBC=y
#
# Utilities
#
# CONFIG_RT_USING_LOGTRACE is not set
# CONFIG_RT_USING_RYM is not set
# CONFIG_RT_USING_ULOG is not set
# CONFIG_RT_USING_UTEST is not set
# CONFIG_RT_USING_RT_LINK is not set
#
# RT-Thread Utestcases
#
# CONFIG_RT_USING_UTESTCASES is not set
#
# RT-Thread online packages
...
...
@@ -190,14 +211,20 @@ CONFIG_RT_USING_LIBC=y
#
# IoT - internet of things
#
# CONFIG_PKG_USING_LORAWAN_DRIVER is not set
# CONFIG_PKG_USING_PAHOMQTT is not set
# CONFIG_PKG_USING_UMQTT is not set
# CONFIG_PKG_USING_WEBCLIENT is not set
# CONFIG_PKG_USING_WEBNET is not set
# CONFIG_PKG_USING_MONGOOSE is not set
# CONFIG_PKG_USING_MYMQTT is not set
# CONFIG_PKG_USING_KAWAII_MQTT is not set
# CONFIG_PKG_USING_BC28_MQTT is not set
# CONFIG_PKG_USING_WEBTERMINAL is not set
# CONFIG_PKG_USING_CJSON is not set
# CONFIG_PKG_USING_JSMN is not set
# CONFIG_PKG_USING_LIBMODBUS is not set
# CONFIG_PKG_USING_FREEMODBUS is not set
# CONFIG_PKG_USING_LJSON is not set
# CONFIG_PKG_USING_EZXML is not set
# CONFIG_PKG_USING_NANOPB is not set
...
...
@@ -219,6 +246,8 @@ CONFIG_RT_USING_LIBC=y
# CONFIG_PKG_USING_COAP is not set
# CONFIG_PKG_USING_NOPOLL is not set
# CONFIG_PKG_USING_NETUTILS is not set
# CONFIG_PKG_USING_CMUX is not set
# CONFIG_PKG_USING_PPP_DEVICE is not set
# CONFIG_PKG_USING_AT_DEVICE is not set
# CONFIG_PKG_USING_ATSRV_SOCKET is not set
# CONFIG_PKG_USING_WIZNET is not set
...
...
@@ -230,12 +259,38 @@ CONFIG_RT_USING_LIBC=y
# CONFIG_PKG_USING_GAGENT_CLOUD is not set
# CONFIG_PKG_USING_ALI_IOTKIT is not set
# CONFIG_PKG_USING_AZURE is not set
# CONFIG_PKG_USING_TENCENT_IOTKIT is not set
# CONFIG_PKG_USING_TENCENT_IOT_EXPLORER is not set
# CONFIG_PKG_USING_JIOT-C-SDK is not set
# CONFIG_PKG_USING_UCLOUD_IOT_SDK is not set
# CONFIG_PKG_USING_JOYLINK is not set
# CONFIG_PKG_USING_NIMBLE is not set
# CONFIG_PKG_USING_OTA_DOWNLOADER is not set
# CONFIG_PKG_USING_IPMSG is not set
# CONFIG_PKG_USING_LSSDP is not set
# CONFIG_PKG_USING_AIRKISS_OPEN is not set
# CONFIG_PKG_USING_LIBRWS is not set
# CONFIG_PKG_USING_TCPSERVER is not set
# CONFIG_PKG_USING_PROTOBUF_C is not set
# CONFIG_PKG_USING_DLT645 is not set
# CONFIG_PKG_USING_QXWZ is not set
# CONFIG_PKG_USING_SMTP_CLIENT is not set
# CONFIG_PKG_USING_ABUP_FOTA is not set
# CONFIG_PKG_USING_LIBCURL2RTT is not set
# CONFIG_PKG_USING_CAPNP is not set
# CONFIG_PKG_USING_RT_CJSON_TOOLS is not set
# CONFIG_PKG_USING_AGILE_TELNET is not set
# CONFIG_PKG_USING_NMEALIB is not set
# CONFIG_PKG_USING_AGILE_JSMN is not set
# CONFIG_PKG_USING_PDULIB is not set
# CONFIG_PKG_USING_BTSTACK is not set
# CONFIG_PKG_USING_LORAWAN_ED_STACK is not set
# CONFIG_PKG_USING_WAYZ_IOTKIT is not set
# CONFIG_PKG_USING_MAVLINK is not set
# CONFIG_PKG_USING_RAPIDJSON is not set
# CONFIG_PKG_USING_BSAL is not set
# CONFIG_PKG_USING_AGILE_MODBUS is not set
# CONFIG_PKG_USING_AGILE_FTP is not set
# CONFIG_PKG_USING_EMBEDDEDPROTO is not set
#
# security packages
...
...
@@ -243,6 +298,8 @@ CONFIG_RT_USING_LIBC=y
# CONFIG_PKG_USING_MBEDTLS is not set
# CONFIG_PKG_USING_libsodium is not set
# CONFIG_PKG_USING_TINYCRYPT is not set
# CONFIG_PKG_USING_TFM is not set
# CONFIG_PKG_USING_YD_CRYPTO is not set
#
# language packages
...
...
@@ -257,6 +314,15 @@ CONFIG_RT_USING_LIBC=y
# CONFIG_PKG_USING_OPENMV is not set
# CONFIG_PKG_USING_MUPDF is not set
# CONFIG_PKG_USING_STEMWIN is not set
# CONFIG_PKG_USING_WAVPLAYER is not set
# CONFIG_PKG_USING_TJPGD is not set
# CONFIG_PKG_USING_PDFGEN is not set
# CONFIG_PKG_USING_HELIX is not set
# CONFIG_PKG_USING_AZUREGUIX is not set
# CONFIG_PKG_USING_TOUCHGFX2RTT is not set
# CONFIG_PKG_USING_NUEMWIN is not set
# CONFIG_PKG_USING_MP3PLAYER is not set
# CONFIG_PKG_USING_TINYJPEG is not set
#
# tools packages
...
...
@@ -265,27 +331,103 @@ CONFIG_RT_USING_LIBC=y
# CONFIG_PKG_USING_EASYFLASH is not set
# CONFIG_PKG_USING_EASYLOGGER is not set
# CONFIG_PKG_USING_SYSTEMVIEW is not set
# CONFIG_PKG_USING_SEGGER_RTT is not set
# CONFIG_PKG_USING_RDB is not set
# CONFIG_PKG_USING_QRCODE is not set
# CONFIG_PKG_USING_ULOG_EASYFLASH is not set
# CONFIG_PKG_USING_ULOG_FILE is not set
# CONFIG_PKG_USING_LOGMGR is not set
# CONFIG_PKG_USING_ADBD is not set
# CONFIG_PKG_USING_COREMARK is not set
# CONFIG_PKG_USING_DHRYSTONE is not set
# CONFIG_PKG_USING_MEMORYPERF is not set
# CONFIG_PKG_USING_NR_MICRO_SHELL is not set
# CONFIG_PKG_USING_CHINESE_FONT_LIBRARY is not set
# CONFIG_PKG_USING_LUNAR_CALENDAR is not set
# CONFIG_PKG_USING_BS8116A is not set
# CONFIG_PKG_USING_GPS_RMC is not set
# CONFIG_PKG_USING_URLENCODE is not set
# CONFIG_PKG_USING_UMCN is not set
# CONFIG_PKG_USING_LWRB2RTT is not set
# CONFIG_PKG_USING_CPU_USAGE is not set
# CONFIG_PKG_USING_GBK2UTF8 is not set
# CONFIG_PKG_USING_VCONSOLE is not set
# CONFIG_PKG_USING_KDB is not set
# CONFIG_PKG_USING_WAMR is not set
# CONFIG_PKG_USING_MICRO_XRCE_DDS_CLIENT is not set
# CONFIG_PKG_USING_LWLOG is not set
# CONFIG_PKG_USING_ANV_TRACE is not set
# CONFIG_PKG_USING_ANV_MEMLEAK is not set
# CONFIG_PKG_USING_ANV_TESTSUIT is not set
# CONFIG_PKG_USING_ANV_BENCH is not set
# CONFIG_PKG_USING_DEVMEM is not set
# CONFIG_PKG_USING_REGEX is not set
# CONFIG_PKG_USING_MEM_SANDBOX is not set
# CONFIG_PKG_USING_SOLAR_TERMS is not set
# CONFIG_PKG_USING_GAN_ZHI is not set
#
# system packages
#
#
# acceleration: Assembly language or algorithmic acceleration packages
#
# CONFIG_PKG_USING_RT_MEMCPY_CM is not set
# CONFIG_PKG_USING_QFPLIB_M0_FULL is not set
# CONFIG_PKG_USING_QFPLIB_M0_TINY is not set
# CONFIG_PKG_USING_QFPLIB_M3 is not set
#
# Micrium: Micrium software products porting for RT-Thread
#
# CONFIG_PKG_USING_UCOSIII_WRAPPER is not set
# CONFIG_PKG_USING_UCOSII_WRAPPER is not set
# CONFIG_PKG_USING_UC_CRC is not set
# CONFIG_PKG_USING_UC_CLK is not set
# CONFIG_PKG_USING_UC_COMMON is not set
# CONFIG_PKG_USING_UC_MODBUS is not set
# CONFIG_PKG_USING_GUIENGINE is not set
# CONFIG_PKG_USING_CAIRO is not set
# CONFIG_PKG_USING_PIXMAN is not set
# CONFIG_PKG_USING_LWEXT4 is not set
# CONFIG_PKG_USING_PARTITION is not set
# CONFIG_PKG_USING_FAL is not set
# CONFIG_PKG_USING_FLASHDB is not set
# CONFIG_PKG_USING_SQLITE is not set
# CONFIG_PKG_USING_RTI is not set
# CONFIG_PKG_USING_LITTLEVGL2RTT is not set
# CONFIG_PKG_USING_LITTLEVGL2RTT_V001 is not set
# CONFIG_PKG_USING_LITTLEVGL2RTT_LATEST_VERSION is not set
# CONFIG_LV_MEM_STATIC is not set
# CONFIG_LV_MEM_DYNAMIC is not set
# CONFIG_LV_COLOR_DEPTH_1 is not set
# CONFIG_LV_COLOR_DEPTH_8 is not set
# CONFIG_LV_COLOR_DEPTH_16 is not set
# CONFIG_LV_COLOR_DEPTH_24 is not set
# CONFIG_LV_COLOR_DEPTH_32 is not set
# CONFIG_LV_GC_DISABLE is not set
# CONFIG_LV_GC_ENABLE is not set
# CONFIG_PKG_USING_CMSIS is not set
# CONFIG_PKG_USING_DFS_YAFFS is not set
# CONFIG_PKG_USING_LITTLEFS is not set
# CONFIG_PKG_USING_DFS_JFFS2 is not set
# CONFIG_PKG_USING_DFS_UFFS is not set
# CONFIG_PKG_USING_LWEXT4 is not set
# CONFIG_PKG_USING_THREAD_POOL is not set
# CONFIG_PKG_USING_ROBOTS is not set
# CONFIG_PKG_USING_EV is not set
# CONFIG_PKG_USING_SYSWATCH is not set
# CONFIG_PKG_USING_SYS_LOAD_MONITOR is not set
# CONFIG_PKG_USING_PLCCORE is not set
# CONFIG_PKG_USING_RAMDISK is not set
# CONFIG_PKG_USING_MININI is not set
# CONFIG_PKG_USING_QBOOT is not set
# CONFIG_PKG_USING_PPOOL is not set
# CONFIG_PKG_USING_OPENAMP is not set
# CONFIG_PKG_USING_RT_KPRINTF_THREADSAFE is not set
# CONFIG_PKG_USING_LPM is not set
# CONFIG_PKG_USING_TLSF is not set
# CONFIG_PKG_USING_EVENT_RECORDER is not set
#
# peripheral libraries and drivers
...
...
@@ -293,7 +435,8 @@ CONFIG_RT_USING_LIBC=y
# CONFIG_PKG_USING_SENSORS_DRIVERS is not set
# CONFIG_PKG_USING_REALTEK_AMEBA is not set
# CONFIG_PKG_USING_SHT2X is not set
# CONFIG_PKG_USING_AP3216C is not set
# CONFIG_PKG_USING_SHT3X is not set
# CONFIG_PKG_USING_AS7341 is not set
# CONFIG_PKG_USING_STM32_SDIO is not set
# CONFIG_PKG_USING_ICM20608 is not set
# CONFIG_PKG_USING_U8G2 is not set
...
...
@@ -302,14 +445,72 @@ CONFIG_RT_USING_LIBC=y
# CONFIG_PKG_USING_SX12XX is not set
# CONFIG_PKG_USING_SIGNAL_LED is not set
# CONFIG_PKG_USING_LEDBLINK is not set
# CONFIG_PKG_USING_LITTLED is not set
# CONFIG_PKG_USING_LKDGUI is not set
# CONFIG_PKG_USING_NRF5X_SDK is not set
# CONFIG_PKG_USING_NRFX is not set
# CONFIG_PKG_USING_WM_LIBRARIES is not set
# CONFIG_PKG_USING_KENDRYTE_SDK is not set
# CONFIG_PKG_USING_INFRARED is not set
# CONFIG_PKG_USING_ROSSERIAL is not set
# CONFIG_PKG_USING_AGILE_BUTTON is not set
# CONFIG_PKG_USING_AGILE_LED is not set
# CONFIG_PKG_USING_AT24CXX is not set
# CONFIG_PKG_USING_MOTIONDRIVER2RTT is not set
# CONFIG_PKG_USING_AD7746 is not set
# CONFIG_PKG_USING_PCA9685 is not set
# CONFIG_PKG_USING_I2C_TOOLS is not set
# CONFIG_PKG_USING_NRF24L01 is not set
# CONFIG_PKG_USING_TOUCH_DRIVERS is not set
# CONFIG_PKG_USING_MAX17048 is not set
# CONFIG_PKG_USING_RPLIDAR is not set
# CONFIG_PKG_USING_AS608 is not set
# CONFIG_PKG_USING_RC522 is not set
# CONFIG_PKG_USING_WS2812B is not set
# CONFIG_PKG_USING_EMBARC_BSP is not set
# CONFIG_PKG_USING_EXTERN_RTC_DRIVERS is not set
# CONFIG_PKG_USING_MULTI_RTIMER is not set
# CONFIG_PKG_USING_MAX7219 is not set
# CONFIG_PKG_USING_BEEP is not set
# CONFIG_PKG_USING_EASYBLINK is not set
# CONFIG_PKG_USING_PMS_SERIES is not set
# CONFIG_PKG_USING_CAN_YMODEM is not set
# CONFIG_PKG_USING_LORA_RADIO_DRIVER is not set
# CONFIG_PKG_USING_QLED is not set
# CONFIG_PKG_USING_PAJ7620 is not set
# CONFIG_PKG_USING_AGILE_CONSOLE is not set
# CONFIG_PKG_USING_LD3320 is not set
# CONFIG_PKG_USING_WK2124 is not set
# CONFIG_PKG_USING_LY68L6400 is not set
# CONFIG_PKG_USING_DM9051 is not set
# CONFIG_PKG_USING_SSD1306 is not set
# CONFIG_PKG_USING_QKEY is not set
# CONFIG_PKG_USING_RS485 is not set
# CONFIG_PKG_USING_NES is not set
# CONFIG_PKG_USING_VIRTUAL_SENSOR is not set
# CONFIG_PKG_USING_VDEVICE is not set
# CONFIG_PKG_USING_SGM706 is not set
# CONFIG_PKG_USING_STM32WB55_SDK is not set
# CONFIG_PKG_USING_RDA58XX is not set
# CONFIG_PKG_USING_LIBNFC is not set
# CONFIG_PKG_USING_MFOC is not set
# CONFIG_PKG_USING_TMC51XX is not set
# CONFIG_PKG_USING_TCA9534 is not set
# CONFIG_PKG_USING_KOBUKI is not set
# CONFIG_PKG_USING_ROSSERIAL is not set
# CONFIG_PKG_USING_MICRO_ROS is not set
#
# AI packages
#
# CONFIG_PKG_USING_LIBANN is not set
# CONFIG_PKG_USING_NNOM is not set
# CONFIG_PKG_USING_ONNX_BACKEND is not set
# CONFIG_PKG_USING_ONNX_PARSER is not set
# CONFIG_PKG_USING_TENSORFLOWLITEMICRO is not set
# CONFIG_PKG_USING_ELAPACK is not set
# CONFIG_PKG_USING_ULAPACK is not set
# CONFIG_PKG_USING_QUEST is not set
# CONFIG_PKG_USING_NAXOS is not set
#
# miscellaneous packages
...
...
@@ -319,13 +520,18 @@ CONFIG_RT_USING_LIBC=y
# CONFIG_PKG_USING_FASTLZ is not set
# CONFIG_PKG_USING_MINILZO is not set
# CONFIG_PKG_USING_QUICKLZ is not set
# CONFIG_PKG_USING_LZMA is not set
# CONFIG_PKG_USING_MULTIBUTTON is not set
# CONFIG_PKG_USING_FLEXIBLE_BUTTON is not set
# CONFIG_PKG_USING_CANFESTIVAL is not set
# CONFIG_PKG_USING_ZLIB is not set
# CONFIG_PKG_USING_MINIZIP is not set
# CONFIG_PKG_USING_DSTR is not set
# CONFIG_PKG_USING_TINYFRAME is not set
# CONFIG_PKG_USING_KENDRYTE_DEMO is not set
# CONFIG_PKG_USING_DIGITALCTRL is not set
# CONFIG_PKG_USING_UPACKER is not set
# CONFIG_PKG_USING_UPARAM is not set
#
# samples: kernel and components samples
...
...
@@ -336,7 +542,25 @@ CONFIG_RT_USING_LIBC=y
# CONFIG_PKG_USING_PERIPHERAL_SAMPLES is not set
# CONFIG_PKG_USING_HELLO is not set
# CONFIG_PKG_USING_VI is not set
# CONFIG_PKG_USING_NNOM is not set
# CONFIG_PKG_USING_KI is not set
# CONFIG_PKG_USING_ARMv7M_DWT is not set
# CONFIG_PKG_USING_VT100 is not set
# CONFIG_PKG_USING_UKAL is not set
# CONFIG_PKG_USING_CRCLIB is not set
#
# entertainment: terminal games and other interesting software packages
#
# CONFIG_PKG_USING_THREES is not set
# CONFIG_PKG_USING_2048 is not set
# CONFIG_PKG_USING_SNAKE is not set
# CONFIG_PKG_USING_TETRIS is not set
# CONFIG_PKG_USING_DONUT is not set
# CONFIG_PKG_USING_ACLOCK is not set
# CONFIG_PKG_USING_LWGPS is not set
# CONFIG_PKG_USING_STATE_MACHINE is not set
# CONFIG_PKG_USING_MCURSES is not set
# CONFIG_PKG_USING_COWSAY is not set
#
# Hardware Drivers Config
...
...
@@ -351,10 +575,21 @@ CONFIG_SOC_MIMXRT1064DVL6A=y
CONFIG_BSP_USING_GPIO
=
y
CONFIG_BSP_USING_LPUART
=
y
CONFIG_BSP_USING_LPUART1
=
y
# CONFIG_BSP_USING_LPUART2 is not set
# CONFIG_BSP_USING_LPUART3 is not set
# CONFIG_BSP_USING_LPUART4 is not set
# CONFIG_BSP_USING_LPUART5 is not set
# CONFIG_BSP_USING_LPUART6 is not set
# CONFIG_BSP_USING_LPUART7 is not set
# CONFIG_BSP_USING_LPUART8 is not set
# CONFIG_BSP_USING_I2C is not set
# CONFIG_BSP_USING_LCD is not set
#
# Onboard Peripheral Drivers
#
# CONFIG_BSP_USING_SDRAM is not set
# CONFIG_BSP_USING_ETH is not set
#
# Board extended module Drivers
...
...
bsp/imxrt/imxrt1064-nxp-evk/board/board.c
浏览文件 @
b104bbc4
...
...
@@ -413,7 +413,7 @@ static void imxrt_lcd_pins_init(void)
0U
);
/* Software Input On Field: Input Path is determined by functionality */
IOMUXC_SetPinMux
(
IOMUXC_GPIO_B1_03_LCD_DATA15
,
/* GPIO_B1_03 is configured as LCD_DATA15 */
0U
);
/* Software Input On Field: Input Path is determined by functionality */
x
0U
);
/* Software Input On Field: Input Path is determined by functionality */
IOMUXC_SetPinConfig
(
IOMUXC_GPIO_AD_B0_02_GPIO1_IO02
,
/* GPIO_AD_B0_02 PAD functional properties : */
0x10B0u
);
/* Slew Rate Field: Slow Slew Rate
...
...
bsp/imxrt/imxrt1064-nxp-evk/rtconfig.h
浏览文件 @
b104bbc4
...
...
@@ -10,12 +10,15 @@
#define RT_ALIGN_SIZE 4
#define RT_THREAD_PRIORITY_32
#define RT_THREAD_PRIORITY_MAX 32
#define RT_TICK_PER_SECOND 100
#define RT_TICK_PER_SECOND 100
0
#define RT_USING_OVERFLOW_CHECK
#define RT_USING_HOOK
#define RT_USING_IDLE_HOOK
#define RT_IDLE_HOOK_LIST_SIZE 4
#define IDLE_THREAD_STACK_SIZE 256
/* kservice optimization */
#define RT_DEBUG
#define RT_DEBUG_COLOR
...
...
@@ -40,7 +43,7 @@
#define RT_USING_CONSOLE
#define RT_CONSOLEBUF_SIZE 128
#define RT_CONSOLE_DEVICE_NAME "uart1"
#define RT_VER_NUM 0x4000
1
#define RT_VER_NUM 0x4000
4
/* RT-Thread Components */
...
...
@@ -76,29 +79,28 @@
#define RT_USING_DEVICE_IPC
#define RT_PIPE_BUFSZ 512
#define RT_USING_SERIAL
#define RT_USING_SERIAL_V1
#define RT_SERIAL_RB_BUFSZ 64
#define RT_USING_CPUTIME
#define RT_USING_PIN
/* Using WiFi */
/* Using USB */
/* POSIX layer and C standard library */
#define RT_USING_LIBC
#define RT_LIBC_FIXED_TIMEZONE 8
/* Network */
/* Socket abstraction layer */
/*
light weight TCP/IP stack
*/
/*
Network interface device
*/
/*
Modbus master and slave
stack */
/*
light weight TCP/IP
stack */
/* AT commands */
...
...
@@ -110,6 +112,9 @@
/* Utilities */
/* RT-Thread Utestcases */
/* RT-Thread online packages */
/* IoT - internet of things */
...
...
@@ -140,16 +145,27 @@
/* system packages */
/* acceleration: Assembly language or algorithmic acceleration packages */
/* Micrium: Micrium software products porting for RT-Thread */
/* peripheral libraries and drivers */
/* AI packages */
/* miscellaneous packages */
/* samples: kernel and components samples */
/* entertainment: terminal games and other interesting software packages */
/* Hardware Drivers Config */
#define BSP_USING_4MFLASH
...
...
@@ -163,6 +179,7 @@
/* Onboard Peripheral Drivers */
/* Board extended module Drivers */
...
...
bsp/imxrt/libraries/MIMXRT1064/SConscript
浏览文件 @
b104bbc4
...
...
@@ -63,6 +63,9 @@ if GetDepend(['RT_USING_AUDIO']):
if
GetDepend
([
'BSP_USING_LTDC'
]):
src
+=
[
'MIMXRT1064/drivers/'
]
if
GetDepend
([
"BSP_USING_LCD"
]):
src
+=
[
'MIMXRT1064/drivers/fsl_elcdif.c'
]
if
GetDepend
([
'BSP_USING_DMA'
]):
src
+=
[
'MIMXRT1064/drivers/fsl_dmamux.c'
]
...
...
bsp/imxrt/libraries/drivers/drv_lcd.c
浏览文件 @
b104bbc4
...
...
@@ -42,7 +42,7 @@ struct imxrt_lcd
};
static
struct
imxrt_lcd
lcd
;
A
LIGN
(
64
)
static
uint16_t
frame_buffer
[
LCD_HEIGHT
][
LCD_WIDTH
]
RT_SECTION
(
"NonCacheable"
);
A
T_NONCACHEABLE_SECTION_ALIGN
(
static
uint16_t
frame_buffer
[
LCD_HEIGHT
][
LCD_WIDTH
],
64
);
static
rt_err_t
imxrt_lcd_init
(
rt_device_t
device
)
{
...
...
bsp/raspberry-pi/raspi4-32/.config
浏览文件 @
b104bbc4
...
...
@@ -23,6 +23,12 @@ CONFIG_IDLE_THREAD_STACK_SIZE=2048
CONFIG_RT_USING_TIMER_SOFT
=
y
CONFIG_RT_TIMER_THREAD_PRIO
=
4
CONFIG_RT_TIMER_THREAD_STACK_SIZE
=
2048
#
# kservice optimization
#
# CONFIG_RT_KSERVICE_USING_STDLIB is not set
# CONFIG_RT_KSERVICE_USING_TINY_SIZE is not set
CONFIG_RT_DEBUG
=
y
# CONFIG_RT_DEBUG_COLOR is not set
# CONFIG_RT_DEBUG_INIT_CONFIG is not set
...
...
@@ -67,8 +73,10 @@ CONFIG_RT_USING_DEVICE=y
CONFIG_RT_USING_CONSOLE
=
y
CONFIG_RT_CONSOLEBUF_SIZE
=
128
CONFIG_RT_CONSOLE_DEVICE_NAME
=
"uart1"
CONFIG_RT_VER_NUM
=
0
x40003
# CONFIG_RT_PRINTF_LONGLONG is not set
CONFIG_RT_VER_NUM
=
0
x40004
# CONFIG_RT_USING_CPU_FFS is not set
CONFIG_RT_USING_GIC_V2
=
y
CONFIG_ARCH_ARMV8
=
y
# CONFIG_ARCH_CPU_STACK_GROWS_UPWARD is not set
...
...
@@ -125,6 +133,11 @@ CONFIG_RT_DFS_ELM_WORD_ACCESS=y
# CONFIG_RT_DFS_ELM_USE_LFN_2 is not set
CONFIG_RT_DFS_ELM_USE_LFN_3
=
y
CONFIG_RT_DFS_ELM_USE_LFN
=
3
CONFIG_RT_DFS_ELM_LFN_UNICODE_0
=
y
# CONFIG_RT_DFS_ELM_LFN_UNICODE_1 is not set
# CONFIG_RT_DFS_ELM_LFN_UNICODE_2 is not set
# CONFIG_RT_DFS_ELM_LFN_UNICODE_3 is not set
CONFIG_RT_DFS_ELM_LFN_UNICODE
=
0
CONFIG_RT_DFS_ELM_MAX_LFN
=
255
CONFIG_RT_DFS_ELM_DRIVES
=
2
CONFIG_RT_DFS_ELM_MAX_SECTOR_SIZE
=
512
...
...
@@ -133,8 +146,6 @@ CONFIG_RT_DFS_ELM_REENTRANT=y
CONFIG_RT_USING_DFS_DEVFS
=
y
# CONFIG_RT_USING_DFS_ROMFS is not set
# CONFIG_RT_USING_DFS_RAMFS is not set
# CONFIG_RT_USING_DFS_UFFS is not set
# CONFIG_RT_USING_DFS_JFFS2 is not set
# CONFIG_RT_USING_DFS_NFS is not set
#
...
...
@@ -146,6 +157,8 @@ CONFIG_RT_USING_SYSTEM_WORKQUEUE=y
CONFIG_RT_SYSTEM_WORKQUEUE_STACKSIZE
=
2048
CONFIG_RT_SYSTEM_WORKQUEUE_PRIORITY
=
23
CONFIG_RT_USING_SERIAL
=
y
CONFIG_RT_USING_SERIAL_V1
=
y
# CONFIG_RT_USING_SERIAL_V2 is not set
CONFIG_RT_SERIAL_USING_DMA
=
y
CONFIG_RT_SERIAL_RB_BUFSZ
=
512
# CONFIG_RT_USING_CAN is not set
...
...
@@ -181,6 +194,7 @@ CONFIG_RT_USING_WDT=y
# CONFIG_RT_USING_AUDIO is not set
# CONFIG_RT_USING_SENSOR is not set
CONFIG_RT_USING_TOUCH
=
y
# CONFIG_RT_TOUCH_PIN_IRQ is not set
# CONFIG_RT_USING_HWCRYPTO is not set
# CONFIG_RT_USING_PULSE_ENCODER is not set
# CONFIG_RT_USING_INPUT_CAPTURE is not set
...
...
@@ -203,6 +217,7 @@ CONFIG_RT_USING_POSIX=y
# CONFIG_RT_USING_POSIX_GETLINE is not set
# CONFIG_RT_USING_POSIX_AIO is not set
# CONFIG_RT_USING_MODULE is not set
CONFIG_RT_LIBC_DEFAULT_TIMEZONE
=
8
#
# Network
...
...
@@ -212,6 +227,7 @@ CONFIG_RT_USING_POSIX=y
# Socket abstraction layer
#
CONFIG_RT_USING_SAL
=
y
CONFIG_SAL_INTERNET_CHECK
=
y
#
# protocol stack implement
...
...
@@ -238,6 +254,7 @@ CONFIG_NETDEV_IPV6=0
CONFIG_RT_USING_LWIP
=
y
# CONFIG_RT_USING_LWIP141 is not set
CONFIG_RT_USING_LWIP202
=
y
# CONFIG_RT_USING_LWIP203 is not set
# CONFIG_RT_USING_LWIP212 is not set
# CONFIG_RT_USING_LWIP_IPV6 is not set
CONFIG_RT_LWIP_MEM_ALIGNMENT
=
4
...
...
@@ -252,8 +269,8 @@ CONFIG_IP_SOF_BROADCAST_RECV=1
#
# Static IPv4 Address
#
CONFIG_RT_LWIP_IPADDR
=
"192.168.1
.30
"
CONFIG_RT_LWIP_GWADDR
=
"192.168.1.1"
CONFIG_RT_LWIP_IPADDR
=
"192.168.1
11.172
"
CONFIG_RT_LWIP_GWADDR
=
"192.168.1
11
.1"
CONFIG_RT_LWIP_MSKADDR
=
"255.255.255.0"
CONFIG_RT_LWIP_UDP
=
y
CONFIG_RT_LWIP_TCP
=
y
...
...
@@ -307,6 +324,12 @@ CONFIG_RT_LWIP_USING_PING=y
# CONFIG_RT_USING_RYM is not set
# CONFIG_RT_USING_ULOG is not set
# CONFIG_RT_USING_UTEST is not set
# CONFIG_RT_USING_RT_LINK is not set
#
# RT-Thread Utestcases
#
# CONFIG_RT_USING_UTESTCASES is not set
#
# RT-Thread online packages
...
...
@@ -375,8 +398,6 @@ CONFIG_RT_LWIP_USING_PING=y
# CONFIG_PKG_USING_LIBRWS is not set
# CONFIG_PKG_USING_TCPSERVER is not set
# CONFIG_PKG_USING_PROTOBUF_C is not set
# CONFIG_PKG_USING_ONNX_PARSER is not set
# CONFIG_PKG_USING_ONNX_BACKEND is not set
# CONFIG_PKG_USING_DLT645 is not set
# CONFIG_PKG_USING_QXWZ is not set
# CONFIG_PKG_USING_SMTP_CLIENT is not set
...
...
@@ -390,6 +411,13 @@ CONFIG_RT_LWIP_USING_PING=y
# CONFIG_PKG_USING_PDULIB is not set
# CONFIG_PKG_USING_BTSTACK is not set
# CONFIG_PKG_USING_LORAWAN_ED_STACK is not set
# CONFIG_PKG_USING_WAYZ_IOTKIT is not set
# CONFIG_PKG_USING_MAVLINK is not set
# CONFIG_PKG_USING_RAPIDJSON is not set
# CONFIG_PKG_USING_BSAL is not set
# CONFIG_PKG_USING_AGILE_MODBUS is not set
# CONFIG_PKG_USING_AGILE_FTP is not set
# CONFIG_PKG_USING_EMBEDDEDPROTO is not set
#
# security packages
...
...
@@ -415,6 +443,7 @@ CONFIG_RT_LWIP_USING_PING=y
# CONFIG_PKG_USING_STEMWIN is not set
# CONFIG_PKG_USING_WAVPLAYER is not set
# CONFIG_PKG_USING_TJPGD is not set
# CONFIG_PKG_USING_PDFGEN is not set
# CONFIG_PKG_USING_HELIX is not set
# CONFIG_PKG_USING_AZUREGUIX is not set
# CONFIG_PKG_USING_TOUCHGFX2RTT is not set
...
...
@@ -429,6 +458,8 @@ CONFIG_RT_LWIP_USING_PING=y
# CONFIG_PKG_USING_RDB is not set
# CONFIG_PKG_USING_QRCODE is not set
# CONFIG_PKG_USING_ULOG_EASYFLASH is not set
# CONFIG_PKG_USING_ULOG_FILE is not set
# CONFIG_PKG_USING_LOGMGR is not set
# CONFIG_PKG_USING_ADBD is not set
# CONFIG_PKG_USING_COREMARK is not set
# CONFIG_PKG_USING_DHRYSTONE is not set
...
...
@@ -441,6 +472,20 @@ CONFIG_RT_LWIP_USING_PING=y
# CONFIG_PKG_USING_URLENCODE is not set
# CONFIG_PKG_USING_UMCN is not set
# CONFIG_PKG_USING_LWRB2RTT is not set
# CONFIG_PKG_USING_CPU_USAGE is not set
# CONFIG_PKG_USING_GBK2UTF8 is not set
# CONFIG_PKG_USING_VCONSOLE is not set
# CONFIG_PKG_USING_KDB is not set
# CONFIG_PKG_USING_WAMR is not set
# CONFIG_PKG_USING_MICRO_XRCE_DDS_CLIENT is not set
# CONFIG_PKG_USING_LWLOG is not set
# CONFIG_PKG_USING_ANV_TRACE is not set
# CONFIG_PKG_USING_ANV_MEMLEAK is not set
# CONFIG_PKG_USING_ANV_TESTSUIT is not set
# CONFIG_PKG_USING_ANV_BENCH is not set
# CONFIG_PKG_USING_DEVMEM is not set
# CONFIG_PKG_USING_REGEX is not set
# CONFIG_PKG_USING_MEM_SANDBOX is not set
#
# system packages
...
...
@@ -448,7 +493,6 @@ CONFIG_RT_LWIP_USING_PING=y
# CONFIG_PKG_USING_GUIENGINE is not set
# CONFIG_PKG_USING_CAIRO is not set
# CONFIG_PKG_USING_PIXMAN is not set
# CONFIG_PKG_USING_LWEXT4 is not set
# CONFIG_PKG_USING_PARTITION is not set
# CONFIG_PKG_USING_FAL is not set
# CONFIG_PKG_USING_FLASHDB is not set
...
...
@@ -458,6 +502,9 @@ CONFIG_RT_LWIP_USING_PING=y
# CONFIG_PKG_USING_CMSIS is not set
# CONFIG_PKG_USING_DFS_YAFFS is not set
# CONFIG_PKG_USING_LITTLEFS is not set
# CONFIG_PKG_USING_DFS_JFFS2 is not set
# CONFIG_PKG_USING_DFS_UFFS is not set
# CONFIG_PKG_USING_LWEXT4 is not set
# CONFIG_PKG_USING_THREAD_POOL is not set
# CONFIG_PKG_USING_ROBOTS is not set
# CONFIG_PKG_USING_EV is not set
...
...
@@ -478,6 +525,15 @@ CONFIG_RT_LWIP_USING_PING=y
# CONFIG_PKG_USING_UC_COMMON is not set
# CONFIG_PKG_USING_UC_MODBUS is not set
# CONFIG_PKG_USING_PPOOL is not set
# CONFIG_PKG_USING_OPENAMP is not set
# CONFIG_PKG_USING_RT_KPRINTF_THREADSAFE is not set
# CONFIG_PKG_USING_RT_MEMCPY_CM is not set
# CONFIG_PKG_USING_QFPLIB_M0_FULL is not set
# CONFIG_PKG_USING_QFPLIB_M0_TINY is not set
# CONFIG_PKG_USING_QFPLIB_M3 is not set
# CONFIG_PKG_USING_LPM is not set
# CONFIG_PKG_USING_TLSF is not set
# CONFIG_PKG_USING_EVENT_RECORDER is not set
#
# peripheral libraries and drivers
...
...
@@ -486,6 +542,7 @@ CONFIG_RT_LWIP_USING_PING=y
# CONFIG_PKG_USING_REALTEK_AMEBA is not set
# CONFIG_PKG_USING_SHT2X is not set
# CONFIG_PKG_USING_SHT3X is not set
# CONFIG_PKG_USING_AS7341 is not set
# CONFIG_PKG_USING_STM32_SDIO is not set
# CONFIG_PKG_USING_ICM20608 is not set
# CONFIG_PKG_USING_U8G2 is not set
...
...
@@ -534,6 +591,29 @@ CONFIG_RT_LWIP_USING_PING=y
# CONFIG_PKG_USING_DM9051 is not set
# CONFIG_PKG_USING_SSD1306 is not set
# CONFIG_PKG_USING_QKEY is not set
# CONFIG_PKG_USING_RS485 is not set
# CONFIG_PKG_USING_NES is not set
# CONFIG_PKG_USING_VIRTUAL_SENSOR is not set
# CONFIG_PKG_USING_VDEVICE is not set
# CONFIG_PKG_USING_SGM706 is not set
# CONFIG_PKG_USING_STM32WB55_SDK is not set
# CONFIG_PKG_USING_RDA58XX is not set
# CONFIG_PKG_USING_LIBNFC is not set
# CONFIG_PKG_USING_MFOC is not set
# CONFIG_PKG_USING_TMC51XX is not set
#
# AI packages
#
# CONFIG_PKG_USING_LIBANN is not set
# CONFIG_PKG_USING_NNOM is not set
# CONFIG_PKG_USING_ONNX_BACKEND is not set
# CONFIG_PKG_USING_ONNX_PARSER is not set
# CONFIG_PKG_USING_TENSORFLOWLITEMICRO is not set
# CONFIG_PKG_USING_ELAPACK is not set
# CONFIG_PKG_USING_ULAPACK is not set
# CONFIG_PKG_USING_QUEST is not set
# CONFIG_PKG_USING_NAXOS is not set
#
# miscellaneous packages
...
...
@@ -543,6 +623,7 @@ CONFIG_RT_LWIP_USING_PING=y
# CONFIG_PKG_USING_FASTLZ is not set
# CONFIG_PKG_USING_MINILZO is not set
# CONFIG_PKG_USING_QUICKLZ is not set
# CONFIG_PKG_USING_LZMA is not set
# CONFIG_PKG_USING_MULTIBUTTON is not set
# CONFIG_PKG_USING_FLEXIBLE_BUTTON is not set
# CONFIG_PKG_USING_CANFESTIVAL is not set
...
...
@@ -564,64 +645,24 @@ CONFIG_RT_LWIP_USING_PING=y
# CONFIG_PKG_USING_HELLO is not set
# CONFIG_PKG_USING_VI is not set
# CONFIG_PKG_USING_KI is not set
# CONFIG_PKG_USING_NNOM is not set
# CONFIG_PKG_USING_LIBANN is not set
# CONFIG_PKG_USING_ELAPACK is not set
# CONFIG_PKG_USING_ARMv7M_DWT is not set
# CONFIG_PKG_USING_VT100 is not set
# CONFIG_PKG_USING_ULAPACK is not set
# CONFIG_PKG_USING_UKAL is not set
# CONFIG_PKG_USING_CRCLIB is not set
#
#
games: games run on RT-Thread console
#
entertainment: terminal games and other interesting software packages
#
# CONFIG_PKG_USING_THREES is not set
# CONFIG_PKG_USING_2048 is not set
# CONFIG_PKG_USING_SNAKE is not set
# CONFIG_PKG_USING_TETRIS is not set
# CONFIG_PKG_USING_DONUT is not set
# CONFIG_PKG_USING_ACLOCK is not set
# CONFIG_PKG_USING_LWGPS is not set
# CONFIG_PKG_USING_TENSORFLOWLITEMICRO is not set
#
# Privated Packages of RealThread
#
# CONFIG_PKG_USING_CODEC is not set
# CONFIG_PKG_USING_PLAYER is not set
# CONFIG_PKG_USING_MPLAYER is not set
# CONFIG_PKG_USING_PERSIMMON_SRC is not set
# CONFIG_PKG_USING_JS_PERSIMMON is not set
# CONFIG_PKG_USING_JERRYSCRIPT_WIN32 is not set
#
# Network Utilities
#
# CONFIG_PKG_USING_MDNS is not set
# CONFIG_PKG_USING_UPNP is not set
# CONFIG_PKG_USING_WICED is not set
# CONFIG_PKG_USING_CLOUDSDK is not set
# CONFIG_PKG_USING_POWER_MANAGER is not set
# CONFIG_PKG_USING_RT_OTA is not set
# CONFIG_PKG_USING_RDBD_SRC is not set
# CONFIG_PKG_USING_RTINSIGHT is not set
# CONFIG_PKG_USING_SMARTCONFIG is not set
# CONFIG_PKG_USING_RTX is not set
# CONFIG_RT_USING_TESTCASE is not set
# CONFIG_PKG_USING_NGHTTP2 is not set
# CONFIG_PKG_USING_AVS is not set
# CONFIG_PKG_USING_ALI_LINKKIT is not set
# CONFIG_PKG_USING_STS is not set
# CONFIG_PKG_USING_DLMS is not set
# CONFIG_PKG_USING_AUDIO_FRAMEWORK is not set
# CONFIG_PKG_USING_ZBAR is not set
# CONFIG_PKG_USING_MCF is not set
# CONFIG_PKG_USING_URPC is not set
# CONFIG_PKG_USING_BSAL is not set
# CONFIG_PKG_USING_DCM is not set
# CONFIG_PKG_USING_EMQ is not set
# CONFIG_PKG_USING_CFGM is not set
# CONFIG_PKG_USING_RT_CMSIS_DAP is not set
# CONFIG_PKG_USING_VIRTUAL_DEVICE is not set
# CONFIG_PKG_USING_SMODULE is not set
# CONFIG_PKG_USING_STATE_MACHINE is not set
# CONFIG_PKG_USING_MCURSES is not set
# CONFIG_PKG_USING_COWSAY is not set
CONFIG_BCM2711_SOC
=
y
# CONFIG_BSP_SUPPORT_FPU is not set
...
...
bsp/raspberry-pi/raspi4-32/Kconfig
浏览文件 @
b104bbc4
...
...
@@ -23,6 +23,7 @@ config BCM2711_SOC
select ARCH_ARMV8
select RT_USING_COMPONENTS_INIT
select RT_USING_USER_MAIN
select RT_USING_GIC_V2
default y
source "driver/Kconfig"
bsp/raspberry-pi/raspi4-32/driver/drv_eth.c
浏览文件 @
b104bbc4
此差异已折叠。
点击以展开。
bsp/raspberry-pi/raspi4-32/link.lds
浏览文件 @
b104bbc4
...
...
@@ -11,7 +11,7 @@
SECTIONS
{
. = 0x
8
000;
. = 0x
200
000;
. = ALIGN(4096);
.text :
{
...
...
bsp/raspberry-pi/raspi4-32/rtconfig.h
浏览文件 @
b104bbc4
...
...
@@ -19,6 +19,9 @@
#define RT_USING_TIMER_SOFT
#define RT_TIMER_THREAD_PRIO 4
#define RT_TIMER_THREAD_STACK_SIZE 2048
/* kservice optimization */
#define RT_DEBUG
/* Inter-Thread communication */
...
...
@@ -41,7 +44,8 @@
#define RT_USING_CONSOLE
#define RT_CONSOLEBUF_SIZE 128
#define RT_CONSOLE_DEVICE_NAME "uart1"
#define RT_VER_NUM 0x40003
#define RT_VER_NUM 0x40004
#define RT_USING_GIC_V2
#define ARCH_ARMV8
/* RT-Thread Components */
...
...
@@ -84,6 +88,8 @@
#define RT_DFS_ELM_WORD_ACCESS
#define RT_DFS_ELM_USE_LFN_3
#define RT_DFS_ELM_USE_LFN 3
#define RT_DFS_ELM_LFN_UNICODE_0
#define RT_DFS_ELM_LFN_UNICODE 0
#define RT_DFS_ELM_MAX_LFN 255
#define RT_DFS_ELM_DRIVES 2
#define RT_DFS_ELM_MAX_SECTOR_SIZE 512
...
...
@@ -98,6 +104,7 @@
#define RT_SYSTEM_WORKQUEUE_STACKSIZE 2048
#define RT_SYSTEM_WORKQUEUE_PRIORITY 23
#define RT_USING_SERIAL
#define RT_USING_SERIAL_V1
#define RT_SERIAL_USING_DMA
#define RT_SERIAL_RB_BUFSZ 512
#define RT_USING_I2C
...
...
@@ -120,12 +127,14 @@
#define RT_USING_LIBC
#define RT_USING_POSIX
#define RT_LIBC_DEFAULT_TIMEZONE 8
/* Network */
/* Socket abstraction layer */
#define RT_USING_SAL
#define SAL_INTERNET_CHECK
/* protocol stack implement */
...
...
@@ -156,8 +165,8 @@
/* Static IPv4 Address */
#define RT_LWIP_IPADDR "192.168.1
.30
"
#define RT_LWIP_GWADDR "192.168.1.1"
#define RT_LWIP_IPADDR "192.168.1
11.172
"
#define RT_LWIP_GWADDR "192.168.1
11
.1"
#define RT_LWIP_MSKADDR "255.255.255.0"
#define RT_LWIP_UDP
#define RT_LWIP_TCP
...
...
@@ -195,6 +204,9 @@
/* Utilities */
/* RT-Thread Utestcases */
/* RT-Thread online packages */
/* IoT - internet of things */
...
...
@@ -232,19 +244,16 @@
/* peripheral libraries and drivers */
/* miscellaneous packages */
/* samples: kernel and components samples */
/* AI packages */
/*
games: games run on RT-Thread console
*/
/*
miscellaneous packages
*/
/*
Privated Packages of RealThread
*/
/*
samples: kernel and components samples
*/
/*
Network Utiliti
es */
/*
entertainment: terminal games and other interesting software packag
es */
#define BCM2711_SOC
...
...
bsp/raspberry-pi/raspi4-32/rtconfig.py
浏览文件 @
b104bbc4
...
...
@@ -37,7 +37,7 @@ if PLATFORM == 'gcc':
DEVICE
=
' -march=armv8-a -mtune=cortex-a72'
CFLAGS
=
DEVICE
+
' -Wall'
AFLAGS
=
' -c'
+
' -x assembler-with-cpp -D__ASSEMBLY__'
AFLAGS
=
' -c'
+
DEVICE
+
' -x assembler-with-cpp -D__ASSEMBLY__'
LFLAGS
=
DEVICE
+
' -nostartfiles -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,system_vectors -T link.lds'
CPATH
=
''
LPATH
=
''
...
...
bsp/stm32/libraries/HAL_Drivers/drv_eth.c
浏览文件 @
b104bbc4
...
...
@@ -41,9 +41,9 @@ struct rt_stm32_eth
/* interface address info, hw address */
rt_uint8_t
dev_addr
[
MAX_ADDR_LEN
];
/* ETH_Speed */
uint32_t
ETH_Speed
;
rt_
uint32_t
ETH_Speed
;
/* ETH_Duplex_Mode */
uint32_t
ETH_Mode
;
rt_
uint32_t
ETH_Mode
;
};
static
ETH_DMADescTypeDef
*
DMARxDscrTab
,
*
DMATxDscrTab
;
...
...
@@ -167,8 +167,14 @@ static rt_err_t rt_stm32_eth_control(rt_device_t dev, int cmd, void *args)
{
case
NIOCTL_GADDR
:
/* get mac address */
if
(
args
)
rt_memcpy
(
args
,
stm32_eth_device
.
dev_addr
,
6
);
else
return
-
RT_ERROR
;
if
(
args
)
{
SMEMCPY
(
args
,
stm32_eth_device
.
dev_addr
,
6
);
}
else
{
return
-
RT_ERROR
;
}
break
;
default
:
...
...
@@ -214,7 +220,7 @@ rt_err_t rt_stm32_eth_tx(rt_device_t dev, struct pbuf *p)
while
((
byteslefttocopy
+
bufferoffset
)
>
ETH_TX_BUF_SIZE
)
{
/* Copy data to Tx buffer*/
memcpy
((
uint8_t
*
)((
uint8_t
*
)
buffer
+
bufferoffset
),
(
uint8_t
*
)((
uint8_t
*
)
q
->
payload
+
payloadoffset
),
(
ETH_TX_BUF_SIZE
-
bufferoffset
));
SMEMCPY
((
uint8_t
*
)((
uint8_t
*
)
buffer
+
bufferoffset
),
(
uint8_t
*
)((
uint8_t
*
)
q
->
payload
+
payloadoffset
),
(
ETH_TX_BUF_SIZE
-
bufferoffset
));
/* Point to next descriptor */
DmaTxDesc
=
(
ETH_DMADescTypeDef
*
)(
DmaTxDesc
->
Buffer2NextDescAddr
);
...
...
@@ -236,7 +242,7 @@ rt_err_t rt_stm32_eth_tx(rt_device_t dev, struct pbuf *p)
}
/* Copy the remaining bytes */
memcpy
((
uint8_t
*
)((
uint8_t
*
)
buffer
+
bufferoffset
),
(
uint8_t
*
)((
uint8_t
*
)
q
->
payload
+
payloadoffset
),
byteslefttocopy
);
SMEMCPY
((
uint8_t
*
)((
uint8_t
*
)
buffer
+
bufferoffset
),
(
uint8_t
*
)((
uint8_t
*
)
q
->
payload
+
payloadoffset
),
byteslefttocopy
);
bufferoffset
=
bufferoffset
+
byteslefttocopy
;
framelength
=
framelength
+
byteslefttocopy
;
}
...
...
@@ -327,7 +333,7 @@ struct pbuf *rt_stm32_eth_rx(rt_device_t dev)
while
((
byteslefttocopy
+
bufferoffset
)
>
ETH_RX_BUF_SIZE
)
{
/* Copy data to pbuf */
memcpy
((
uint8_t
*
)((
uint8_t
*
)
q
->
payload
+
payloadoffset
),
(
uint8_t
*
)((
uint8_t
*
)
buffer
+
bufferoffset
),
(
ETH_RX_BUF_SIZE
-
bufferoffset
));
SMEMCPY
((
uint8_t
*
)((
uint8_t
*
)
q
->
payload
+
payloadoffset
),
(
uint8_t
*
)((
uint8_t
*
)
buffer
+
bufferoffset
),
(
ETH_RX_BUF_SIZE
-
bufferoffset
));
/* Point to next descriptor */
dmarxdesc
=
(
ETH_DMADescTypeDef
*
)(
dmarxdesc
->
Buffer2NextDescAddr
);
...
...
@@ -338,7 +344,7 @@ struct pbuf *rt_stm32_eth_rx(rt_device_t dev)
bufferoffset
=
0
;
}
/* Copy remaining data in pbuf */
memcpy
((
uint8_t
*
)((
uint8_t
*
)
q
->
payload
+
payloadoffset
),
(
uint8_t
*
)((
uint8_t
*
)
buffer
+
bufferoffset
),
byteslefttocopy
);
SMEMCPY
((
uint8_t
*
)((
uint8_t
*
)
q
->
payload
+
payloadoffset
),
(
uint8_t
*
)((
uint8_t
*
)
buffer
+
bufferoffset
),
byteslefttocopy
);
bufferoffset
=
bufferoffset
+
byteslefttocopy
;
}
}
...
...
@@ -385,7 +391,9 @@ void HAL_ETH_RxCpltCallback(ETH_HandleTypeDef *heth)
rt_err_t
result
;
result
=
eth_device_ready
(
&
(
stm32_eth_device
.
parent
));
if
(
result
!=
RT_EOK
)
{
LOG_I
(
"RxCpltCallback err = %d"
,
result
);
}
}
void
HAL_ETH_ErrorCallback
(
ETH_HandleTypeDef
*
heth
)
...
...
bsp/stm32/libraries/HAL_Drivers/drv_eth.h
浏览文件 @
b104bbc4
...
...
@@ -28,13 +28,12 @@
/* The PHY ID one register */
#define PHY_ID1_REG 0x02U
/* The PHY ID two register */
#define PHY_ID2_REG 0x03U
/* The PHY auto-negotiate advertise register */
#define PHY_AUTONEG_ADVERTISE_REG 0x04U
#ifdef PHY_USING_LAN8720A
/* The PHY interrupt source flag register. */
#define PHY_INTERRUPT_FLAG_REG 0x1DU
...
...
@@ -51,9 +50,8 @@
#define PHY_Status_SPEED_10M(sr) ((sr) & PHY_10M_MASK)
#define PHY_Status_SPEED_100M(sr) ((sr) & PHY_100M_MASK)
#define PHY_Status_FULL_DUPLEX(sr) ((sr) & PHY_FULL_DUPLEX_MASK)
#endif
/* PHY_USING_LAN8720A */
#
ifdef PHY_USING_DM9161CEP
#
elif defined(PHY_USING_DM9161CEP)
#define PHY_Status_REG 0x11U
#define PHY_10M_MASK ((1<<12) || (1<<13))
#define PHY_100M_MASK ((1<<14) || (1<<15))
...
...
@@ -69,9 +67,7 @@
#define PHY_LINK_CHANGE_MASK (1<<9)
#define PHY_INT_MASK 0
#endif
/* PHY_USING_DM9161CEP */
#ifdef PHY_USING_DP83848C
#elif defined(PHY_USING_DP83848C)
#define PHY_Status_REG 0x10U
#define PHY_10M_MASK (1<<1)
#define PHY_FULL_DUPLEX_MASK (1<<2)
...
...
@@ -87,6 +83,6 @@
/* The PHY interrupt mask register. */
#define PHY_INTERRUPT_MASK_REG 0x12U
#define PHY_INT_MASK (1<<5)
#endif
/* PHY_USING_DP83848C */
#endif
#endif
/* __DRV_ETH_H__ */
bsp/stm32/libraries/HAL_Drivers/drv_rtc.c
浏览文件 @
b104bbc4
...
...
@@ -265,8 +265,8 @@ static rt_err_t stm32_rtc_set_secs(void *args)
static
const
struct
rt_rtc_ops
stm32_rtc_ops
=
{
stm32_rtc_init
,
stm32_rtc_get_secs
,
/* get_secs */
stm32_rtc_set_secs
,
/* set secs */
stm32_rtc_get_secs
,
stm32_rtc_set_secs
,
RT_NULL
,
RT_NULL
,
RT_NULL
,
...
...
@@ -280,7 +280,7 @@ static int rt_hw_rtc_init(void)
rt_err_t
result
;
stm32_rtc_dev
.
ops
=
&
stm32_rtc_ops
;
result
=
rt_
rtc_dev
_register
(
&
stm32_rtc_dev
,
"rtc"
,
RT_DEVICE_FLAG_RDWR
,
RT_NULL
);
result
=
rt_
hw_rtc
_register
(
&
stm32_rtc_dev
,
"rtc"
,
RT_DEVICE_FLAG_RDWR
,
RT_NULL
);
if
(
result
!=
RT_EOK
)
{
LOG_E
(
"rtc register err code: %d"
,
result
);
...
...
bsp/stm32/stm32f407-atk-explorer/.config
浏览文件 @
b104bbc4
...
...
@@ -21,6 +21,12 @@ CONFIG_RT_USING_IDLE_HOOK=y
CONFIG_RT_IDLE_HOOK_LIST_SIZE
=
4
CONFIG_IDLE_THREAD_STACK_SIZE
=
1024
# CONFIG_RT_USING_TIMER_SOFT is not set
#
# kservice optimization
#
# CONFIG_RT_KSERVICE_USING_STDLIB is not set
# CONFIG_RT_KSERVICE_USING_TINY_SIZE is not set
CONFIG_RT_DEBUG
=
y
CONFIG_RT_DEBUG_COLOR
=
y
# CONFIG_RT_DEBUG_INIT_CONFIG is not set
...
...
@@ -52,6 +58,7 @@ CONFIG_RT_USING_MEMPOOL=y
# CONFIG_RT_USING_NOHEAP is not set
CONFIG_RT_USING_SMALL_MEM
=
y
# CONFIG_RT_USING_SLAB is not set
# CONFIG_RT_USING_USERHEAP is not set
# CONFIG_RT_USING_MEMTRACE is not set
CONFIG_RT_USING_HEAP
=
y
...
...
@@ -64,7 +71,8 @@ CONFIG_RT_USING_DEVICE=y
CONFIG_RT_USING_CONSOLE
=
y
CONFIG_RT_CONSOLEBUF_SIZE
=
128
CONFIG_RT_CONSOLE_DEVICE_NAME
=
"uart1"
CONFIG_RT_VER_NUM
=
0
x40002
# CONFIG_RT_PRINTF_LONGLONG is not set
CONFIG_RT_VER_NUM
=
0
x40004
CONFIG_ARCH_ARM
=
y
CONFIG_RT_USING_CPU_FFS
=
y
CONFIG_ARCH_ARM_CORTEX_M
=
y
...
...
@@ -115,18 +123,21 @@ CONFIG_RT_USING_DEVICE_IPC=y
CONFIG_RT_PIPE_BUFSZ
=
512
# CONFIG_RT_USING_SYSTEM_WORKQUEUE is not set
CONFIG_RT_USING_SERIAL
=
y
CONFIG_RT_USING_SERIAL_V1
=
y
# CONFIG_RT_USING_SERIAL_V2 is not set
CONFIG_RT_SERIAL_USING_DMA
=
y
CONFIG_RT_SERIAL_RB_BUFSZ
=
64
# CONFIG_RT_USING_CAN is not set
# CONFIG_RT_USING_HWTIMER is not set
# CONFIG_RT_USING_CPUTIME is not set
# CONFIG_RT_USING_I2C is not set
# CONFIG_RT_USING_PHY is not set
CONFIG_RT_USING_PIN
=
y
# CONFIG_RT_USING_ADC is not set
# CONFIG_RT_USING_DAC is not set
# CONFIG_RT_USING_PWM is not set
# CONFIG_RT_USING_MTD_NOR is not set
# CONFIG_RT_USING_MTD_NAND is not set
# CONFIG_RT_USING_MTD is not set
# CONFIG_RT_USING_PM is not set
# CONFIG_RT_USING_RTC is not set
# CONFIG_RT_USING_SDIO is not set
...
...
@@ -134,15 +145,10 @@ CONFIG_RT_USING_PIN=y
# CONFIG_RT_USING_WDT is not set
# CONFIG_RT_USING_AUDIO is not set
# CONFIG_RT_USING_SENSOR is not set
#
# Using Hardware Crypto drivers
#
# CONFIG_RT_USING_TOUCH is not set
# CONFIG_RT_USING_HWCRYPTO is not set
#
# Using WiFi
#
# CONFIG_RT_USING_PULSE_ENCODER is not set
# CONFIG_RT_USING_INPUT_CAPTURE is not set
# CONFIG_RT_USING_WIFI is not set
#
...
...
@@ -156,6 +162,8 @@ CONFIG_RT_USING_PIN=y
#
# CONFIG_RT_USING_LIBC is not set
# CONFIG_RT_USING_PTHREADS is not set
CONFIG_RT_LIBC_USING_TIME
=
y
CONFIG_RT_LIBC_DEFAULT_TIMEZONE
=
8
#
# Network
...
...
@@ -176,11 +184,6 @@ CONFIG_RT_USING_PIN=y
#
# CONFIG_RT_USING_LWIP is not set
#
# Modbus master and slave stack
#
# CONFIG_RT_USING_MODBUS is not set
#
# AT commands
#
...
...
@@ -197,8 +200,14 @@ CONFIG_RT_USING_PIN=y
# CONFIG_RT_USING_RYM is not set
# CONFIG_RT_USING_ULOG is not set
# CONFIG_RT_USING_UTEST is not set
# CONFIG_RT_USING_RT_LINK is not set
# CONFIG_RT_USING_LWP is not set
#
# RT-Thread Utestcases
#
# CONFIG_RT_USING_UTESTCASES is not set
#
# RT-Thread online packages
#
...
...
@@ -206,14 +215,20 @@ CONFIG_RT_USING_PIN=y
#
# IoT - internet of things
#
# CONFIG_PKG_USING_LORAWAN_DRIVER is not set
# CONFIG_PKG_USING_PAHOMQTT is not set
# CONFIG_PKG_USING_UMQTT is not set
# CONFIG_PKG_USING_WEBCLIENT is not set
# CONFIG_PKG_USING_WEBNET is not set
# CONFIG_PKG_USING_MONGOOSE is not set
# CONFIG_PKG_USING_MYMQTT is not set
# CONFIG_PKG_USING_KAWAII_MQTT is not set
# CONFIG_PKG_USING_BC28_MQTT is not set
# CONFIG_PKG_USING_WEBTERMINAL is not set
# CONFIG_PKG_USING_CJSON is not set
# CONFIG_PKG_USING_JSMN is not set
# CONFIG_PKG_USING_LIBMODBUS is not set
# CONFIG_PKG_USING_FREEMODBUS is not set
# CONFIG_PKG_USING_LJSON is not set
# CONFIG_PKG_USING_EZXML is not set
# CONFIG_PKG_USING_NANOPB is not set
...
...
@@ -235,6 +250,8 @@ CONFIG_RT_USING_PIN=y
# CONFIG_PKG_USING_COAP is not set
# CONFIG_PKG_USING_NOPOLL is not set
# CONFIG_PKG_USING_NETUTILS is not set
# CONFIG_PKG_USING_CMUX is not set
# CONFIG_PKG_USING_PPP_DEVICE is not set
# CONFIG_PKG_USING_AT_DEVICE is not set
# CONFIG_PKG_USING_ATSRV_SOCKET is not set
# CONFIG_PKG_USING_WIZNET is not set
...
...
@@ -246,12 +263,38 @@ CONFIG_RT_USING_PIN=y
# CONFIG_PKG_USING_GAGENT_CLOUD is not set
# CONFIG_PKG_USING_ALI_IOTKIT is not set
# CONFIG_PKG_USING_AZURE is not set
# CONFIG_PKG_USING_TENCENT_IOTKIT is not set
# CONFIG_PKG_USING_TENCENT_IOT_EXPLORER is not set
# CONFIG_PKG_USING_JIOT-C-SDK is not set
# CONFIG_PKG_USING_UCLOUD_IOT_SDK is not set
# CONFIG_PKG_USING_JOYLINK is not set
# CONFIG_PKG_USING_NIMBLE is not set
# CONFIG_PKG_USING_OTA_DOWNLOADER is not set
# CONFIG_PKG_USING_IPMSG is not set
# CONFIG_PKG_USING_LSSDP is not set
# CONFIG_PKG_USING_AIRKISS_OPEN is not set
# CONFIG_PKG_USING_LIBRWS is not set
# CONFIG_PKG_USING_TCPSERVER is not set
# CONFIG_PKG_USING_PROTOBUF_C is not set
# CONFIG_PKG_USING_DLT645 is not set
# CONFIG_PKG_USING_QXWZ is not set
# CONFIG_PKG_USING_SMTP_CLIENT is not set
# CONFIG_PKG_USING_ABUP_FOTA is not set
# CONFIG_PKG_USING_LIBCURL2RTT is not set
# CONFIG_PKG_USING_CAPNP is not set
# CONFIG_PKG_USING_RT_CJSON_TOOLS is not set
# CONFIG_PKG_USING_AGILE_TELNET is not set
# CONFIG_PKG_USING_NMEALIB is not set
# CONFIG_PKG_USING_AGILE_JSMN is not set
# CONFIG_PKG_USING_PDULIB is not set
# CONFIG_PKG_USING_BTSTACK is not set
# CONFIG_PKG_USING_LORAWAN_ED_STACK is not set
# CONFIG_PKG_USING_WAYZ_IOTKIT is not set
# CONFIG_PKG_USING_MAVLINK is not set
# CONFIG_PKG_USING_RAPIDJSON is not set
# CONFIG_PKG_USING_BSAL is not set
# CONFIG_PKG_USING_AGILE_MODBUS is not set
# CONFIG_PKG_USING_AGILE_FTP is not set
# CONFIG_PKG_USING_EMBEDDEDPROTO is not set
#
# security packages
...
...
@@ -259,6 +302,8 @@ CONFIG_RT_USING_PIN=y
# CONFIG_PKG_USING_MBEDTLS is not set
# CONFIG_PKG_USING_libsodium is not set
# CONFIG_PKG_USING_TINYCRYPT is not set
# CONFIG_PKG_USING_TFM is not set
# CONFIG_PKG_USING_YD_CRYPTO is not set
#
# language packages
...
...
@@ -273,6 +318,13 @@ CONFIG_RT_USING_PIN=y
# CONFIG_PKG_USING_OPENMV is not set
# CONFIG_PKG_USING_MUPDF is not set
# CONFIG_PKG_USING_STEMWIN is not set
# CONFIG_PKG_USING_WAVPLAYER is not set
# CONFIG_PKG_USING_TJPGD is not set
# CONFIG_PKG_USING_PDFGEN is not set
# CONFIG_PKG_USING_HELIX is not set
# CONFIG_PKG_USING_AZUREGUIX is not set
# CONFIG_PKG_USING_TOUCHGFX2RTT is not set
# CONFIG_PKG_USING_NUEMWIN is not set
#
# tools packages
...
...
@@ -284,7 +336,36 @@ CONFIG_RT_USING_PIN=y
# CONFIG_PKG_USING_RDB is not set
# CONFIG_PKG_USING_QRCODE is not set
# CONFIG_PKG_USING_ULOG_EASYFLASH is not set
# CONFIG_PKG_USING_ULOG_FILE is not set
# CONFIG_PKG_USING_LOGMGR is not set
# CONFIG_PKG_USING_ADBD is not set
# CONFIG_PKG_USING_COREMARK is not set
# CONFIG_PKG_USING_DHRYSTONE is not set
# CONFIG_PKG_USING_MEMORYPERF is not set
# CONFIG_PKG_USING_NR_MICRO_SHELL is not set
# CONFIG_PKG_USING_CHINESE_FONT_LIBRARY is not set
# CONFIG_PKG_USING_LUNAR_CALENDAR is not set
# CONFIG_PKG_USING_BS8116A is not set
# CONFIG_PKG_USING_GPS_RMC is not set
# CONFIG_PKG_USING_URLENCODE is not set
# CONFIG_PKG_USING_UMCN is not set
# CONFIG_PKG_USING_LWRB2RTT is not set
# CONFIG_PKG_USING_CPU_USAGE is not set
# CONFIG_PKG_USING_GBK2UTF8 is not set
# CONFIG_PKG_USING_VCONSOLE is not set
# CONFIG_PKG_USING_KDB is not set
# CONFIG_PKG_USING_WAMR is not set
# CONFIG_PKG_USING_MICRO_XRCE_DDS_CLIENT is not set
# CONFIG_PKG_USING_LWLOG is not set
# CONFIG_PKG_USING_ANV_TRACE is not set
# CONFIG_PKG_USING_ANV_MEMLEAK is not set
# CONFIG_PKG_USING_ANV_TESTSUIT is not set
# CONFIG_PKG_USING_ANV_BENCH is not set
# CONFIG_PKG_USING_DEVMEM is not set
# CONFIG_PKG_USING_REGEX is not set
# CONFIG_PKG_USING_MEM_SANDBOX is not set
# CONFIG_PKG_USING_SOLAR_TERMS is not set
# CONFIG_PKG_USING_GAN_ZHI is not set
#
# system packages
...
...
@@ -293,16 +374,47 @@ CONFIG_RT_USING_PIN=y
# CONFIG_PKG_USING_PERSIMMON is not set
# CONFIG_PKG_USING_CAIRO is not set
# CONFIG_PKG_USING_PIXMAN is not set
# CONFIG_PKG_USING_LWEXT4 is not set
# CONFIG_PKG_USING_PARTITION is not set
# CONFIG_PKG_USING_FAL is not set
# CONFIG_PKG_USING_FLASHDB is not set
# CONFIG_PKG_USING_SQLITE is not set
# CONFIG_PKG_USING_RTI is not set
# CONFIG_PKG_USING_LITTLEVGL2RTT is not set
# CONFIG_PKG_USING_CMSIS is not set
# CONFIG_PKG_USING_DFS_YAFFS is not set
# CONFIG_PKG_USING_LITTLEFS is not set
# CONFIG_PKG_USING_DFS_JFFS2 is not set
# CONFIG_PKG_USING_DFS_UFFS is not set
# CONFIG_PKG_USING_LWEXT4 is not set
# CONFIG_PKG_USING_THREAD_POOL is not set
# CONFIG_PKG_USING_ROBOTS is not set
# CONFIG_PKG_USING_EV is not set
# CONFIG_PKG_USING_SYSWATCH is not set
# CONFIG_PKG_USING_SYS_LOAD_MONITOR is not set
# CONFIG_PKG_USING_PLCCORE is not set
# CONFIG_PKG_USING_RAMDISK is not set
# CONFIG_PKG_USING_MININI is not set
# CONFIG_PKG_USING_QBOOT is not set
#
# Micrium: Micrium software products porting for RT-Thread
#
# CONFIG_PKG_USING_UCOSIII_WRAPPER is not set
# CONFIG_PKG_USING_UCOSII_WRAPPER is not set
# CONFIG_PKG_USING_UC_CRC is not set
# CONFIG_PKG_USING_UC_CLK is not set
# CONFIG_PKG_USING_UC_COMMON is not set
# CONFIG_PKG_USING_UC_MODBUS is not set
# CONFIG_PKG_USING_PPOOL is not set
# CONFIG_PKG_USING_OPENAMP is not set
# CONFIG_PKG_USING_RT_KPRINTF_THREADSAFE is not set
# CONFIG_PKG_USING_RT_MEMCPY_CM is not set
# CONFIG_PKG_USING_QFPLIB_M0_FULL is not set
# CONFIG_PKG_USING_QFPLIB_M0_TINY is not set
# CONFIG_PKG_USING_QFPLIB_M3 is not set
# CONFIG_PKG_USING_LPM is not set
# CONFIG_PKG_USING_TLSF is not set
# CONFIG_PKG_USING_EVENT_RECORDER is not set
#
# peripheral libraries and drivers
...
...
@@ -310,7 +422,8 @@ CONFIG_RT_USING_PIN=y
# CONFIG_PKG_USING_SENSORS_DRIVERS is not set
# CONFIG_PKG_USING_REALTEK_AMEBA is not set
# CONFIG_PKG_USING_SHT2X is not set
# CONFIG_PKG_USING_AP3216C is not set
# CONFIG_PKG_USING_SHT3X is not set
# CONFIG_PKG_USING_AS7341 is not set
# CONFIG_PKG_USING_STM32_SDIO is not set
# CONFIG_PKG_USING_ICM20608 is not set
# CONFIG_PKG_USING_U8G2 is not set
...
...
@@ -319,15 +432,70 @@ CONFIG_RT_USING_PIN=y
# CONFIG_PKG_USING_SX12XX is not set
# CONFIG_PKG_USING_SIGNAL_LED is not set
# CONFIG_PKG_USING_LEDBLINK is not set
# CONFIG_PKG_USING_LITTLED is not set
# CONFIG_PKG_USING_LKDGUI is not set
# CONFIG_PKG_USING_NRF5X_SDK is not set
# CONFIG_PKG_USING_NRFX is not set
# CONFIG_PKG_USING_WM_LIBRARIES is not set
# CONFIG_PKG_USING_KENDRYTE_SDK is not set
# CONFIG_PKG_USING_INFRARED is not set
# CONFIG_PKG_USING_ROSSERIAL is not set
# CONFIG_PKG_USING_AGILE_BUTTON is not set
# CONFIG_PKG_USING_AGILE_LED is not set
# CONFIG_PKG_USING_AT24CXX is not set
# CONFIG_PKG_USING_MOTIONDRIVER2RTT is not set
# CONFIG_PKG_USING_AD7746 is not set
# CONFIG_PKG_USING_PCA9685 is not set
# CONFIG_PKG_USING_I2C_TOOLS is not set
# CONFIG_PKG_USING_NRF24L01 is not set
# CONFIG_PKG_USING_TOUCH_DRIVERS is not set
# CONFIG_PKG_USING_MAX17048 is not set
# CONFIG_PKG_USING_RPLIDAR is not set
# CONFIG_PKG_USING_AS608 is not set
# CONFIG_PKG_USING_RC522 is not set
# CONFIG_PKG_USING_WS2812B is not set
# CONFIG_PKG_USING_EMBARC_BSP is not set
# CONFIG_PKG_USING_EXTERN_RTC_DRIVERS is not set
# CONFIG_PKG_USING_MULTI_RTIMER is not set
# CONFIG_PKG_USING_MAX7219 is not set
# CONFIG_PKG_USING_BEEP is not set
# CONFIG_PKG_USING_EASYBLINK is not set
# CONFIG_PKG_USING_PMS_SERIES is not set
# CONFIG_PKG_USING_CAN_YMODEM is not set
# CONFIG_PKG_USING_LORA_RADIO_DRIVER is not set
# CONFIG_PKG_USING_QLED is not set
# CONFIG_PKG_USING_PAJ7620 is not set
# CONFIG_PKG_USING_AGILE_CONSOLE is not set
# CONFIG_PKG_USING_LD3320 is not set
# CONFIG_PKG_USING_WK2124 is not set
# CONFIG_PKG_USING_LY68L6400 is not set
# CONFIG_PKG_USING_DM9051 is not set
# CONFIG_PKG_USING_SSD1306 is not set
# CONFIG_PKG_USING_QKEY is not set
# CONFIG_PKG_USING_RS485 is not set
# CONFIG_PKG_USING_NES is not set
# CONFIG_PKG_USING_VIRTUAL_SENSOR is not set
# CONFIG_PKG_USING_VDEVICE is not set
# CONFIG_PKG_USING_SGM706 is not set
# CONFIG_PKG_USING_STM32WB55_SDK is not set
# CONFIG_PKG_USING_RDA58XX is not set
# CONFIG_PKG_USING_LIBNFC is not set
# CONFIG_PKG_USING_MFOC is not set
# CONFIG_PKG_USING_TMC51XX is not set
# CONFIG_PKG_USING_TCA9534 is not set
#
# AI packages
#
# CONFIG_PKG_USING_LIBANN is not set
# CONFIG_PKG_USING_NNOM is not set
# CONFIG_PKG_USING_ONNX_BACKEND is not set
# CONFIG_PKG_USING_ONNX_PARSER is not set
# CONFIG_PKG_USING_TENSORFLOWLITEMICRO is not set
# CONFIG_PKG_USING_ELAPACK is not set
# CONFIG_PKG_USING_ULAPACK is not set
# CONFIG_PKG_USING_QUEST is not set
# CONFIG_PKG_USING_NAXOS is not set
#
# miscellaneous packages
...
...
@@ -337,13 +505,18 @@ CONFIG_RT_USING_PIN=y
# CONFIG_PKG_USING_FASTLZ is not set
# CONFIG_PKG_USING_MINILZO is not set
# CONFIG_PKG_USING_QUICKLZ is not set
# CONFIG_PKG_USING_LZMA is not set
# CONFIG_PKG_USING_MULTIBUTTON is not set
# CONFIG_PKG_USING_FLEXIBLE_BUTTON is not set
# CONFIG_PKG_USING_CANFESTIVAL is not set
# CONFIG_PKG_USING_ZLIB is not set
# CONFIG_PKG_USING_MINIZIP is not set
# CONFIG_PKG_USING_DSTR is not set
# CONFIG_PKG_USING_TINYFRAME is not set
# CONFIG_PKG_USING_KENDRYTE_DEMO is not set
# CONFIG_PKG_USING_DIGITALCTRL is not set
# CONFIG_PKG_USING_UPACKER is not set
# CONFIG_PKG_USING_UPARAM is not set
#
# samples: kernel and components samples
...
...
@@ -354,7 +527,25 @@ CONFIG_RT_USING_PIN=y
# CONFIG_PKG_USING_PERIPHERAL_SAMPLES is not set
# CONFIG_PKG_USING_HELLO is not set
# CONFIG_PKG_USING_VI is not set
# CONFIG_PKG_USING_NNOM is not set
# CONFIG_PKG_USING_KI is not set
# CONFIG_PKG_USING_ARMv7M_DWT is not set
# CONFIG_PKG_USING_VT100 is not set
# CONFIG_PKG_USING_UKAL is not set
# CONFIG_PKG_USING_CRCLIB is not set
#
# entertainment: terminal games and other interesting software packages
#
# CONFIG_PKG_USING_THREES is not set
# CONFIG_PKG_USING_2048 is not set
# CONFIG_PKG_USING_SNAKE is not set
# CONFIG_PKG_USING_TETRIS is not set
# CONFIG_PKG_USING_DONUT is not set
# CONFIG_PKG_USING_ACLOCK is not set
# CONFIG_PKG_USING_LWGPS is not set
# CONFIG_PKG_USING_STATE_MACHINE is not set
# CONFIG_PKG_USING_MCURSES is not set
# CONFIG_PKG_USING_COWSAY is not set
CONFIG_SOC_FAMILY_STM32
=
y
CONFIG_SOC_SERIES_STM32F4
=
y
...
...
@@ -369,11 +560,12 @@ CONFIG_SOC_STM32F407ZG=y
CONFIG_BSP_USING_USB_TO_USART
=
y
# CONFIG_BSP_USING_COM2 is not set
# CONFIG_BSP_USING_COM3 is not set
# CONFIG_BSP_USING_SRAM is not set
# CONFIG_BSP_USING_SPI_FLASH is not set
# CONFIG_BSP_USING_EEPROM is not set
# CONFIG_BSP_USING_ETH is not set
# CONFIG_BSP_USING_MPU6050 is not set
# CONFIG_BSP_USING_
SDCARD
is not set
# CONFIG_BSP_USING_
FS
is not set
#
# On-chip Peripheral Drivers
...
...
@@ -394,9 +586,17 @@ CONFIG_BSP_USING_UART1=y
# CONFIG_BSP_USING_SPI is not set
# CONFIG_BSP_USING_ADC is not set
# CONFIG_BSP_USING_I2C1 is not set
# CONFIG_BSP_USING_DAC is not set
# CONFIG_BSP_USING_ONCHIP_RTC is not set
# CONFIG_BSP_USING_WDT is not set
# CONFIG_BSP_USING_SDIO is not set
# CONFIG_BSP_USING_USBD is not set
# CONFIG_BSP_USING_USBH is not set
# CONFIG_BSP_USING_PULSE_ENCODER is not set
# CONFIG_BSP_USING_EXT_FMC_IO is not set
# CONFIG_BSP_USING_FMC is not set
# CONFIG_BSP_USING_RNG is not set
# CONFIG_BSP_USING_UDID is not set
#
# Board extended module Drivers
...
...
bsp/stm32/stm32f407-atk-explorer/board/Kconfig
浏览文件 @
b104bbc4
...
...
@@ -71,18 +71,27 @@ menu "Onboard Peripheral Drivers"
select BSP_USING_I2C1
select PKG_USING_MPU6XXX
config BSP_USING_SDCARD
bool "Enable SDCARD (sdio)"
select BSP_USING_SDIO
select RT_USING_DFS
select RT_USING_DFS_ELMFAT
default n
menu "Enable File System"
config BSP_USING_FS
bool
default n
config BSP_USING_SDCARD
bool "Enable SDCARD (FATFS)"
select BSP_USING_SDIO
select RT_USING_DFS
select RT_USING_DFS_ELMFAT
select RT_USING_DFS_ROMFS
select BSP_USING_FS
select RT_USING_SYSTEM_WORKQUEUE
default n
config SDIO_MAX_FREQ
int "sdio max freq"
range 0 24000000
depends on BSP_USING_SDCARD
default 1000000
config SDIO_MAX_FREQ
int "sdio max freq"
range 0 24000000
depends on BSP_USING_SDCARD
default 1000000
endmenu
endmenu
...
...
bsp/stm32/stm32f407-atk-explorer/board/SConscript
浏览文件 @
b104bbc4
...
...
@@ -18,8 +18,8 @@ if GetDepend(['BSP_USING_ETH']):
if
GetDepend
([
'BSP_USING_SPI_FLASH'
]):
src
+=
Glob
(
'ports/spi_flash_init.c'
)
if
GetDepend
([
'BSP_USING_
SDCARD
'
]):
src
+=
Glob
(
'ports/drv_
sdcard
.c'
)
if
GetDepend
([
'BSP_USING_
FS
'
]):
src
+=
Glob
(
'ports/drv_
filesystem
.c'
)
if
GetDepend
([
'BSP_USING_SRAM'
]):
src
+=
Glob
(
'ports/drv_sram.c'
)
...
...
bsp/stm32/stm32f407-atk-explorer/board/ports/drv_
sdcard
.c
→
bsp/stm32/stm32f407-atk-explorer/board/ports/drv_
filesystem
.c
浏览文件 @
b104bbc4
...
...
@@ -7,20 +7,28 @@
* Date Author Notes
* 2018-12-13 balanceTWK add sdcard port file
* 2021-05-10 Meco Man fix a bug that cannot use fatfs in the main thread at starting up
* 2021-07-28 Meco Man implement romfs as the root filesystem
*/
#include <rtthread.h>
#ifdef BSP_USING_SDCARD
#include <dfs_elm.h>
#ifdef BSP_USING_FS
#include <dfs_romfs.h>
#include <dfs_fs.h>
#include <dfs_posix.h>
#define DBG_TAG "app.card"
#if DFS_FILESYSTEMS_MAX < 4
#error "Please define DFS_FILESYSTEMS_MAX more than 4"
#endif
#if DFS_FILESYSTEM_TYPES_MAX < 4
#error "Please define DFS_FILESYSTEM_TYPES_MAX more than 4"
#endif
#define DBG_TAG "app.filesystem"
#define DBG_LVL DBG_INFO
#include <rtdbg.h>
#ifdef BSP_USING_SDCARD
static
void
sd_mount
(
void
*
parameter
)
{
while
(
1
)
...
...
@@ -28,14 +36,14 @@ static void sd_mount(void *parameter)
rt_thread_mdelay
(
500
);
if
(
rt_device_find
(
"sd0"
)
!=
RT_NULL
)
{
if
(
dfs_mount
(
"sd0"
,
"/"
,
"elm"
,
0
,
0
)
==
RT_EOK
)
if
(
dfs_mount
(
"sd0"
,
"/
sdcard
"
,
"elm"
,
0
,
0
)
==
RT_EOK
)
{
LOG_I
(
"sd card mount to '/'"
);
LOG_I
(
"sd card mount to '/
sdcard
'"
);
break
;
}
else
{
LOG_W
(
"sd card mount to '/' failed!"
);
LOG_W
(
"sd card mount to '/
sdcard
' failed!"
);
}
}
}
...
...
@@ -45,9 +53,9 @@ static int onboard_sdcard_mount(void)
{
rt_thread_t
tid
;
if
(
dfs_mount
(
"sd0"
,
"/"
,
"elm"
,
0
,
0
)
==
RT_EOK
)
if
(
dfs_mount
(
"sd0"
,
"/
sdcard
"
,
"elm"
,
0
,
0
)
==
RT_EOK
)
{
LOG_I
(
"sd card mount to '/'"
);
LOG_I
(
"sd card mount to '/
sdcard
'"
);
}
else
{
...
...
@@ -65,6 +73,33 @@ static int onboard_sdcard_mount(void)
return
RT_EOK
;
}
INIT_APP_EXPORT
(
onboard_sdcard_mount
);
#endif
static
const
struct
romfs_dirent
_romfs_root
[]
=
{
#ifdef BSP_USING_SDCARD
{
ROMFS_DIRENT_DIR
,
"sdcard"
,
RT_NULL
,
0
},
#endif
// {ROMFS_DIRENT_DIR, "flash", RT_NULL, 0},
};
const
struct
romfs_dirent
romfs_root
=
{
ROMFS_DIRENT_DIR
,
"/"
,
(
rt_uint8_t
*
)
_romfs_root
,
sizeof
(
_romfs_root
)
/
sizeof
(
_romfs_root
[
0
])
};
static
int
filesystem_mount
(
void
)
{
if
(
dfs_mount
(
RT_NULL
,
"/"
,
"rom"
,
0
,
&
(
romfs_root
))
!=
0
)
{
LOG_E
(
"rom mount to '/' failed!"
);
}
#ifdef BSP_USING_SDCARD
onboard_sdcard_mount
();
#endif
return
RT_EOK
;
}
INIT_APP_EXPORT
(
filesystem_mount
);
#endif
/* BSP_USING_
SDCARD
*/
#endif
/* BSP_USING_
FS
*/
bsp/stm32/stm32f407-atk-explorer/rtconfig.h
浏览文件 @
b104bbc4
...
...
@@ -16,6 +16,9 @@
#define RT_USING_IDLE_HOOK
#define RT_IDLE_HOOK_LIST_SIZE 4
#define IDLE_THREAD_STACK_SIZE 1024
/* kservice optimization */
#define RT_DEBUG
#define RT_DEBUG_COLOR
...
...
@@ -39,7 +42,7 @@
#define RT_USING_CONSOLE
#define RT_CONSOLEBUF_SIZE 128
#define RT_CONSOLE_DEVICE_NAME "uart1"
#define RT_VER_NUM 0x4000
2
#define RT_VER_NUM 0x4000
4
#define ARCH_ARM
#define RT_USING_CPU_FFS
#define ARCH_ARM_CORTEX_M
...
...
@@ -79,21 +82,18 @@
#define RT_USING_DEVICE_IPC
#define RT_PIPE_BUFSZ 512
#define RT_USING_SERIAL
#define RT_USING_SERIAL_V1
#define RT_SERIAL_USING_DMA
#define RT_SERIAL_RB_BUFSZ 64
#define RT_USING_PIN
/* Using Hardware Crypto drivers */
/* Using WiFi */
/* Using USB */
/* POSIX layer and C standard library */
#define RT_LIBC_USING_TIME
#define RT_LIBC_DEFAULT_TIMEZONE 8
/* Network */
...
...
@@ -106,9 +106,6 @@
/* light weight TCP/IP stack */
/* Modbus master and slave stack */
/* AT commands */
...
...
@@ -118,6 +115,9 @@
/* Utilities */
/* RT-Thread Utestcases */
/* RT-Thread online packages */
/* IoT - internet of things */
...
...
@@ -149,14 +149,23 @@
/* system packages */
/* Micrium: Micrium software products porting for RT-Thread */
/* peripheral libraries and drivers */
/* AI packages */
/* miscellaneous packages */
/* samples: kernel and components samples */
/* entertainment: terminal games and other interesting software packages */
#define SOC_FAMILY_STM32
#define SOC_SERIES_STM32F4
...
...
components/dfs/include/dfs_select.h
浏览文件 @
b104bbc4
...
...
@@ -10,7 +10,7 @@
#ifndef DFS_SELECT_H__
#define DFS_SELECT_H__
#include <
libc/libc_fdse
t.h>
#include <
sys/selec
t.h>
#ifdef __cplusplus
extern
"C"
{
...
...
components/drivers/include/drivers/mmcsd_core.h
浏览文件 @
b104bbc4
...
...
@@ -234,7 +234,6 @@ struct rt_mmcsd_host *mmcsd_alloc_host(void);
void
mmcsd_free_host
(
struct
rt_mmcsd_host
*
host
);
int
rt_mmcsd_core_init
(
void
);
int
rt_mmcsd_blk_init
(
void
);
rt_int32_t
rt_mmcsd_blk_probe
(
struct
rt_mmcsd_card
*
card
);
void
rt_mmcsd_blk_remove
(
struct
rt_mmcsd_card
*
card
);
...
...
components/drivers/include/drivers/rtc.h
浏览文件 @
b104bbc4
...
...
@@ -6,13 +6,43 @@
* Change Logs:
* Date Author Notes
* 2012-10-10 aozima first version.
* 2021-06-11 iysheng implement RTC framework V2.0
* 2021-07-30 Meco Man move rtc_core.h to rtc.h
*/
#ifndef __RTC_H__
#define __RTC_H__
#include <rtconfig.h>
#include <drivers/rtc_core.h>
#include <rtdef.h>
#define RT_DEVICE_CTRL_RTC_GET_TIME 0x10
/**< get second time */
#define RT_DEVICE_CTRL_RTC_SET_TIME 0x11
/**< set second time */
#define RT_DEVICE_CTRL_RTC_GET_TIME_US 0x12
/**< get microsecond time */
#define RT_DEVICE_CTRL_RTC_SET_TIME_US 0x13
/**< set microsecond time */
#define RT_DEVICE_CTRL_RTC_GET_ALARM 0x14
/**< get alarm */
#define RT_DEVICE_CTRL_RTC_SET_ALARM 0x15
/**< set alarm */
struct
rt_rtc_ops
{
rt_err_t
(
*
init
)(
void
);
rt_err_t
(
*
get_secs
)(
void
*
arg
);
rt_err_t
(
*
set_secs
)(
void
*
arg
);
rt_err_t
(
*
get_alarm
)(
void
*
arg
);
rt_err_t
(
*
set_alarm
)(
void
*
arg
);
rt_err_t
(
*
get_usecs
)(
void
*
arg
);
rt_err_t
(
*
set_usecs
)(
void
*
arg
);
};
typedef
struct
rt_rtc_device
{
struct
rt_device
parent
;
const
struct
rt_rtc_ops
*
ops
;
}
rt_rtc_dev_t
;
rt_err_t
rt_hw_rtc_register
(
rt_rtc_dev_t
*
rtc
,
const
char
*
name
,
rt_uint32_t
flag
,
void
*
data
);
rt_err_t
set_date
(
rt_uint32_t
year
,
rt_uint32_t
month
,
rt_uint32_t
day
);
rt_err_t
set_time
(
rt_uint32_t
hour
,
rt_uint32_t
minute
,
rt_uint32_t
second
);
...
...
components/drivers/include/drivers/rtc_core.h
已删除
100644 → 0
浏览文件 @
eb29bb53
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2021-06-11 iysheng first version.
*/
#ifndef __RTC_CORE_H__
#define __RTC_CORE_H__
#include <rtthread.h>
#define RT_DEVICE_CTRL_RTC_GET_TIME 0x10
/**< get second time */
#define RT_DEVICE_CTRL_RTC_SET_TIME 0x11
/**< set second time */
#define RT_DEVICE_CTRL_RTC_GET_TIME_US 0x12
/**< get microsecond time */
#define RT_DEVICE_CTRL_RTC_SET_TIME_US 0x13
/**< set microsecond time */
#define RT_DEVICE_CTRL_RTC_GET_ALARM 0x14
/**< get alarm */
#define RT_DEVICE_CTRL_RTC_SET_ALARM 0x15
/**< set alarm */
struct
rt_rtc_ops
{
rt_err_t
(
*
init
)(
void
);
rt_err_t
(
*
get_secs
)(
void
*
arg
);
rt_err_t
(
*
set_secs
)(
void
*
arg
);
rt_err_t
(
*
get_alarm
)(
void
*
arg
);
rt_err_t
(
*
set_alarm
)(
void
*
arg
);
rt_err_t
(
*
get_usecs
)(
void
*
arg
);
rt_err_t
(
*
set_usecs
)(
void
*
arg
);
};
typedef
struct
rt_rtc_device
{
struct
rt_device
parent
;
const
struct
rt_rtc_ops
*
ops
;
}
rt_rtc_dev_t
;
rt_err_t
rt_rtc_dev_register
(
rt_rtc_dev_t
*
rtc
,
const
char
*
name
,
rt_uint32_t
flag
,
void
*
data
);
#endif
/* __RTC_CORE_H__ */
components/drivers/include/ipc/workqueue.h
浏览文件 @
b104bbc4
...
...
@@ -69,7 +69,7 @@ rt_err_t rt_workqueue_critical_work(struct rt_workqueue *queue, struct rt_work *
#ifdef RT_USING_SYSTEM_WORKQUEUE
rt_err_t
rt_work_submit
(
struct
rt_work
*
work
,
rt_tick_t
time
);
rt_err_t
rt_work_cancel
(
struct
rt_work
*
work
);
#endif
#endif
/* RT_USING_SYSTEM_WORKQUEUE */
rt_inline
void
rt_work_init
(
struct
rt_work
*
work
,
void
(
*
work_func
)(
struct
rt_work
*
work
,
void
*
work_data
),
void
*
work_data
)
...
...
@@ -85,7 +85,6 @@ rt_inline void rt_work_init(struct rt_work *work, void (*work_func)(struct rt_wo
void
rt_delayed_work_init
(
struct
rt_delayed_work
*
work
,
void
(
*
work_func
)(
struct
rt_work
*
work
,
void
*
work_data
),
void
*
work_data
);
int
rt_work_sys_workqueue_init
(
void
);
#endif
#endif
/* RT_USING_HEAP */
#endif
components/drivers/rtc/SConscript
浏览文件 @
b104bbc4
...
...
@@ -7,7 +7,7 @@ CPPPATH = [cwd + '/../include']
group
=
[]
if
GetDepend
([
'RT_USING_RTC'
]):
src
=
src
+
[
'rtc.c'
,
'rtc_core.c'
]
src
=
src
+
[
'rtc.c'
]
if
GetDepend
([
'RT_USING_ALARM'
]):
src
=
src
+
[
'alarm.c'
]
if
GetDepend
([
'RT_USING_SOFT_RTC'
]):
...
...
components/drivers/rtc/rtc.c
浏览文件 @
b104bbc4
...
...
@@ -10,6 +10,8 @@
* 2012-04-16 aozima add scheduler lock for set_date and set_time.
* 2018-02-16 armink add auto sync time by NTP
* 2021-05-09 Meco Man remove NTP
* 2021-06-11 iysheng implement RTC framework V2.0
* 2021-07-30 Meco Man move rtc_core.c to rtc.c
*/
#include <time.h>
...
...
@@ -20,7 +22,117 @@
#ifdef RT_USING_RTC
/*
* This function initializes rtc_core
*/
static
rt_err_t
rt_rtc_init
(
struct
rt_device
*
dev
)
{
rt_rtc_dev_t
*
rtc_core
;
RT_ASSERT
(
dev
!=
RT_NULL
);
rtc_core
=
(
rt_rtc_dev_t
*
)
dev
;
if
(
rtc_core
->
ops
->
init
)
{
return
(
rtc_core
->
ops
->
init
());
}
return
-
RT_ENOSYS
;
}
static
rt_err_t
rt_rtc_open
(
struct
rt_device
*
dev
,
rt_uint16_t
oflag
)
{
return
RT_EOK
;
}
static
rt_err_t
rt_rtc_close
(
struct
rt_device
*
dev
)
{
/* Add close member function in rt_rtc_ops when need,
* then call that function here.
* */
return
RT_EOK
;
}
static
rt_err_t
rt_rtc_control
(
struct
rt_device
*
dev
,
int
cmd
,
void
*
args
)
{
#define TRY_DO_RTC_FUNC(rt_rtc_dev, func_name, args) \
rt_rtc_dev->ops->func_name ? rt_rtc_dev->ops->func_name(args) : -RT_EINVAL;
rt_rtc_dev_t
*
rtc_device
;
rt_err_t
ret
=
-
RT_EINVAL
;
RT_ASSERT
(
dev
!=
RT_NULL
);
rtc_device
=
(
rt_rtc_dev_t
*
)
dev
;
switch
(
cmd
)
{
case
RT_DEVICE_CTRL_RTC_GET_TIME
:
ret
=
TRY_DO_RTC_FUNC
(
rtc_device
,
get_secs
,
args
);
break
;
case
RT_DEVICE_CTRL_RTC_SET_TIME
:
ret
=
TRY_DO_RTC_FUNC
(
rtc_device
,
set_secs
,
args
);
break
;
case
RT_DEVICE_CTRL_RTC_GET_TIME_US
:
ret
=
TRY_DO_RTC_FUNC
(
rtc_device
,
get_usecs
,
args
);
break
;
case
RT_DEVICE_CTRL_RTC_SET_TIME_US
:
ret
=
TRY_DO_RTC_FUNC
(
rtc_device
,
set_usecs
,
args
);
break
;
case
RT_DEVICE_CTRL_RTC_GET_ALARM
:
ret
=
TRY_DO_RTC_FUNC
(
rtc_device
,
get_alarm
,
args
);
break
;
case
RT_DEVICE_CTRL_RTC_SET_ALARM
:
ret
=
TRY_DO_RTC_FUNC
(
rtc_device
,
set_alarm
,
args
);
break
;
default:
break
;
}
return
ret
;
#undef TRY_DO_RTC_FUNC
}
#ifdef RT_USING_DEVICE_OPS
const
static
struct
rt_device_ops
rtc_core_ops
=
{
rt_rtc_init
,
rt_rtc_open
,
rt_rtc_close
,
RT_NULL
,
RT_NULL
,
rt_rtc_control
,
};
#endif
/* RT_USING_DEVICE_OPS */
rt_err_t
rt_hw_rtc_register
(
rt_rtc_dev_t
*
rtc
,
const
char
*
name
,
rt_uint32_t
flag
,
void
*
data
)
{
struct
rt_device
*
device
;
RT_ASSERT
(
rtc
!=
RT_NULL
);
device
=
&
(
rtc
->
parent
);
device
->
type
=
RT_Device_Class_RTC
;
device
->
rx_indicate
=
RT_NULL
;
device
->
tx_complete
=
RT_NULL
;
#ifdef RT_USING_DEVICE_OPS
device
->
ops
=
&
rtc_core_ops
;
#else
device
->
init
=
rt_rtc_init
;
device
->
open
=
rt_rtc_open
;
device
->
close
=
rt_rtc_close
;
device
->
read
=
RT_NULL
;
device
->
write
=
RT_NULL
;
device
->
control
=
rt_rtc_control
;
#endif
/* RT_USING_DEVICE_OPS */
device
->
user_data
=
data
;
/* register a character device */
return
rt_device_register
(
device
,
name
,
flag
);
}
/**
* Set system date(time not modify, local timezone).
...
...
@@ -30,12 +142,10 @@
* @param rt_uint32_t day e.g: 31.
*
* @return rt_err_t if set success, return RT_EOK.
*
*/
rt_err_t
set_date
(
rt_uint32_t
year
,
rt_uint32_t
month
,
rt_uint32_t
day
)
{
time_t
now
;
struct
tm
*
p_tm
;
struct
tm
tm_new
;
rt_device_t
device
;
rt_err_t
ret
=
-
RT_ERROR
;
...
...
@@ -43,14 +153,8 @@ rt_err_t set_date(rt_uint32_t year, rt_uint32_t month, rt_uint32_t day)
/* get current time */
now
=
time
(
RT_NULL
);
/* lock scheduler. */
rt_enter_critical
();
/* converts calendar time into local time. */
p_tm
=
localtime
(
&
now
);
/* copy the statically located variable */
rt_memcpy
(
&
tm_new
,
p_tm
,
sizeof
(
struct
tm
));
/* unlock scheduler. */
rt_exit_critical
();
localtime_r
(
&
now
,
&
tm_new
);
/* update date. */
tm_new
.
tm_year
=
year
-
1900
;
...
...
@@ -80,12 +184,10 @@ rt_err_t set_date(rt_uint32_t year, rt_uint32_t month, rt_uint32_t day)
* @param rt_uint32_t second e.g: 0~59.
*
* @return rt_err_t if set success, return RT_EOK.
*
*/
rt_err_t
set_time
(
rt_uint32_t
hour
,
rt_uint32_t
minute
,
rt_uint32_t
second
)
{
time_t
now
;
struct
tm
*
p_tm
;
struct
tm
tm_new
;
rt_device_t
device
;
rt_err_t
ret
=
-
RT_ERROR
;
...
...
@@ -93,14 +195,8 @@ rt_err_t set_time(rt_uint32_t hour, rt_uint32_t minute, rt_uint32_t second)
/* get current time */
now
=
time
(
RT_NULL
);
/* lock scheduler. */
rt_enter_critical
();
/* converts calendar time into local time. */
p_tm
=
localtime
(
&
now
);
/* copy the statically located variable */
rt_memcpy
(
&
tm_new
,
p_tm
,
sizeof
(
struct
tm
));
/* unlock scheduler. */
rt_exit_critical
();
localtime_r
(
&
now
,
&
tm_new
);
/* update time. */
tm_new
.
tm_hour
=
hour
;
...
...
components/drivers/rtc/rtc_core.c
已删除
100644 → 0
浏览文件 @
eb29bb53
/*
* COPYRIGHT (C) 2011-2021, Real-Thread Information Technology Ltd
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2021-06-11 iysheng first version.
*/
#include <drivers/rtc_core.h>
#define TRY_DO_RTC_FUNC(rt_rtc_dev, func_name, args) \
rt_rtc_dev->ops->func_name ? rt_rtc_dev->ops->func_name(args) : -RT_EINVAL;
/*
* This function initializes rtc_core
*/
static
rt_err_t
rt_rtc_core_init
(
struct
rt_device
*
dev
)
{
rt_rtc_dev_t
*
rtc_core
;
RT_ASSERT
(
dev
!=
RT_NULL
);
rtc_core
=
(
rt_rtc_dev_t
*
)
dev
;
if
(
rtc_core
->
ops
->
init
)
{
return
(
rtc_core
->
ops
->
init
());
}
return
(
-
RT_ENOSYS
);
}
static
rt_err_t
rt_rtc_core_open
(
struct
rt_device
*
dev
,
rt_uint16_t
oflag
)
{
return
(
RT_EOK
);
}
static
rt_err_t
rt_rtc_core_close
(
struct
rt_device
*
dev
)
{
/* Add close member function in rt_rtc_ops when need,
* then call that function here.
* */
return
(
RT_EOK
);
}
static
rt_err_t
rt_rtc_core_control
(
struct
rt_device
*
dev
,
int
cmd
,
void
*
args
)
{
rt_rtc_dev_t
*
rtc_core
;
rt_err_t
ret
=
-
RT_EINVAL
;
RT_ASSERT
(
dev
!=
RT_NULL
);
rtc_core
=
(
rt_rtc_dev_t
*
)
dev
;
switch
(
cmd
)
{
case
RT_DEVICE_CTRL_RTC_GET_TIME
:
ret
=
TRY_DO_RTC_FUNC
(
rtc_core
,
get_secs
,
args
);
break
;
case
RT_DEVICE_CTRL_RTC_SET_TIME
:
ret
=
TRY_DO_RTC_FUNC
(
rtc_core
,
set_secs
,
args
);
break
;
case
RT_DEVICE_CTRL_RTC_GET_TIME_US
:
ret
=
TRY_DO_RTC_FUNC
(
rtc_core
,
get_usecs
,
args
);
break
;
case
RT_DEVICE_CTRL_RTC_SET_TIME_US
:
ret
=
TRY_DO_RTC_FUNC
(
rtc_core
,
set_usecs
,
args
);
break
;
case
RT_DEVICE_CTRL_RTC_GET_ALARM
:
ret
=
TRY_DO_RTC_FUNC
(
rtc_core
,
get_alarm
,
args
);
break
;
case
RT_DEVICE_CTRL_RTC_SET_ALARM
:
ret
=
TRY_DO_RTC_FUNC
(
rtc_core
,
set_alarm
,
args
);
break
;
default:
break
;
}
return
ret
;
}
#ifdef RT_USING_DEVICE_OPS
const
static
struct
rt_device_ops
rtc_core_ops
=
{
rt_rtc_core_init
,
rt_rtc_core_open
,
rt_rtc_core_close
,
RT_NULL
,
RT_NULL
,
rt_rtc_core_control
,
};
#endif
rt_err_t
rt_rtc_dev_register
(
rt_rtc_dev_t
*
rtc
,
const
char
*
name
,
rt_uint32_t
flag
,
void
*
data
)
{
struct
rt_device
*
device
;
RT_ASSERT
(
rtc
!=
RT_NULL
);
device
=
&
(
rtc
->
parent
);
device
->
type
=
RT_Device_Class_RTC
;
device
->
rx_indicate
=
RT_NULL
;
device
->
tx_complete
=
RT_NULL
;
#ifdef RT_USING_DEVICE_OPS
device
->
ops
=
&
rtc_core_ops
;
#else
device
->
init
=
rt_rtc_core_init
;
device
->
open
=
rt_rtc_core_open
;
device
->
close
=
rt_rtc_core_close
;
device
->
read
=
RT_NULL
;
device
->
write
=
RT_NULL
;
device
->
control
=
rt_rtc_core_control
;
#endif
device
->
user_data
=
data
;
/* register a character device */
return
rt_device_register
(
device
,
name
,
flag
);
}
components/drivers/sdio/block_dev.c
浏览文件 @
b104bbc4
...
...
@@ -515,15 +515,3 @@ void rt_mmcsd_blk_remove(struct rt_mmcsd_card *card)
}
}
}
/*
* This function will initialize block device on the mmc/sd.
*
* @deprecated since 2.1.0, this function does not need to be invoked
* in the system initialization.
*/
int
rt_mmcsd_blk_init
(
void
)
{
/* nothing */
return
0
;
}
components/drivers/src/ringbuffer.c
浏览文件 @
b104bbc4
...
...
@@ -8,6 +8,7 @@
* 2012-09-30 Bernard first version.
* 2013-05-08 Grissiom reimplement
* 2016-08-18 heyuanjie add interface
* 2021-07-20 arminker fix write_index bug in function rt_ringbuffer_put_force
*/
#include <rtthread.h>
...
...
@@ -138,7 +139,8 @@ rt_size_t rt_ringbuffer_put_force(struct rt_ringbuffer *rb,
if
(
length
>
space_length
)
{
rb
->
read_mirror
=
~
rb
->
read_mirror
;
if
(
rb
->
write_index
<=
rb
->
read_index
)
rb
->
read_mirror
=
~
rb
->
read_mirror
;
rb
->
read_index
=
rb
->
write_index
;
}
...
...
components/drivers/src/workqueue.c
浏览文件 @
b104bbc4
...
...
@@ -358,7 +358,7 @@ rt_err_t rt_work_cancel(struct rt_work *work)
return
rt_workqueue_cancel_work
(
sys_workq
,
work
);
}
int
rt_work_sys_workqueue_init
(
void
)
static
int
rt_work_sys_workqueue_init
(
void
)
{
if
(
sys_workq
!=
RT_NULL
)
return
RT_EOK
;
...
...
@@ -370,5 +370,5 @@ int rt_work_sys_workqueue_init(void)
return
RT_EOK
;
}
INIT_PREV_EXPORT
(
rt_work_sys_workqueue_init
);
#endif
#endif
#endif
/* RT_USING_SYSTEM_WORKQUEUE */
#endif
/* RT_USING_HEAP */
components/libc/Kconfig
浏览文件 @
b104bbc4
...
...
@@ -59,9 +59,9 @@ if RT_USING_LIBC != y
default y
endif
config RT_LIBC_
FIXED
_TIMEZONE
config RT_LIBC_
DEFAULT
_TIMEZONE
depends on (RT_LIBC_USING_TIME || RT_USING_LIBC)
int "
Manually set a fixed
time zone (UTC+)"
int "
Set the default
time zone (UTC+)"
range -12 12
default 8
...
...
components/libc/aio/posix_aio.c
浏览文件 @
b104bbc4
...
...
@@ -9,14 +9,8 @@
*/
#include <stdint.h>
#include <stdio.h>
#include <rthw.h>
#include <rtdevice.h>
#include <rtthread.h>
#include <dfs_posix.h>
#include "posix_aio.h"
struct
rt_workqueue
*
aio_queue
=
NULL
;
...
...
components/libc/aio/posix_aio.h
浏览文件 @
b104bbc4
...
...
@@ -11,6 +11,10 @@
#ifndef POSIX_AIO_H__
#define POSIX_AIO_H__
#include <stdio.h>
#include <sys/signal.h>
#include <rtdevice.h>
struct
aiocb
{
int
aio_fildes
;
/* File descriptor. */
...
...
components/libc/compilers/common/none-gcc/sys/errno.h
浏览文件 @
b104bbc4
...
...
@@ -7,8 +7,8 @@
* Date Author Notes
* 2021-05-22 Meco Man The first version.
*/
#ifndef _
SYS_ERRNO_H
#define _
SYS_ERRNO_H
#ifndef _
_SYS_ERRNO_H__
#define _
_SYS_ERRNO_H__
#if defined(__ARMCC_VERSION)
/*
...
...
components/libc/compilers/common/none-gcc/sys/stat.h
浏览文件 @
b104bbc4
...
...
@@ -6,3 +6,8 @@
* Change Logs:
* Date Author Notes
*/
#ifndef __SYS_STAT_H__
#define __SYS_STAT_H__
#endif
components/libc/compilers/common/none-gcc/sys/types.h
浏览文件 @
b104bbc4
...
...
@@ -8,8 +8,8 @@
* 2020-09-05 Meco Man fix bugs
* 2020-12-16 Meco Man add useconds_t
*/
#ifndef __TYPES_H__
#define __TYPES_H__
#ifndef __
SYS_
TYPES_H__
#define __
SYS_
TYPES_H__
#include <stdint.h>
...
...
components/libc/compilers/common/none-gcc/sys/unistd.h
浏览文件 @
b104bbc4
...
...
@@ -7,8 +7,8 @@
* Date Author Notes
* 2020-12-16 Meco Man add usleep
*/
#ifndef _
SYS_UNISTD_H
#define _
SYS_UNISTD_H
#ifndef _
_SYS_UNISTD_H__
#define _
_SYS_UNISTD_H__
#include <rtconfig.h>
#include "types.h"
...
...
include/libc/libc_fdse
t.h
→
components/libc/compilers/common/sys/selec
t.h
浏览文件 @
b104bbc4
...
...
@@ -5,56 +5,45 @@
*
* Change Logs:
* Date Author Notes
* 20
17-10-30 Bernard
The first version
* 20
21-07-21 Meco Man
The first version
*/
#ifndef
LIBC_FDSE
T_H__
#define
LIBC_FDSE
T_H__
#ifndef
__SYS_SELEC
T_H__
#define
__SYS_SELEC
T_H__
#include <rtconfig.h>
#if defined(RT_USING_NEWLIB) || defined(_WIN32) || (defined( __GNUC__ ) && !defined(__ARMCC_VERSION))
#include <sys/types.h>
#if defined(HAVE_SYS_SELECT_H)
#include <sys/select.h>
#endif
#else
#ifndef FD_SETSIZE
#define FD_SETSIZE 32
#endif
#ifdef SAL_USING_POSIX
#ifdef FD_SETSIZE
#undef FD_SETSIZE
#endif
#define FD_SETSIZE DFS_FD_MAX
#endif
# ifndef FD_SETSIZE
# define FD_SETSIZE 32
# endif
#endif
/* SAL_USING_POSIX */
#
define NBBY 8
/* number of bits in a byte */
#define NBBY 8
/* number of bits in a byte */
typedef
long
fd_mask
;
# define NFDBITS (sizeof (fd_mask) * NBBY)
/* bits per mask */
# ifndef howmany
# define howmany(x,y) (((x)+((y)-1))/(y))
# endif
/* We use a macro for fd_set so that including Sockets.h afterwards
can work. */
#define NFDBITS (sizeof (fd_mask) * NBBY)
/* bits per mask */
#ifndef howmany
#define howmany(x,y) (((x)+((y)-1))/(y))
#endif
#ifndef _SYS_TYPES_FD_SET
/* MIPS */
typedef
struct
_types_fd_set
{
fd_mask
fds_bits
[
howmany
(
FD_SETSIZE
,
NFDBITS
)];
}
_types_fd_set
;
#define fd_set _types_fd_set
# define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1L << ((n) % NFDBITS)))
# define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1L << ((n) % NFDBITS)))
# define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1L << ((n) % NFDBITS)))
# define FD_ZERO(p) memset((void*)(p), 0, sizeof(*(p)))
#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1L << ((n) % NFDBITS)))
#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1L << ((n) % NFDBITS)))
#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1L << ((n) % NFDBITS)))
#define FD_ZERO(p) memset((void*)(p), 0, sizeof(*(p)))
#endif
/* _SYS_TYPES_FD_SET */
#endif
#endif
#endif
/* __SYS_SELECT_H__ */
include/libc/libc_
signal.h
→
components/libc/compilers/common/sys/
signal.h
浏览文件 @
b104bbc4
...
...
@@ -6,33 +6,27 @@
* Change Logs:
* Date Author Notes
* 2017-09-12 Bernard The first version
* 2021-07-21 Meco Man move to libc/common
*/
#ifndef
LIBC
_SIGNAL_H__
#define
LIBC
_SIGNAL_H__
#ifndef
__SYS
_SIGNAL_H__
#define
__SYS
_SIGNAL_H__
#ifdef __cplusplus
extern
"C"
{
#endif
#include <stdint.h>
#ifdef HAVE_CCONFIG_H
#include <cconfig.h>
#endif
#ifndef HAVE_SIGVAL
/* Signal Generation and Delivery, P1003.1b-1993, p. 63
NOTE: P1003.1c/D10, p. 34 adds sigev_notify_function and
sigev_notify_attributes to the sigevent structure. */
union
sigval
{
int
sival_int
;
/* Integer signal value */
void
*
sival_ptr
;
/* Pointer signal value */
};
#endif
#ifndef HAVE_SIGEVENT
struct
sigevent
{
int
sigev_notify
;
/* Notification type */
...
...
@@ -42,9 +36,7 @@ struct sigevent
/* Notification function */
void
*
sigev_notify_attributes
;
/* Notification Attributes, really pthread_attr_t */
};
#endif
#ifndef HAVE_SIGINFO
struct
siginfo
{
uint16_t
si_signo
;
...
...
@@ -53,26 +45,37 @@ struct siginfo
union
sigval
si_value
;
};
typedef
struct
siginfo
siginfo_t
;
#endif
#define SI_USER 0x01
/* Signal sent by kill(). */
#define SI_QUEUE 0x02
/* Signal sent by sigqueue(). */
#define SI_TIMER 0x03
/* Signal generated by expiration of a
timer set by timer_settime(). */
#define SI_ASYNCIO 0x04
/* Signal generated by completion of an
asynchronous I/O request. */
#define SI_MESGQ 0x05
/* Signal generated by arrival of a
message on an empty message queue. */
#if !defined(RT_USING_NEWLIB)
#define SI_TIMER 0x03
/* Signal generated by expiration of a timer set by timer_settime(). */
#define SI_ASYNCIO 0x04
/* Signal generated by completion of an asynchronous I/O request. */
#define SI_MESGQ 0x05
/* Signal generated by arrival of a message on an empty message queue. */
typedef
void
(
*
_sig_func_ptr
)(
int
);
typedef
unsigned
long
sigset_t
;
#endif
#include <signal.h>
struct
sigaction
{
_sig_func_ptr
sa_handler
;
sigset_t
sa_mask
;
int
sa_flags
;
};
#ifdef __ARMCC_VERSION
#define SIG_SETMASK 0
/* set mask with sigprocmask() */
#define SIG_BLOCK 1
/* set of signals to block */
#define SIG_UNBLOCK 2
/* set of signals to, well, unblock */
#define sigaddset(what,sig) (*(what) |= (1<<(sig)), 0)
#define sigdelset(what,sig) (*(what) &= ~(1<<(sig)), 0)
#define sigemptyset(what) (*(what) = 0, 0)
#define sigfillset(what) (*(what) = ~(0), 0)
#define sigismember(what,sig) (((*(what)) & (1<<(sig))) != 0)
int
sigprocmask
(
int
how
,
const
sigset_t
*
set
,
sigset_t
*
oset
);
int
sigaction
(
int
signum
,
const
struct
sigaction
*
act
,
struct
sigaction
*
oldact
);
#ifdef __ARMCC_VERSION
#define SIGHUP 1
/* #define SIGINT 2 */
#define SIGQUIT 3
...
...
@@ -103,28 +106,9 @@ typedef unsigned long sigset_t;
#define SIGRTMAX 31
#define NSIG 32
#define SIG_SETMASK 0
/* set mask with sigprocmask() */
#define SIG_BLOCK 1
/* set of signals to block */
#define SIG_UNBLOCK 2
/* set of signals to, well, unblock */
struct
sigaction
{
_sig_func_ptr
sa_handler
;
sigset_t
sa_mask
;
int
sa_flags
;
};
#define sigaddset(what,sig) (*(what) |= (1<<(sig)), 0)
#define sigdelset(what,sig) (*(what) &= ~(1<<(sig)), 0)
#define sigemptyset(what) (*(what) = 0, 0)
#define sigfillset(what) (*(what) = ~(0), 0)
#define sigismember(what,sig) (((*(what)) & (1<<(sig))) != 0)
int
sigprocmask
(
int
how
,
const
sigset_t
*
set
,
sigset_t
*
oset
);
int
sigaction
(
int
signum
,
const
struct
sigaction
*
act
,
struct
sigaction
*
oldact
);
#include <signal.h>
#elif defined(__IAR_SYSTEMS_ICC__)
#define SIGHUP 1
#define SIGINT 2
#define SIGQUIT 3
...
...
@@ -155,25 +139,51 @@ int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact)
#define SIGRTMAX 31
#define NSIG 32
#define SIG_SETMASK 0
/* set mask with sigprocmask() */
#define SIG_BLOCK 1
/* set of signals to block */
#define SIG_UNBLOCK 2
/* set of signals to, well, unblock */
struct
sigaction
{
_sig_func_ptr
sa_handler
;
sigset_t
sa_mask
;
int
sa_flags
;
};
#include <signal.h>
#define sigaddset(what,sig) (*(what) |= (1<<(sig)), 0)
#define sigdelset(what,sig) (*(what) &= ~(1<<(sig)), 0)
#define sigemptyset(what) (*(what) = 0, 0)
#define sigfillset(what) (*(what) = ~(0), 0)
#define sigismember(what,sig) (((*(what)) & (1<<(sig))) != 0)
#elif defined(__GNUC__)
#define SIGHUP 1
/* hangup */
#define SIGINT 2
/* interrupt */
#define SIGQUIT 3
/* quit */
#define SIGILL 4
/* illegal instruction (not reset when caught) */
#define SIGTRAP 5
/* trace trap (not reset when caught) */
#define SIGIOT 6
/* IOT instruction */
#define SIGABRT 6
/* used by abort, replace SIGIOT in the future */
#define SIGEMT 7
/* EMT instruction */
#define SIGFPE 8
/* floating point exception */
#define SIGKILL 9
/* kill (cannot be caught or ignored) */
#define SIGBUS 10
/* bus error */
#define SIGSEGV 11
/* segmentation violation */
#define SIGSYS 12
/* bad argument to system call */
#define SIGPIPE 13
/* write on a pipe with no one to read it */
#define SIGALRM 14
/* alarm clock */
#define SIGTERM 15
/* software termination signal from kill */
#define SIGURG 16
/* urgent condition on IO channel */
#define SIGSTOP 17
/* sendable stop signal not from tty */
#define SIGTSTP 18
/* stop signal from tty */
#define SIGCONT 19
/* continue a stopped process */
#define SIGCHLD 20
/* to parent on child stop or exit */
#define SIGCLD 20
/* System V name for SIGCHLD */
#define SIGTTIN 21
/* to readers pgrp upon background tty read */
#define SIGTTOU 22
/* like TTIN for output if (tp->t_local<OSTOP) */
#define SIGIO 23
/* input/output possible signal */
#define SIGPOLL SIGIO
/* System V name for SIGIO */
#define SIGXCPU 24
/* exceeded CPU time limit */
#define SIGXFSZ 25
/* exceeded file size limit */
#define SIGVTALRM 26
/* virtual time alarm */
#define SIGPROF 27
/* profiling time alarm */
#define SIGWINCH 28
/* window changed */
#define SIGLOST 29
/* resource lost (eg, record-lock lost) */
#define SIGUSR1 30
/* user defined signal 1 */
#define SIGUSR2 31
/* user defined signal 2 */
#define NSIG 32
/* signal 0 implied */
#ifndef _SIGNAL_H_
/* Some applications take advantage of the fact that <sys/signal.h>
* and <signal.h> are equivalent in glibc. Allow for that here. */
#include <signal.h>
#endif
int
sigprocmask
(
int
how
,
const
sigset_t
*
set
,
sigset_t
*
oset
);
int
sigaction
(
int
signum
,
const
struct
sigaction
*
act
,
struct
sigaction
*
oldact
);
#endif
#ifdef __cplusplus
...
...
components/libc/compilers/common/sys/time.h
浏览文件 @
b104bbc4
...
...
@@ -12,12 +12,14 @@
#define _SYS_TIME_H_
#include <rtconfig.h>
#include <rtdef.h>
#include <time.h>
#ifdef __cplusplus
extern
"C"
{
#endif
/* timezone */
#define DST_NONE 0
/* not on dst */
#define DST_USA 1
/* USA style dst */
#define DST_AUST 2
/* Australian style dst */
...
...
@@ -30,12 +32,21 @@ extern "C" {
#define DST_TUR 9
/* Turkey */
#define DST_AUSTALT 10
/* Australian style with shift in 1986 */
#ifndef _TIMEVAL_DEFINED
#define _TIMEVAL_DEFINED
struct
timezone
{
int
tz_minuteswest
;
/* minutes west of Greenwich */
int
tz_dsttime
;
/* type of dst correction */
};
void
rt_tz_set
(
rt_int8_t
tz
);
rt_int8_t
rt_tz_get
(
void
);
rt_int8_t
rt_tz_is_dst
(
void
);
/*
* Structure returned by gettimeofday(2) system call,
* and used in other calls.
*/
#ifndef _TIMEVAL_DEFINED
#define _TIMEVAL_DEFINED
#if !(defined(_WIN32))
struct
timeval
{
long
tv_sec
;
/* seconds */
...
...
@@ -44,18 +55,6 @@ struct timeval {
#endif
#endif
/* _TIMEVAL_DEFINED */
#if !(defined(__GNUC__) && !defined(__ARMCC_VERSION)
/*GCC*/
) && !(defined(__ICCARM__) && (__VER__ >= 8010001)) && !defined(_WIN32)
struct
timespec
{
time_t
tv_sec
;
/* seconds */
long
tv_nsec
;
/* and nanoseconds */
};
#endif
struct
timezone
{
int
tz_minuteswest
;
/* minutes west of Greenwich */
int
tz_dsttime
;
/* type of dst correction */
};
int
stime
(
const
time_t
*
t
);
time_t
timegm
(
struct
tm
*
const
t
);
int
gettimeofday
(
struct
timeval
*
tv
,
struct
timezone
*
tz
);
...
...
@@ -66,6 +65,14 @@ struct tm *gmtime_r(const time_t *timep, struct tm *r);
#ifdef RT_USING_POSIX
#include <sys/types.h>
#if !(defined(__GNUC__) && !defined(__ARMCC_VERSION)
/*GCC*/
) && !(defined(__ICCARM__) && (__VER__ >= 8010001)) && !defined(_WIN32)
struct
timespec
{
time_t
tv_sec
;
/* seconds */
long
tv_nsec
;
/* and nanoseconds */
};
#endif
/* posix clock and timer */
#define MILLISECOND_PER_SECOND 1000UL
#define MICROSECOND_PER_SECOND 1000000UL
...
...
@@ -95,7 +102,7 @@ struct tm *gmtime_r(const time_t *timep, struct tm *r);
int
clock_getres
(
clockid_t
clockid
,
struct
timespec
*
res
);
int
clock_gettime
(
clockid_t
clockid
,
struct
timespec
*
tp
);
int
clock_settime
(
clockid_t
clockid
,
const
struct
timespec
*
tp
);
int
clock_time
_to_tick
(
const
struct
timespec
*
time
);
int
rt_timespec
_to_tick
(
const
struct
timespec
*
time
);
#endif
/* RT_USING_POSIX */
#ifdef __cplusplus
...
...
components/libc/compilers/common/time.c
浏览文件 @
b104bbc4
...
...
@@ -18,12 +18,13 @@
* 2021-02-12 Meco Man move all of the functions located in <clock_time.c> to this file
* 2021-03-15 Meco Man fixed a bug of leaking memory in asctime()
* 2021-05-01 Meco Man support fixed timezone
* 2021-07-21 Meco Man implement that change/set timezone APIs
*/
#include "sys/time.h"
#include <sys/errno.h>
#include <rtthread.h>
#include <rthw.h>
#ifdef RT_USING_DEVICE
#include <rtdevice.h>
#endif
...
...
@@ -32,10 +33,6 @@
#define DBG_LVL DBG_INFO
#include <rtdbg.h>
#ifndef RT_LIBC_FIXED_TIMEZONE
#define RT_LIBC_FIXED_TIMEZONE 8
/* UTC+8 */
#endif
/* seconds per day */
#define SPD 24*60*60
...
...
@@ -202,7 +199,7 @@ struct tm *gmtime_r(const time_t *timep, struct tm *r)
r
->
tm_mon
=
i
;
r
->
tm_mday
+=
work
-
__spm
[
i
];
r
->
tm_isdst
=
0
;
r
->
tm_isdst
=
rt_tz_is_dst
()
;
return
r
;
}
RTM_EXPORT
(
gmtime_r
);
...
...
@@ -218,7 +215,7 @@ struct tm* localtime_r(const time_t* t, struct tm* r)
{
time_t
local_tz
;
local_tz
=
*
t
+
RT_LIBC_FIXED_TIMEZONE
*
3600
;
local_tz
=
*
t
+
rt_tz_get
()
*
3600
;
return
gmtime_r
(
&
local_tz
,
r
);
}
RTM_EXPORT
(
localtime_r
);
...
...
@@ -235,7 +232,7 @@ time_t mktime(struct tm * const t)
time_t
timestamp
;
timestamp
=
timegm
(
t
);
timestamp
=
timestamp
-
3600
*
RT_LIBC_FIXED_TIMEZONE
;
timestamp
=
timestamp
-
3600
*
rt_tz_get
()
;
return
timestamp
;
}
RTM_EXPORT
(
mktime
);
...
...
@@ -426,7 +423,7 @@ int gettimeofday(struct timeval *tv, struct timezone *tz)
if
(
tz
!=
RT_NULL
)
{
tz
->
tz_dsttime
=
DST_NONE
;
tz
->
tz_minuteswest
=
-
(
RT_LIBC_FIXED_TIMEZONE
*
60
);
tz
->
tz_minuteswest
=
-
(
rt_tz_get
()
*
60
);
}
if
(
tv
!=
RT_NULL
&&
get_timeval
(
tv
)
==
RT_EOK
)
...
...
@@ -468,38 +465,47 @@ RTM_EXPORT(difftime);
RTM_EXPORT
(
strftime
);
#ifdef RT_USING_POSIX
static
struct
timeval
_timevalue
;
static
int
clock_time_system_init
()
#ifdef RT_USING_RTC
static
volatile
struct
timeval
_timevalue
;
static
int
_rt_clock_time_system_init
()
{
time_t
time
;
register
rt_base_t
level
;
time_t
time
=
0
;
rt_tick_t
tick
;
rt_device_t
device
;
time
=
0
;
#ifdef RT_USING_RTC
device
=
rt_device_find
(
"rtc"
);
if
(
device
!=
RT_NULL
)
{
/* get realtime seconds */
rt_device_control
(
device
,
RT_DEVICE_CTRL_RTC_GET_TIME
,
&
time
);
if
(
rt_device_control
(
device
,
RT_DEVICE_CTRL_RTC_GET_TIME
,
&
time
)
==
RT_EOK
)
{
level
=
rt_hw_interrupt_disable
();
tick
=
rt_tick_get
();
/* get tick */
_timevalue
.
tv_usec
=
(
tick
%
RT_TICK_PER_SECOND
)
*
MICROSECOND_PER_TICK
;
_timevalue
.
tv_sec
=
time
-
tick
/
RT_TICK_PER_SECOND
-
1
;
rt_hw_interrupt_enable
(
level
);
return
0
;
}
}
#else
LOG_W
(
"Cannot find a RTC device to provide time!"
);
#endif
/* get tick */
tick
=
rt_tick_get
();
level
=
rt_hw_interrupt_disable
();
_timevalue
.
tv_usec
=
0
;
_timevalue
.
tv_sec
=
0
;
rt_hw_interrupt_enable
(
level
);
_timevalue
.
tv_usec
=
(
tick
%
RT_TICK_PER_SECOND
)
*
MICROSECOND_PER_TICK
;
_timevalue
.
tv_sec
=
time
-
tick
/
RT_TICK_PER_SECOND
-
1
;
return
0
;
return
-
1
;
}
INIT_COMPONENT_EXPORT
(
clock_time_system_init
);
INIT_COMPONENT_EXPORT
(
_rt_clock_time_system_init
);
#endif
/* RT_USING_RTC */
int
clock_getres
(
clockid_t
clockid
,
struct
timespec
*
res
)
{
#ifndef RT_USING_RTC
LOG_W
(
"Cannot find a RTC device to save time!"
);
return
-
1
;
#else
int
ret
=
0
;
if
(
res
==
RT_NULL
)
...
...
@@ -529,11 +535,16 @@ int clock_getres(clockid_t clockid, struct timespec *res)
}
return
ret
;
#endif
/* RT_USING_RTC */
}
RTM_EXPORT
(
clock_getres
);
int
clock_gettime
(
clockid_t
clockid
,
struct
timespec
*
tp
)
{
#ifndef RT_USING_RTC
LOG_W
(
"Cannot find a RTC device to save time!"
);
return
-
1
;
#else
int
ret
=
0
;
if
(
tp
==
RT_NULL
)
...
...
@@ -546,11 +557,14 @@ int clock_gettime(clockid_t clockid, struct timespec *tp)
{
case
CLOCK_REALTIME
:
{
/* get tick */
int
tick
=
rt_tick_get
()
;
int
tick
;
register
rt_base_t
level
;
level
=
rt_hw_interrupt_disable
();
tick
=
rt_tick_get
();
/* get tick */
tp
->
tv_sec
=
_timevalue
.
tv_sec
+
tick
/
RT_TICK_PER_SECOND
;
tp
->
tv_nsec
=
(
_timevalue
.
tv_usec
+
(
tick
%
RT_TICK_PER_SECOND
)
*
MICROSECOND_PER_TICK
)
*
1000
;
rt_hw_interrupt_enable
(
level
);
}
break
;
...
...
@@ -574,11 +588,17 @@ int clock_gettime(clockid_t clockid, struct timespec *tp)
}
return
ret
;
#endif
/* RT_USING_RTC */
}
RTM_EXPORT
(
clock_gettime
);
int
clock_settime
(
clockid_t
clockid
,
const
struct
timespec
*
tp
)
{
#ifndef RT_USING_RTC
LOG_W
(
"Cannot find a RTC device to save time!"
);
return
-
1
;
#else
register
rt_base_t
level
;
int
second
;
rt_tick_t
tick
;
rt_device_t
device
;
...
...
@@ -586,38 +606,36 @@ int clock_settime(clockid_t clockid, const struct timespec *tp)
if
((
clockid
!=
CLOCK_REALTIME
)
||
(
tp
==
RT_NULL
))
{
rt_set_errno
(
EINVAL
);
return
-
1
;
}
/* get second */
second
=
tp
->
tv_sec
;
/* get tick */
tick
=
rt_tick_get
();
level
=
rt_hw_interrupt_disable
();
tick
=
rt_tick_get
();
/* get tick */
/* update timevalue */
_timevalue
.
tv_usec
=
MICROSECOND_PER_SECOND
-
(
tick
%
RT_TICK_PER_SECOND
)
*
MICROSECOND_PER_TICK
;
_timevalue
.
tv_sec
=
second
-
tick
/
RT_TICK_PER_SECOND
-
1
;
rt_hw_interrupt_enable
(
level
);
#ifdef RT_USING_RTC
/* update for RTC device */
device
=
rt_device_find
(
"rtc"
);
if
(
device
!=
RT_NULL
)
{
/* set realtime seconds */
rt_device_control
(
device
,
RT_DEVICE_CTRL_RTC_SET_TIME
,
&
second
);
if
(
rt_device_control
(
device
,
RT_DEVICE_CTRL_RTC_SET_TIME
,
&
second
)
==
RT_EOK
)
{
return
0
;
}
}
else
#else
LOG_W
(
"Cannot find a RTC device to save time!"
);
#endif
return
-
1
;
return
0
;
return
-
1
;
#endif
/* RT_USING_RTC */
}
RTM_EXPORT
(
clock_settime
);
int
clock_time
_to_tick
(
const
struct
timespec
*
time
)
int
rt_timespec
_to_tick
(
const
struct
timespec
*
time
)
{
int
tick
;
int
nsecond
,
second
;
...
...
@@ -648,6 +666,32 @@ int clock_time_to_tick(const struct timespec *time)
return
tick
;
}
RTM_EXPORT
(
clock_time
_to_tick
);
RTM_EXPORT
(
rt_timespec
_to_tick
);
#endif
/* RT_USING_POSIX */
/* timezone */
#ifndef RT_LIBC_DEFAULT_TIMEZONE
#define RT_LIBC_DEFAULT_TIMEZONE 8
#endif
static
volatile
rt_int8_t
rt_current_timezone
=
RT_LIBC_DEFAULT_TIMEZONE
;
void
rt_tz_set
(
rt_int8_t
tz
)
{
register
rt_base_t
level
;
level
=
rt_hw_interrupt_disable
();
rt_current_timezone
=
tz
;
rt_hw_interrupt_enable
(
level
);
}
rt_int8_t
rt_tz_get
(
void
)
{
return
rt_current_timezone
;
}
rt_int8_t
rt_tz_is_dst
(
void
)
{
return
0
;
}
components/libc/pthreads/mqueue.c
浏览文件 @
b104bbc4
...
...
@@ -8,6 +8,7 @@
*/
#include <string.h>
#include <sys/signal.h>
#include "mqueue.h"
#include "pthread_internal.h"
...
...
@@ -243,7 +244,7 @@ ssize_t mq_timedreceive(mqd_t mqdes,
return
-
1
;
}
tick
=
clock_time
_to_tick
(
abs_timeout
);
tick
=
rt_timespec
_to_tick
(
abs_timeout
);
result
=
rt_mq_recv
(
mqdes
->
mq
,
msg_ptr
,
msg_len
,
tick
);
if
(
result
==
RT_EOK
)
...
...
components/libc/pthreads/pthread_cond.c
浏览文件 @
b104bbc4
...
...
@@ -222,7 +222,7 @@ int pthread_cond_timedwait(pthread_cond_t *cond,
int
timeout
;
rt_err_t
result
;
timeout
=
clock_time
_to_tick
(
abstime
);
timeout
=
rt_timespec
_to_tick
(
abstime
);
result
=
_pthread_cond_timedwait
(
cond
,
mutex
,
timeout
);
if
(
result
==
RT_EOK
)
return
0
;
...
...
components/libc/pthreads/semaphore.c
浏览文件 @
b104bbc4
...
...
@@ -319,7 +319,7 @@ int sem_timedwait(sem_t *sem, const struct timespec *abs_timeout)
return
EINVAL
;
/* calculate os tick */
tick
=
clock_time
_to_tick
(
abs_timeout
);
tick
=
rt_timespec
_to_tick
(
abs_timeout
);
result
=
rt_sem_take
(
sem
->
sem
,
tick
);
if
(
result
==
-
RT_ETIMEOUT
)
...
...
components/libc/signal/posix_signal.c
浏览文件 @
b104bbc4
...
...
@@ -7,6 +7,7 @@
* Date Author Notes
* 2017/10/1 Bernard The first version
*/
#include <rthw.h>
#include <rtthread.h>
...
...
@@ -14,6 +15,7 @@
#include <sys/errno.h>
#include "posix_signal.h"
#define sig_valid(sig_no) (sig_no >= 0 && sig_no < RT_SIG_MAX)
void
(
*
signal
(
int
sig
,
void
(
*
func
)(
int
)))
(
int
)
...
...
@@ -79,13 +81,10 @@ int sigtimedwait(const sigset_t *set, siginfo_t *info,
int
ret
=
0
;
int
tick
=
RT_WAITING_FOREVER
;
#ifdef RT_USING_PTHREADS
if
(
timeout
)
{
extern
int
clock_time_to_tick
(
const
struct
timespec
*
time
);
tick
=
clock_time_to_tick
(
timeout
);
tick
=
rt_timespec_to_tick
(
timeout
);
}
#endif
ret
=
rt_signal_wait
(
set
,
info
,
tick
);
if
(
ret
==
0
)
return
0
;
...
...
components/libc/signal/posix_signal.h
浏览文件 @
b104bbc4
...
...
@@ -15,7 +15,6 @@
extern
"C"
{
#endif
#include <rtthread.h>
#include <sys/signal.h>
enum
rt_signal_value
{
...
...
components/net/at/at_socket/at_socket.c
浏览文件 @
b104bbc4
...
...
@@ -13,6 +13,7 @@
#include <string.h>
#include <ctype.h>
#include <sys/time.h>
#include <sys/errno.h>
#include <at_socket.h>
#include <at_device.h>
...
...
@@ -78,7 +79,7 @@ struct at_socket *at_get_socket(int socket)
}
/* get a block to the AT socket receive list*/
static
size
_t
at_recvpkt_put
(
rt_slist_t
*
rlist
,
const
char
*
ptr
,
size_t
length
)
static
rt_err
_t
at_recvpkt_put
(
rt_slist_t
*
rlist
,
const
char
*
ptr
,
size_t
length
)
{
at_recv_pkt_t
pkt
=
RT_NULL
;
...
...
@@ -86,7 +87,7 @@ static size_t at_recvpkt_put(rt_slist_t *rlist, const char *ptr, size_t length)
if
(
pkt
==
RT_NULL
)
{
LOG_E
(
"No memory for receive packet table!"
);
return
0
;
return
-
RT_ENOMEM
;
}
pkt
->
bfsz_totle
=
length
;
...
...
@@ -95,7 +96,7 @@ static size_t at_recvpkt_put(rt_slist_t *rlist, const char *ptr, size_t length)
rt_slist_append
(
rlist
,
&
pkt
->
list
);
return
length
;
return
RT_EOK
;
}
/* delete and free all receive buffer list */
...
...
@@ -651,14 +652,20 @@ static void at_recv_notice_cb(struct at_socket *sock, at_socket_evt_t event, con
RT_ASSERT
(
event
==
AT_SOCKET_EVT_RECV
);
/* check the socket object status */
if
(
sock
->
magic
!=
AT_SOCKET_MAGIC
)
if
(
sock
->
magic
!=
AT_SOCKET_MAGIC
||
sock
->
state
==
AT_SOCKET_CLOSED
)
{
rt_free
((
void
*
)
buff
);
return
;
}
/* put receive buffer to receiver packet list */
rt_mutex_take
(
sock
->
recv_lock
,
RT_WAITING_FOREVER
);
at_recvpkt_put
(
&
(
sock
->
recvpkt_list
),
buff
,
bfsz
);
if
(
at_recvpkt_put
(
&
(
sock
->
recvpkt_list
),
buff
,
bfsz
)
!=
RT_EOK
)
{
rt_free
((
void
*
)
buff
);
rt_mutex_release
(
sock
->
recv_lock
);
return
;
}
rt_mutex_release
(
sock
->
recv_lock
);
rt_sem_release
(
sock
->
recv_notice
);
...
...
components/net/at/src/at_client.c
浏览文件 @
b104bbc4
...
...
@@ -9,6 +9,7 @@
* 2018-04-12 chenyong add client implement
* 2018-08-17 chenyong multiple client support
* 2021-03-17 Meco Man fix a buf of leaking memory
* 2021-07-14 Sszl fix a buf of leaking memory
*/
#include <at.h>
...
...
@@ -571,30 +572,19 @@ int at_obj_set_urc_table(at_client_t client, const struct at_urc *urc_table, rt_
}
else
{
struct
at_urc_table
*
old_urc_table
=
RT_NULL
;
size_t
old_table_size
=
client
->
urc_table_size
*
sizeof
(
struct
at_urc_table
);
old_urc_table
=
(
struct
at_urc_table
*
)
rt_malloc
(
old_table_size
);
if
(
old_urc_table
==
RT_NULL
)
{
return
-
RT_ENOMEM
;
}
rt_memcpy
(
old_urc_table
,
client
->
urc_table
,
old_table_size
);
struct
at_urc_table
*
new_urc_table
=
RT_NULL
;
/* realloc urc table space */
client
->
urc_table
=
(
struct
at_urc_table
*
)
rt_realloc
(
client
->
urc_table
,
old_table_size
+
sizeof
(
struct
at_urc_table
));
if
(
client
->
urc_table
==
RT_NULL
)
new_urc_table
=
(
struct
at_urc_table
*
)
rt_realloc
(
client
->
urc_table
,
client
->
urc_table_size
*
sizeof
(
struct
at_urc_table
)
+
sizeof
(
struct
at_urc_table
));
if
(
new_urc_table
==
RT_NULL
)
{
rt_free
(
old_urc_table
);
return
-
RT_ENOMEM
;
}
rt_memcpy
(
client
->
urc_table
,
old_urc_table
,
old_table_size
)
;
client
->
urc_table
=
new_urc_table
;
client
->
urc_table
[
client
->
urc_table_size
].
urc
=
urc_table
;
client
->
urc_table
[
client
->
urc_table_size
].
urc_size
=
table_sz
;
client
->
urc_table_size
++
;
rt_free
(
old_urc_table
);
}
return
RT_EOK
;
...
...
components/net/lwip-1.4.1/src/lwipopts.h
浏览文件 @
b104bbc4
...
...
@@ -222,6 +222,13 @@
#define LWIP_DBG_TYPES_ON (LWIP_DBG_ON|LWIP_DBG_TRACE|LWIP_DBG_STATE|LWIP_DBG_FRESH|LWIP_DBG_HALT)
/* ---------- Memory options ---------- */
#ifdef RT_USING_ASM_MEMCPY
#define MEMCPY(dst,src,len) rt_memcpy(dst,src,len)
#else
#define MEMCPY(dst,src,len) memcpy(dst,src,len)
#endif
/* RT_USING_ASM_MEMCPY */
#define SMEMCPY(dst,src,len) MEMCPY(dst,src,len)
#define MEM_ALIGNMENT 4
#define MEM_LIBC_MALLOC 1
...
...
components/net/lwip-1.4.1/src/netif/ethernetif.c
浏览文件 @
b104bbc4
...
...
@@ -201,14 +201,14 @@ int lwip_netdev_ping(struct netdev *netif, const char *host, size_t data_len,
{
return
-
RT_ERROR
;
}
rt_memcpy
(
&
h
,
&
res
->
ai_addr
,
sizeof
(
struct
sockaddr_in
*
));
rt_memcpy
(
&
ina
,
&
h
->
sin_addr
,
sizeof
(
ina
));
SMEMCPY
(
&
h
,
&
res
->
ai_addr
,
sizeof
(
struct
sockaddr_in
*
));
SMEMCPY
(
&
ina
,
&
h
->
sin_addr
,
sizeof
(
ina
));
lwip_freeaddrinfo
(
res
);
if
(
inet_aton
(
inet_ntoa
(
ina
),
&
target_addr
)
==
0
)
{
return
-
RT_ERROR
;
}
rt_memcpy
(
&
(
ping_resp
->
ip_addr
),
&
target_addr
,
sizeof
(
ip_addr_t
));
SMEMCPY
(
&
(
ping_resp
->
ip_addr
),
&
target_addr
,
sizeof
(
ip_addr_t
));
/* new a socket */
if
((
s
=
lwip_socket
(
AF_INET
,
SOCK_RAW
,
IP_PROTO_ICMP
))
<
0
)
...
...
@@ -331,7 +331,7 @@ static int netdev_add(struct netif *lwip_netif)
netdev
->
mtu
=
lwip_netif
->
mtu
;
netdev
->
ops
=
&
lwip_netdev_ops
;
netdev
->
hwaddr_len
=
lwip_netif
->
hwaddr_len
;
rt_memcpy
(
netdev
->
hwaddr
,
lwip_netif
->
hwaddr
,
lwip_netif
->
hwaddr_len
);
SMEMCPY
(
netdev
->
hwaddr
,
lwip_netif
->
hwaddr
,
lwip_netif
->
hwaddr_len
);
netdev
->
ip_addr
=
lwip_netif
->
ip_addr
;
netdev
->
gw
=
lwip_netif
->
gw
;
netdev
->
netmask
=
lwip_netif
->
netmask
;
...
...
components/net/lwip-2.0.2/src/lwipopts.h
浏览文件 @
b104bbc4
...
...
@@ -230,14 +230,21 @@
#define LWIP_DBG_TYPES_ON (LWIP_DBG_ON|LWIP_DBG_TRACE|LWIP_DBG_STATE|LWIP_DBG_FRESH|LWIP_DBG_HALT)
/* ---------- Memory options ---------- */
#ifdef RT_USING_ASM_MEMCPY
#define MEMCPY(dst,src,len) rt_memcpy(dst,src,len)
#else
#define MEMCPY(dst,src,len) memcpy(dst,src,len)
#endif
/* RT_USING_ASM_MEMCPY */
#define SMEMCPY(dst,src,len) MEMCPY(dst,src,len)
#ifdef RT_LWIP_MEM_ALIGNMENT
#define MEM_ALIGNMENT RT_LWIP_MEM_ALIGNMENT
#else
#define MEM_ALIGNMENT 4
#endif
#define MEMP_OVERFLOW_CHECK 1
////
#define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 1
////
#define MEMP_OVERFLOW_CHECK 1
#define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 1
//#define MEM_LIBC_MALLOC 1
//#define MEM_USE_POOLS 1
//#define MEMP_USE_CUSTOM_POOLS 1
...
...
components/net/lwip-2.0.2/src/netif/ethernetif.c
浏览文件 @
b104bbc4
...
...
@@ -210,14 +210,14 @@ int lwip_netdev_ping(struct netdev *netif, const char *host, size_t data_len,
{
return
-
RT_ERROR
;
}
rt_memcpy
(
&
h
,
&
res
->
ai_addr
,
sizeof
(
struct
sockaddr_in
*
));
rt_memcpy
(
&
ina
,
&
h
->
sin_addr
,
sizeof
(
ina
));
SMEMCPY
(
&
h
,
&
res
->
ai_addr
,
sizeof
(
struct
sockaddr_in
*
));
SMEMCPY
(
&
ina
,
&
h
->
sin_addr
,
sizeof
(
ina
));
lwip_freeaddrinfo
(
res
);
if
(
inet_aton
(
inet_ntoa
(
ina
),
&
target_addr
)
==
0
)
{
return
-
RT_ERROR
;
}
rt_memcpy
(
&
(
ping_resp
->
ip_addr
),
&
target_addr
,
sizeof
(
ip_addr_t
));
SMEMCPY
(
&
(
ping_resp
->
ip_addr
),
&
target_addr
,
sizeof
(
ip_addr_t
));
/* new a socket */
if
((
s
=
lwip_socket
(
AF_INET
,
SOCK_RAW
,
IP_PROTO_ICMP
))
<
0
)
...
...
@@ -340,7 +340,7 @@ static int netdev_add(struct netif *lwip_netif)
netdev
->
mtu
=
lwip_netif
->
mtu
;
netdev
->
ops
=
&
lwip_netdev_ops
;
netdev
->
hwaddr_len
=
lwip_netif
->
hwaddr_len
;
rt_memcpy
(
netdev
->
hwaddr
,
lwip_netif
->
hwaddr
,
lwip_netif
->
hwaddr_len
);
SMEMCPY
(
netdev
->
hwaddr
,
lwip_netif
->
hwaddr
,
lwip_netif
->
hwaddr_len
);
netdev
->
ip_addr
=
lwip_netif
->
ip_addr
;
netdev
->
gw
=
lwip_netif
->
gw
;
netdev
->
netmask
=
lwip_netif
->
netmask
;
...
...
components/net/lwip-2.0.3/src/lwipopts.h
浏览文件 @
b104bbc4
...
...
@@ -230,14 +230,21 @@
#define LWIP_DBG_TYPES_ON (LWIP_DBG_ON|LWIP_DBG_TRACE|LWIP_DBG_STATE|LWIP_DBG_FRESH|LWIP_DBG_HALT)
/* ---------- Memory options ---------- */
#ifdef RT_USING_ASM_MEMCPY
#define MEMCPY(dst,src,len) rt_memcpy(dst,src,len)
#else
#define MEMCPY(dst,src,len) memcpy(dst,src,len)
#endif
/* RT_USING_ASM_MEMCPY */
#define SMEMCPY(dst,src,len) MEMCPY(dst,src,len)
#ifdef RT_LWIP_MEM_ALIGNMENT
#define MEM_ALIGNMENT RT_LWIP_MEM_ALIGNMENT
#else
#define MEM_ALIGNMENT 4
#endif
#define MEMP_OVERFLOW_CHECK 1
////
#define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 1
////
#define MEMP_OVERFLOW_CHECK 1
#define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 1
//#define MEM_LIBC_MALLOC 1
//#define MEM_USE_POOLS 1
//#define MEMP_USE_CUSTOM_POOLS 1
...
...
components/net/lwip-2.0.3/src/netif/ethernetif.c
浏览文件 @
b104bbc4
...
...
@@ -210,14 +210,14 @@ int lwip_netdev_ping(struct netdev *netif, const char *host, size_t data_len,
{
return
-
RT_ERROR
;
}
rt_memcpy
(
&
h
,
&
res
->
ai_addr
,
sizeof
(
struct
sockaddr_in
*
));
rt_memcpy
(
&
ina
,
&
h
->
sin_addr
,
sizeof
(
ina
));
SMEMCPY
(
&
h
,
&
res
->
ai_addr
,
sizeof
(
struct
sockaddr_in
*
));
SMEMCPY
(
&
ina
,
&
h
->
sin_addr
,
sizeof
(
ina
));
lwip_freeaddrinfo
(
res
);
if
(
inet_aton
(
inet_ntoa
(
ina
),
&
target_addr
)
==
0
)
{
return
-
RT_ERROR
;
}
rt_memcpy
(
&
(
ping_resp
->
ip_addr
),
&
target_addr
,
sizeof
(
ip_addr_t
));
SMEMCPY
(
&
(
ping_resp
->
ip_addr
),
&
target_addr
,
sizeof
(
ip_addr_t
));
/* new a socket */
if
((
s
=
lwip_socket
(
AF_INET
,
SOCK_RAW
,
IP_PROTO_ICMP
))
<
0
)
...
...
@@ -340,7 +340,7 @@ static int netdev_add(struct netif *lwip_netif)
netdev
->
mtu
=
lwip_netif
->
mtu
;
netdev
->
ops
=
&
lwip_netdev_ops
;
netdev
->
hwaddr_len
=
lwip_netif
->
hwaddr_len
;
rt_memcpy
(
netdev
->
hwaddr
,
lwip_netif
->
hwaddr
,
lwip_netif
->
hwaddr_len
);
SMEMCPY
(
netdev
->
hwaddr
,
lwip_netif
->
hwaddr
,
lwip_netif
->
hwaddr_len
);
netdev
->
ip_addr
=
lwip_netif
->
ip_addr
;
netdev
->
gw
=
lwip_netif
->
gw
;
netdev
->
netmask
=
lwip_netif
->
netmask
;
...
...
components/net/lwip-2.1.2/src/lwipopts.h
浏览文件 @
b104bbc4
...
...
@@ -242,9 +242,16 @@
#endif
/* ---------- Memory options ---------- */
#ifdef RT_USING_ASM_MEMCPY
#define MEMCPY(dst,src,len) rt_memcpy(dst,src,len)
#else
#define MEMCPY(dst,src,len) memcpy(dst,src,len)
#endif
/* RT_USING_ASM_MEMCPY */
#define SMEMCPY(dst,src,len) MEMCPY(dst,src,len)
#define MEM_ALIGNMENT 4
#define MEMP_OVERFLOW_CHECK 1
////
#define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 1
////
#define MEMP_OVERFLOW_CHECK 1
#define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 1
//#define MEM_LIBC_MALLOC 1
//#define MEM_USE_POOLS 1
//#define MEMP_USE_CUSTOM_POOLS 1
...
...
components/net/lwip-2.1.2/src/netif/ethernetif.c
浏览文件 @
b104bbc4
...
...
@@ -208,14 +208,14 @@ int lwip_netdev_ping(struct netdev *netif, const char *host, size_t data_len,
{
return
-
RT_ERROR
;
}
rt_memcpy
(
&
h
,
&
res
->
ai_addr
,
sizeof
(
struct
sockaddr_in
*
));
rt_memcpy
(
&
ina
,
&
h
->
sin_addr
,
sizeof
(
ina
));
SMEMCPY
(
&
h
,
&
res
->
ai_addr
,
sizeof
(
struct
sockaddr_in
*
));
SMEMCPY
(
&
ina
,
&
h
->
sin_addr
,
sizeof
(
ina
));
lwip_freeaddrinfo
(
res
);
if
(
inet_aton
(
inet_ntoa
(
ina
),
&
target_addr
)
==
0
)
{
return
-
RT_ERROR
;
}
rt_memcpy
(
&
(
ping_resp
->
ip_addr
),
&
target_addr
,
sizeof
(
ip_addr_t
));
SMEMCPY
(
&
(
ping_resp
->
ip_addr
),
&
target_addr
,
sizeof
(
ip_addr_t
));
/* new a socket */
if
((
s
=
lwip_socket
(
AF_INET
,
SOCK_RAW
,
IP_PROTO_ICMP
))
<
0
)
...
...
@@ -338,7 +338,7 @@ static int netdev_add(struct netif *lwip_netif)
netdev
->
mtu
=
lwip_netif
->
mtu
;
netdev
->
ops
=
&
lwip_netdev_ops
;
netdev
->
hwaddr_len
=
lwip_netif
->
hwaddr_len
;
rt_memcpy
(
netdev
->
hwaddr
,
lwip_netif
->
hwaddr
,
lwip_netif
->
hwaddr_len
);
SMEMCPY
(
netdev
->
hwaddr
,
lwip_netif
->
hwaddr
,
lwip_netif
->
hwaddr_len
);
netdev
->
ip_addr
=
lwip_netif
->
ip_addr
;
netdev
->
gw
=
lwip_netif
->
gw
;
netdev
->
netmask
=
lwip_netif
->
netmask
;
...
...
components/net/sal_socket/include/socket/netdb.h
浏览文件 @
b104bbc4
...
...
@@ -6,7 +6,7 @@
* Change Logs:
* Date Author Notes
* 2015-02-17 Bernard First version
* 2
10
8-05-24 ChenYong Add socket abstraction layer
* 2
01
8-05-24 ChenYong Add socket abstraction layer
*/
#ifndef NETDB_H__
...
...
examples/kernel/event_simple.c
浏览文件 @
b104bbc4
...
...
@@ -83,7 +83,7 @@ static void thread3_entry(void *param)
int
event_simple_init
()
{
/* 初始化事件对象 */
rt_event_init
(
&
event
,
"event"
,
RT_IPC_FLAG_
FIF
O
);
rt_event_init
(
&
event
,
"event"
,
RT_IPC_FLAG_
PRI
O
);
/* 创建线程1 */
tid1
=
rt_thread_create
(
"t1"
,
...
...
examples/kernel/mbox_send_wait.c
浏览文件 @
b104bbc4
...
...
@@ -82,7 +82,7 @@ int mbox_send_wait_init()
"mbt"
,
/* 名称是mbt */
&
mb_pool
[
0
],
/* 邮箱用到的内存池是mb_pool */
sizeof
(
mb_pool
)
/
4
,
/* 大小是mb_pool大小除以4,因为一封邮件的大小是4字节 */
RT_IPC_FLAG_
FIFO
);
/* 采用FIF
O方式进行线程等待 */
RT_IPC_FLAG_
PRIO
);
/* 采用PRI
O方式进行线程等待 */
/* 创建线程1 */
tid1
=
rt_thread_create
(
"t1"
,
...
...
examples/kernel/mbox_simple.c
浏览文件 @
b104bbc4
...
...
@@ -80,7 +80,7 @@ int mbox_simple_init()
"mbt"
,
/* 名称是mbt */
&
mb_pool
[
0
],
/* 邮箱用到的内存池是mb_pool */
sizeof
(
mb_pool
)
/
4
,
/* 大小是mb_pool大小除以4,因为一封邮件的大小是4字节 */
RT_IPC_FLAG_
FIFO
);
/* 采用FIF
O方式进行线程等待 */
RT_IPC_FLAG_
PRIO
);
/* 采用PRI
O方式进行线程等待 */
/* 创建线程1 */
tid1
=
rt_thread_create
(
"t1"
,
...
...
examples/kernel/messageq_simple.c
浏览文件 @
b104bbc4
...
...
@@ -98,7 +98,7 @@ int messageq_simple_init()
&
msg_pool
[
0
],
/* 内存池指向msg_pool */
128
-
sizeof
(
void
*
),
/* 每个消息的大小是 128 - void* */
sizeof
(
msg_pool
),
/* 内存池的大小是msg_pool的大小 */
RT_IPC_FLAG_
FIFO
);
/* 如果有多个线程等待,按照先来先得到
的方法分配消息 */
RT_IPC_FLAG_
PRIO
);
/* 如果有多个线程等待,按照优先级由高到低
的方法分配消息 */
/* 创建线程1 */
tid1
=
rt_thread_create
(
"t1"
,
...
...
examples/kernel/mutex_priority.c
浏览文件 @
b104bbc4
...
...
@@ -281,7 +281,7 @@ static void thread29_entry(void* parameter)
static
int
mutex_simple_init
()
{
/* 创建互斥锁 */
mutex
=
rt_mutex_create
(
"mutex"
,
RT_IPC_FLAG_
FIF
O
);
mutex
=
rt_mutex_create
(
"mutex"
,
RT_IPC_FLAG_
PRI
O
);
if
(
mutex
==
RT_NULL
)
{
tc_stat
(
TC_STAT_END
|
TC_STAT_FAILED
);
...
...
examples/kernel/mutex_simple.c
浏览文件 @
b104bbc4
...
...
@@ -87,7 +87,7 @@ static void thread3_entry(void* parameter)
int
mutex_simple_init
()
{
/* 创建互斥锁 */
mutex
=
rt_mutex_create
(
"mutex"
,
RT_IPC_FLAG_
FIF
O
);
mutex
=
rt_mutex_create
(
"mutex"
,
RT_IPC_FLAG_
PRI
O
);
if
(
mutex
==
RT_NULL
)
{
tc_stat
(
TC_STAT_END
|
TC_STAT_FAILED
);
...
...
examples/kernel/semaphore_buffer_worker.c
浏览文件 @
b104bbc4
...
...
@@ -209,7 +209,7 @@ int semaphore_buffer_worker_init()
rb_init
(
&
working_rb
,
working_buffer
,
BUFFER_SIZE
);
/* 创建信号量 */
sem
=
rt_sem_create
(
"sem"
,
1
,
RT_IPC_FLAG_
FIF
O
);
sem
=
rt_sem_create
(
"sem"
,
1
,
RT_IPC_FLAG_
PRI
O
);
if
(
sem
==
RT_NULL
)
{
tc_stat
(
TC_STAT_END
|
TC_STAT_FAILED
);
...
...
examples/kernel/semaphore_dynamic.c
浏览文件 @
b104bbc4
...
...
@@ -78,7 +78,7 @@ static void thread_entry(void* parameter)
int
semaphore_dynamic_init
()
{
/* 创建一个信号量,初始值是0 */
sem
=
rt_sem_create
(
"sem"
,
0
,
RT_IPC_FLAG_
FIF
O
);
sem
=
rt_sem_create
(
"sem"
,
0
,
RT_IPC_FLAG_
PRI
O
);
if
(
sem
==
RT_NULL
)
{
tc_stat
(
TC_STAT_END
|
TC_STAT_FAILED
);
...
...
examples/kernel/semaphore_producer_consumer.c
浏览文件 @
b104bbc4
...
...
@@ -98,9 +98,9 @@ void consumer_thread_entry(void* parameter)
int
semaphore_producer_consumer_init
()
{
/* 初始化3个信号量 */
rt_sem_init
(
&
sem_lock
,
"lock"
,
1
,
RT_IPC_FLAG_
FIF
O
);
rt_sem_init
(
&
sem_empty
,
"empty"
,
MAXSEM
,
RT_IPC_FLAG_
FIF
O
);
rt_sem_init
(
&
sem_full
,
"full"
,
0
,
RT_IPC_FLAG_
FIF
O
);
rt_sem_init
(
&
sem_lock
,
"lock"
,
1
,
RT_IPC_FLAG_
PRI
O
);
rt_sem_init
(
&
sem_empty
,
"empty"
,
MAXSEM
,
RT_IPC_FLAG_
PRI
O
);
rt_sem_init
(
&
sem_full
,
"full"
,
0
,
RT_IPC_FLAG_
PRI
O
);
/* 创建线程1 */
producer_tid
=
rt_thread_create
(
"producer"
,
...
...
examples/kernel/semaphore_static.c
浏览文件 @
b104bbc4
...
...
@@ -81,7 +81,7 @@ int semaphore_static_init(void)
rt_err_t
result
;
/* 初始化信号量,初始值是0 */
result
=
rt_sem_init
(
&
sem
,
"sem"
,
0
,
RT_IPC_FLAG_
FIF
O
);
result
=
rt_sem_init
(
&
sem
,
"sem"
,
0
,
RT_IPC_FLAG_
PRI
O
);
if
(
result
!=
RT_EOK
)
{
tc_stat
(
TC_STAT_END
|
TC_STAT_FAILED
);
...
...
examples/kernel/tc_comm.c
浏览文件 @
b104bbc4
...
...
@@ -35,7 +35,7 @@ void tc_thread_entry(void* parameter)
struct
finsh_syscall
*
index
;
/* create tc semaphore */
rt_sem_init
(
&
_tc_sem
,
"tc"
,
0
,
RT_IPC_FLAG_
FIF
O
);
rt_sem_init
(
&
_tc_sem
,
"tc"
,
0
,
RT_IPC_FLAG_
PRI
O
);
do
{
for
(
index
=
_syscall_table_begin
;
index
<
_syscall_table_end
;
FINSH_NEXT_SYSCALL
(
index
))
...
...
examples/kernel/timer_timeout.c
浏览文件 @
b104bbc4
...
...
@@ -73,7 +73,7 @@ int timer_timeout_init()
&
msg_pool
[
0
],
/* 内存池指向msg_pool */
128
-
sizeof
(
void
*
),
/* 每个消息的大小是 128 - void* */
sizeof
(
msg_pool
),
/* 内存池的大小是msg_pool的大小 */
RT_IPC_FLAG_
FIFO
);
/* 如果有多个线程等待,按照先来先得到
的方法分配消息 */
RT_IPC_FLAG_
PRIO
);
/* 如果有多个线程等待,按照优先级由高到低
的方法分配消息 */
/* 创建线程 */
tid
=
rt_thread_create
(
"t"
,
...
...
examples/pm/wakeup_app.c
浏览文件 @
b104bbc4
...
...
@@ -61,7 +61,7 @@ static int wakeup_app(void)
{
rt_thread_t
tid
;
wakeup_event
=
rt_event_create
(
"wakup"
,
RT_IPC_FLAG_
FIF
O
);
wakeup_event
=
rt_event_create
(
"wakup"
,
RT_IPC_FLAG_
PRI
O
);
RT_ASSERT
(
wakeup_event
!=
RT_NULL
);
tid
=
rt_thread_create
(
"wakeup_app"
,
wakeup_app_entry
,
RT_NULL
,
...
...
include/rtdef.h
浏览文件 @
b104bbc4
...
...
@@ -510,7 +510,7 @@ typedef struct rt_timer *rt_timer_t;
* @addtogroup Signal
*/
#ifdef RT_USING_SIGNALS
#include <
libc/libc_
signal.h>
#include <
sys/
signal.h>
typedef
unsigned
long
rt_sigset_t
;
typedef
void
(
*
rt_sighandler_t
)(
int
signo
);
typedef
siginfo_t
rt_siginfo_t
;
...
...
include/rtlibc.h
浏览文件 @
b104bbc4
...
...
@@ -13,11 +13,8 @@
/* definitions for libc if toolchain has no these definitions */
#include "libc/libc_stat.h"
#include "libc/libc_fcntl.h"
#include "libc/libc_dirent.h"
#include "libc/libc_signal.h"
#include "libc/libc_fdset.h"
#ifndef RT_USING_LIBC
#if defined(__ARMCC_VERSION) || defined(__IAR_SYSTEMS_ICC__)
...
...
src/Kconfig
浏览文件 @
b104bbc4
...
...
@@ -131,6 +131,10 @@ config RT_KSERVICE_USING_TINY_SIZE
bool "Enable kservice to use tiny size"
default n
config RT_USING_ASM_MEMCPY
bool
default n
endmenu
menuconfig RT_DEBUG
...
...
@@ -352,6 +356,10 @@ menu "Kernel Device Object"
config RT_CONSOLE_DEVICE_NAME
string "the device name for console"
default "uart"
config RT_PRINTF_LONGLONG
bool "rt_kprintf support long long"
default n
endif
endmenu
...
...
src/idle.c
浏览文件 @
b104bbc4
...
...
@@ -139,7 +139,7 @@ rt_err_t rt_thread_idle_delhook(void (*hook)(void))
#ifdef RT_USING_MODULE
/* Return whether there is defunctional thread to be deleted. */
rt_inline
int
_has_defunct_thread
(
void
)
rt_inline
int
_
idle_
has_defunct_thread
(
void
)
{
/* The rt_list_isempty has prototype of "int rt_list_isempty(const rt_list_t *l)".
* So the compiler has a good reason that the _rt_thread_defunct list does
...
...
@@ -207,7 +207,7 @@ static void rt_defunct_execute(void)
#ifdef RT_USING_MODULE
/* check whether list is empty */
if
(
!
_has_defunct_thread
())
if
(
!
_
idle_
has_defunct_thread
())
{
rt_hw_interrupt_enable
(
lock
);
break
;
...
...
src/ipc.c
浏览文件 @
b104bbc4
...
...
@@ -68,7 +68,7 @@ extern void (*rt_object_put_hook)(struct rt_object *object);
*
* @warning This function can be called from all IPC initialization and creation.
*/
rt_inline
rt_err_t
rt
_ipc_object_init
(
struct
rt_ipc_object
*
ipc
)
rt_inline
rt_err_t
_ipc_object_init
(
struct
rt_ipc_object
*
ipc
)
{
/* initialize ipc object */
rt_list_init
(
&
(
ipc
->
suspend_thread
));
...
...
@@ -106,9 +106,9 @@ rt_inline rt_err_t rt_ipc_object_init(struct rt_ipc_object *ipc)
* rt_sem_take(), rt_mutex_take(), rt_event_recv(), rt_mb_send_wait(),
* rt_mb_recv(), rt_mq_recv(), rt_mq_send_wait()
*/
rt_inline
rt_err_t
rt
_ipc_list_suspend
(
rt_list_t
*
list
,
struct
rt_thread
*
thread
,
rt_uint8_t
flag
)
rt_inline
rt_err_t
_ipc_list_suspend
(
rt_list_t
*
list
,
struct
rt_thread
*
thread
,
rt_uint8_t
flag
)
{
/* suspend thread */
rt_thread_suspend
(
thread
);
...
...
@@ -175,7 +175,7 @@ rt_inline rt_err_t rt_ipc_list_suspend(rt_list_t *list,
* rt_sem_release(), rt_mutex_release(), rt_mb_send_wait(), rt_mq_send_wait(),
* rt_mb_urgent(), rt_mb_recv(), rt_mq_urgent(), rt_mq_recv(),
*/
rt_inline
rt_err_t
rt
_ipc_list_resume
(
rt_list_t
*
list
)
rt_inline
rt_err_t
_ipc_list_resume
(
rt_list_t
*
list
)
{
struct
rt_thread
*
thread
;
...
...
@@ -204,7 +204,7 @@ rt_inline rt_err_t rt_ipc_list_resume(rt_list_t *list)
* When the return value is any other values, it means this operation failed.
*
*/
rt_inline
rt_err_t
rt
_ipc_list_resume_all
(
rt_list_t
*
list
)
rt_inline
rt_err_t
_ipc_list_resume_all
(
rt_list_t
*
list
)
{
struct
rt_thread
*
thread
;
register
rt_ubase_t
temp
;
...
...
@@ -292,7 +292,7 @@ rt_err_t rt_sem_init(rt_sem_t sem,
rt_object_init
(
&
(
sem
->
parent
.
parent
),
RT_Object_Class_Semaphore
,
name
);
/* initialize ipc object */
rt
_ipc_object_init
(
&
(
sem
->
parent
));
_ipc_object_init
(
&
(
sem
->
parent
));
/* set initial value */
sem
->
value
=
(
rt_uint16_t
)
value
;
...
...
@@ -331,7 +331,7 @@ rt_err_t rt_sem_detach(rt_sem_t sem)
RT_ASSERT
(
rt_object_is_systemobject
(
&
sem
->
parent
.
parent
));
/* wakeup all suspended threads */
rt
_ipc_list_resume_all
(
&
(
sem
->
parent
.
suspend_thread
));
_ipc_list_resume_all
(
&
(
sem
->
parent
.
suspend_thread
));
/* detach semaphore object */
rt_object_detach
(
&
(
sem
->
parent
.
parent
));
...
...
@@ -386,7 +386,7 @@ rt_sem_t rt_sem_create(const char *name, rt_uint32_t value, rt_uint8_t flag)
return
sem
;
/* initialize ipc object */
rt
_ipc_object_init
(
&
(
sem
->
parent
));
_ipc_object_init
(
&
(
sem
->
parent
));
/* set initial value */
sem
->
value
=
value
;
...
...
@@ -427,7 +427,7 @@ rt_err_t rt_sem_delete(rt_sem_t sem)
RT_ASSERT
(
rt_object_is_systemobject
(
&
sem
->
parent
.
parent
)
==
RT_FALSE
);
/* wakeup all suspended threads */
rt
_ipc_list_resume_all
(
&
(
sem
->
parent
.
suspend_thread
));
_ipc_list_resume_all
(
&
(
sem
->
parent
.
suspend_thread
));
/* delete semaphore object */
rt_object_delete
(
&
(
sem
->
parent
.
parent
));
...
...
@@ -513,7 +513,7 @@ rt_err_t rt_sem_take(rt_sem_t sem, rt_int32_t time)
thread
->
name
));
/* suspend thread */
rt
_ipc_list_suspend
(
&
(
sem
->
parent
.
suspend_thread
),
_ipc_list_suspend
(
&
(
sem
->
parent
.
suspend_thread
),
thread
,
sem
->
parent
.
parent
.
flag
);
...
...
@@ -607,7 +607,7 @@ rt_err_t rt_sem_release(rt_sem_t sem)
if
(
!
rt_list_isempty
(
&
sem
->
parent
.
suspend_thread
))
{
/* resume the suspended thread */
rt
_ipc_list_resume
(
&
(
sem
->
parent
.
suspend_thread
));
_ipc_list_resume
(
&
(
sem
->
parent
.
suspend_thread
));
need_schedule
=
RT_TRUE
;
}
else
...
...
@@ -667,7 +667,7 @@ rt_err_t rt_sem_control(rt_sem_t sem, int cmd, void *arg)
level
=
rt_hw_interrupt_disable
();
/* resume all waiting thread */
rt
_ipc_list_resume_all
(
&
sem
->
parent
.
suspend_thread
);
_ipc_list_resume_all
(
&
sem
->
parent
.
suspend_thread
);
/* set new value */
sem
->
value
=
(
rt_uint16_t
)
value
;
...
...
@@ -730,7 +730,7 @@ rt_err_t rt_mutex_init(rt_mutex_t mutex, const char *name, rt_uint8_t flag)
rt_object_init
(
&
(
mutex
->
parent
.
parent
),
RT_Object_Class_Mutex
,
name
);
/* initialize ipc object */
rt
_ipc_object_init
(
&
(
mutex
->
parent
));
_ipc_object_init
(
&
(
mutex
->
parent
));
mutex
->
value
=
1
;
mutex
->
owner
=
RT_NULL
;
...
...
@@ -771,7 +771,7 @@ rt_err_t rt_mutex_detach(rt_mutex_t mutex)
RT_ASSERT
(
rt_object_is_systemobject
(
&
mutex
->
parent
.
parent
));
/* wakeup all suspended threads */
rt
_ipc_list_resume_all
(
&
(
mutex
->
parent
.
suspend_thread
));
_ipc_list_resume_all
(
&
(
mutex
->
parent
.
suspend_thread
));
/* detach mutex object */
rt_object_detach
(
&
(
mutex
->
parent
.
parent
));
...
...
@@ -813,7 +813,7 @@ rt_mutex_t rt_mutex_create(const char *name, rt_uint8_t flag)
return
mutex
;
/* initialize ipc object */
rt
_ipc_object_init
(
&
(
mutex
->
parent
));
_ipc_object_init
(
&
(
mutex
->
parent
));
mutex
->
value
=
1
;
mutex
->
owner
=
RT_NULL
;
...
...
@@ -856,7 +856,7 @@ rt_err_t rt_mutex_delete(rt_mutex_t mutex)
RT_ASSERT
(
rt_object_is_systemobject
(
&
mutex
->
parent
.
parent
)
==
RT_FALSE
);
/* wakeup all suspended threads */
rt
_ipc_list_resume_all
(
&
(
mutex
->
parent
.
suspend_thread
));
_ipc_list_resume_all
(
&
(
mutex
->
parent
.
suspend_thread
));
/* delete mutex object */
rt_object_delete
(
&
(
mutex
->
parent
.
parent
));
...
...
@@ -985,7 +985,7 @@ __again:
}
/* suspend current thread */
rt
_ipc_list_suspend
(
&
(
mutex
->
parent
.
suspend_thread
),
_ipc_list_suspend
(
&
(
mutex
->
parent
.
suspend_thread
),
thread
,
mutex
->
parent
.
parent
.
flag
);
...
...
@@ -1150,7 +1150,7 @@ rt_err_t rt_mutex_release(rt_mutex_t mutex)
}
/* resume thread */
rt
_ipc_list_resume
(
&
(
mutex
->
parent
.
suspend_thread
));
_ipc_list_resume
(
&
(
mutex
->
parent
.
suspend_thread
));
need_schedule
=
RT_TRUE
;
}
...
...
@@ -1269,7 +1269,7 @@ rt_err_t rt_event_init(rt_event_t event, const char *name, rt_uint8_t flag)
event
->
parent
.
parent
.
flag
=
flag
;
/* initialize ipc object */
rt
_ipc_object_init
(
&
(
event
->
parent
));
_ipc_object_init
(
&
(
event
->
parent
));
/* initialize event */
event
->
set
=
0
;
...
...
@@ -1305,7 +1305,7 @@ rt_err_t rt_event_detach(rt_event_t event)
RT_ASSERT
(
rt_object_is_systemobject
(
&
event
->
parent
.
parent
));
/* resume all suspended thread */
rt
_ipc_list_resume_all
(
&
(
event
->
parent
.
suspend_thread
));
_ipc_list_resume_all
(
&
(
event
->
parent
.
suspend_thread
));
/* detach event object */
rt_object_detach
(
&
(
event
->
parent
.
parent
));
...
...
@@ -1358,7 +1358,7 @@ rt_event_t rt_event_create(const char *name, rt_uint8_t flag)
event
->
parent
.
parent
.
flag
=
flag
;
/* initialize ipc object */
rt
_ipc_object_init
(
&
(
event
->
parent
));
_ipc_object_init
(
&
(
event
->
parent
));
/* initialize event */
event
->
set
=
0
;
...
...
@@ -1396,7 +1396,7 @@ rt_err_t rt_event_delete(rt_event_t event)
RT_DEBUG_NOT_IN_INTERRUPT
;
/* resume all suspended thread */
rt
_ipc_list_resume_all
(
&
(
event
->
parent
.
suspend_thread
));
_ipc_list_resume_all
(
&
(
event
->
parent
.
suspend_thread
));
/* delete event object */
rt_object_delete
(
&
(
event
->
parent
.
parent
));
...
...
@@ -1628,7 +1628,7 @@ rt_err_t rt_event_recv(rt_event_t event,
thread
->
event_info
=
option
;
/* put thread to suspended thread list */
rt
_ipc_list_suspend
(
&
(
event
->
parent
.
suspend_thread
),
_ipc_list_suspend
(
&
(
event
->
parent
.
suspend_thread
),
thread
,
event
->
parent
.
parent
.
flag
);
...
...
@@ -1700,7 +1700,7 @@ rt_err_t rt_event_control(rt_event_t event, int cmd, void *arg)
level
=
rt_hw_interrupt_disable
();
/* resume all waiting thread */
rt
_ipc_list_resume_all
(
&
event
->
parent
.
suspend_thread
);
_ipc_list_resume_all
(
&
event
->
parent
.
suspend_thread
);
/* initialize event set */
event
->
set
=
0
;
...
...
@@ -1781,7 +1781,7 @@ rt_err_t rt_mb_init(rt_mailbox_t mb,
mb
->
parent
.
parent
.
flag
=
flag
;
/* initialize ipc object */
rt
_ipc_object_init
(
&
(
mb
->
parent
));
_ipc_object_init
(
&
(
mb
->
parent
));
/* initialize mailbox */
mb
->
msg_pool
=
(
rt_ubase_t
*
)
msgpool
;
...
...
@@ -1824,9 +1824,9 @@ rt_err_t rt_mb_detach(rt_mailbox_t mb)
RT_ASSERT
(
rt_object_is_systemobject
(
&
mb
->
parent
.
parent
));
/* resume all suspended thread */
rt
_ipc_list_resume_all
(
&
(
mb
->
parent
.
suspend_thread
));
_ipc_list_resume_all
(
&
(
mb
->
parent
.
suspend_thread
));
/* also resume all mailbox private suspended thread */
rt
_ipc_list_resume_all
(
&
(
mb
->
suspend_sender_thread
));
_ipc_list_resume_all
(
&
(
mb
->
suspend_sender_thread
));
/* detach mailbox object */
rt_object_detach
(
&
(
mb
->
parent
.
parent
));
...
...
@@ -1882,7 +1882,7 @@ rt_mailbox_t rt_mb_create(const char *name, rt_size_t size, rt_uint8_t flag)
mb
->
parent
.
parent
.
flag
=
flag
;
/* initialize ipc object */
rt
_ipc_object_init
(
&
(
mb
->
parent
));
_ipc_object_init
(
&
(
mb
->
parent
));
/* initialize mailbox */
mb
->
size
=
size
;
...
...
@@ -1934,10 +1934,10 @@ rt_err_t rt_mb_delete(rt_mailbox_t mb)
RT_ASSERT
(
rt_object_is_systemobject
(
&
mb
->
parent
.
parent
)
==
RT_FALSE
);
/* resume all suspended thread */
rt
_ipc_list_resume_all
(
&
(
mb
->
parent
.
suspend_thread
));
_ipc_list_resume_all
(
&
(
mb
->
parent
.
suspend_thread
));
/* also resume all mailbox private suspended thread */
rt
_ipc_list_resume_all
(
&
(
mb
->
suspend_sender_thread
));
_ipc_list_resume_all
(
&
(
mb
->
suspend_sender_thread
));
/* free mailbox pool */
RT_KERNEL_FREE
(
mb
->
msg_pool
);
...
...
@@ -2020,7 +2020,7 @@ rt_err_t rt_mb_send_wait(rt_mailbox_t mb,
RT_DEBUG_IN_THREAD_CONTEXT
;
/* suspend current thread */
rt
_ipc_list_suspend
(
&
(
mb
->
suspend_sender_thread
),
_ipc_list_suspend
(
&
(
mb
->
suspend_sender_thread
),
thread
,
mb
->
parent
.
parent
.
flag
);
...
...
@@ -2087,7 +2087,7 @@ rt_err_t rt_mb_send_wait(rt_mailbox_t mb,
/* resume suspended thread */
if
(
!
rt_list_isempty
(
&
mb
->
parent
.
suspend_thread
))
{
rt
_ipc_list_resume
(
&
(
mb
->
parent
.
suspend_thread
));
_ipc_list_resume
(
&
(
mb
->
parent
.
suspend_thread
));
/* enable interrupt */
rt_hw_interrupt_enable
(
temp
);
...
...
@@ -2183,7 +2183,7 @@ rt_err_t rt_mb_urgent(rt_mailbox_t mb, rt_ubase_t value)
/* resume suspended thread */
if
(
!
rt_list_isempty
(
&
mb
->
parent
.
suspend_thread
))
{
rt
_ipc_list_resume
(
&
(
mb
->
parent
.
suspend_thread
));
_ipc_list_resume
(
&
(
mb
->
parent
.
suspend_thread
));
/* enable interrupt */
rt_hw_interrupt_enable
(
temp
);
...
...
@@ -2266,7 +2266,7 @@ rt_err_t rt_mb_recv(rt_mailbox_t mb, rt_ubase_t *value, rt_int32_t timeout)
RT_DEBUG_IN_THREAD_CONTEXT
;
/* suspend current thread */
rt
_ipc_list_suspend
(
&
(
mb
->
parent
.
suspend_thread
),
_ipc_list_suspend
(
&
(
mb
->
parent
.
suspend_thread
),
thread
,
mb
->
parent
.
parent
.
flag
);
...
...
@@ -2329,7 +2329,7 @@ rt_err_t rt_mb_recv(rt_mailbox_t mb, rt_ubase_t *value, rt_int32_t timeout)
/* resume suspended thread */
if
(
!
rt_list_isempty
(
&
(
mb
->
suspend_sender_thread
)))
{
rt
_ipc_list_resume
(
&
(
mb
->
suspend_sender_thread
));
_ipc_list_resume
(
&
(
mb
->
suspend_sender_thread
));
/* enable interrupt */
rt_hw_interrupt_enable
(
temp
);
...
...
@@ -2379,9 +2379,9 @@ rt_err_t rt_mb_control(rt_mailbox_t mb, int cmd, void *arg)
level
=
rt_hw_interrupt_disable
();
/* resume all waiting thread */
rt
_ipc_list_resume_all
(
&
(
mb
->
parent
.
suspend_thread
));
_ipc_list_resume_all
(
&
(
mb
->
parent
.
suspend_thread
));
/* also resume all mailbox private suspended thread */
rt
_ipc_list_resume_all
(
&
(
mb
->
suspend_sender_thread
));
_ipc_list_resume_all
(
&
(
mb
->
suspend_sender_thread
));
/* re-init mailbox */
mb
->
entry
=
0
;
...
...
@@ -2478,7 +2478,7 @@ rt_err_t rt_mq_init(rt_mq_t mq,
mq
->
parent
.
parent
.
flag
=
flag
;
/* initialize ipc object */
rt
_ipc_object_init
(
&
(
mq
->
parent
));
_ipc_object_init
(
&
(
mq
->
parent
));
/* set message pool */
mq
->
msg_pool
=
msgpool
;
...
...
@@ -2538,9 +2538,9 @@ rt_err_t rt_mq_detach(rt_mq_t mq)
RT_ASSERT
(
rt_object_is_systemobject
(
&
mq
->
parent
.
parent
));
/* resume all suspended thread */
rt
_ipc_list_resume_all
(
&
mq
->
parent
.
suspend_thread
);
_ipc_list_resume_all
(
&
mq
->
parent
.
suspend_thread
);
/* also resume all message queue private suspended thread */
rt
_ipc_list_resume_all
(
&
(
mq
->
suspend_sender_thread
));
_ipc_list_resume_all
(
&
(
mq
->
suspend_sender_thread
));
/* detach message queue object */
rt_object_detach
(
&
(
mq
->
parent
.
parent
));
...
...
@@ -2602,7 +2602,7 @@ rt_mq_t rt_mq_create(const char *name,
mq
->
parent
.
parent
.
flag
=
flag
;
/* initialize ipc object */
rt
_ipc_object_init
(
&
(
mq
->
parent
));
_ipc_object_init
(
&
(
mq
->
parent
));
/* initialize message queue */
...
...
@@ -2673,9 +2673,9 @@ rt_err_t rt_mq_delete(rt_mq_t mq)
RT_ASSERT
(
rt_object_is_systemobject
(
&
mq
->
parent
.
parent
)
==
RT_FALSE
);
/* resume all suspended thread */
rt
_ipc_list_resume_all
(
&
(
mq
->
parent
.
suspend_thread
));
_ipc_list_resume_all
(
&
(
mq
->
parent
.
suspend_thread
));
/* also resume all message queue private suspended thread */
rt
_ipc_list_resume_all
(
&
(
mq
->
suspend_sender_thread
));
_ipc_list_resume_all
(
&
(
mq
->
suspend_sender_thread
));
/* free message queue pool */
RT_KERNEL_FREE
(
mq
->
msg_pool
);
...
...
@@ -2776,7 +2776,7 @@ rt_err_t rt_mq_send_wait(rt_mq_t mq,
RT_DEBUG_IN_THREAD_CONTEXT
;
/* suspend current thread */
rt
_ipc_list_suspend
(
&
(
mq
->
suspend_sender_thread
),
_ipc_list_suspend
(
&
(
mq
->
suspend_sender_thread
),
thread
,
mq
->
parent
.
parent
.
flag
);
...
...
@@ -2862,7 +2862,7 @@ rt_err_t rt_mq_send_wait(rt_mq_t mq,
/* resume suspended thread */
if
(
!
rt_list_isempty
(
&
mq
->
parent
.
suspend_thread
))
{
rt
_ipc_list_resume
(
&
(
mq
->
parent
.
suspend_thread
));
_ipc_list_resume
(
&
(
mq
->
parent
.
suspend_thread
));
/* enable interrupt */
rt_hw_interrupt_enable
(
temp
);
...
...
@@ -2991,7 +2991,7 @@ rt_err_t rt_mq_urgent(rt_mq_t mq, const void *buffer, rt_size_t size)
/* resume suspended thread */
if
(
!
rt_list_isempty
(
&
mq
->
parent
.
suspend_thread
))
{
rt
_ipc_list_resume
(
&
(
mq
->
parent
.
suspend_thread
));
_ipc_list_resume
(
&
(
mq
->
parent
.
suspend_thread
));
/* enable interrupt */
rt_hw_interrupt_enable
(
temp
);
...
...
@@ -3081,7 +3081,7 @@ rt_err_t rt_mq_recv(rt_mq_t mq,
}
/* suspend current thread */
rt
_ipc_list_suspend
(
&
(
mq
->
parent
.
suspend_thread
),
_ipc_list_suspend
(
&
(
mq
->
parent
.
suspend_thread
),
thread
,
mq
->
parent
.
parent
.
flag
);
...
...
@@ -3157,7 +3157,7 @@ rt_err_t rt_mq_recv(rt_mq_t mq,
/* resume suspended thread */
if
(
!
rt_list_isempty
(
&
(
mq
->
suspend_sender_thread
)))
{
rt
_ipc_list_resume
(
&
(
mq
->
suspend_sender_thread
));
_ipc_list_resume
(
&
(
mq
->
suspend_sender_thread
));
/* enable interrupt */
rt_hw_interrupt_enable
(
temp
);
...
...
@@ -3208,9 +3208,9 @@ rt_err_t rt_mq_control(rt_mq_t mq, int cmd, void *arg)
level
=
rt_hw_interrupt_disable
();
/* resume all waiting thread */
rt
_ipc_list_resume_all
(
&
mq
->
parent
.
suspend_thread
);
_ipc_list_resume_all
(
&
mq
->
parent
.
suspend_thread
);
/* also resume all message queue private suspended thread */
rt
_ipc_list_resume_all
(
&
(
mq
->
suspend_sender_thread
));
_ipc_list_resume_all
(
&
(
mq
->
suspend_sender_thread
));
/* release all message in the queue */
while
(
mq
->
msg_queue_head
!=
RT_NULL
)
...
...
src/kservice.c
浏览文件 @
b104bbc4
...
...
@@ -198,6 +198,7 @@ RT_WEAK void *rt_memset(void *s, int c, rt_ubase_t count)
}
RTM_EXPORT
(
rt_memset
);
#ifndef RT_USING_ASM_MEMCPY
/**
* This function will copy memory content from source address to destination
* address.
...
...
@@ -208,7 +209,7 @@ RTM_EXPORT(rt_memset);
*
* @return the address of destination memory
*/
RT_WEAK
void
*
rt_memcpy
(
void
*
dst
,
const
void
*
src
,
rt_ubase_t
count
)
void
*
rt_memcpy
(
void
*
dst
,
const
void
*
src
,
rt_ubase_t
count
)
{
#ifdef RT_KSERVICE_USING_TINY_SIZE
char
*
tmp
=
(
char
*
)
dst
,
*
s
=
(
char
*
)
src
;
...
...
@@ -280,6 +281,7 @@ RT_WEAK void *rt_memcpy(void *dst, const void *src, rt_ubase_t count)
#endif
/* RT_KSERVICE_USING_TINY_SIZE */
}
RTM_EXPORT
(
rt_memcpy
);
#endif
/* RT_USING_ASM_MEMCPY */
#ifndef RT_KSERVICE_USING_STDLIB
...
...
src/scheduler.c
浏览文件 @
b104bbc4
...
...
@@ -23,7 +23,7 @@
* 2013-12-21 Grissiom add rt_critical_level
* 2018-11-22 Jesven remove the current task from ready queue
* add per cpu ready queue
* add _get_highest_priority_thread to find highest priority task
* add _
scheduler_
get_highest_priority_thread to find highest priority task
* rt_schedule_insert_thread won't insert current task to ready queue
* in smp version, rt_hw_context_switch_interrupt maybe switch to
* new task directly
...
...
@@ -119,7 +119,7 @@ static void _rt_scheduler_stack_check(struct rt_thread *thread)
* get the highest priority thread in ready queue
*/
#ifdef RT_USING_SMP
static
struct
rt_thread
*
_get_highest_priority_thread
(
rt_ubase_t
*
highest_prio
)
static
struct
rt_thread
*
_
scheduler_
get_highest_priority_thread
(
rt_ubase_t
*
highest_prio
)
{
register
struct
rt_thread
*
highest_priority_thread
;
register
rt_ubase_t
highest_ready_priority
,
local_highest_ready_priority
;
...
...
@@ -155,7 +155,7 @@ static struct rt_thread* _get_highest_priority_thread(rt_ubase_t *highest_prio)
return
highest_priority_thread
;
}
#else
static
struct
rt_thread
*
_get_highest_priority_thread
(
rt_ubase_t
*
highest_prio
)
static
struct
rt_thread
*
_
scheduler_
get_highest_priority_thread
(
rt_ubase_t
*
highest_prio
)
{
register
struct
rt_thread
*
highest_priority_thread
;
register
rt_ubase_t
highest_ready_priority
;
...
...
@@ -241,7 +241,7 @@ void rt_system_scheduler_start(void)
register
struct
rt_thread
*
to_thread
;
rt_ubase_t
highest_ready_priority
;
to_thread
=
_get_highest_priority_thread
(
&
highest_ready_priority
);
to_thread
=
_
scheduler_
get_highest_priority_thread
(
&
highest_ready_priority
);
#ifdef RT_USING_SMP
to_thread
->
oncpu
=
rt_hw_cpu_id
();
...
...
@@ -329,7 +329,7 @@ void rt_schedule(void)
if
(
rt_thread_ready_priority_group
!=
0
||
pcpu
->
priority_group
!=
0
)
{
to_thread
=
_get_highest_priority_thread
(
&
highest_ready_priority
);
to_thread
=
_
scheduler_
get_highest_priority_thread
(
&
highest_ready_priority
);
current_thread
->
oncpu
=
RT_CPU_DETACHED
;
if
((
current_thread
->
stat
&
RT_THREAD_STAT_MASK
)
==
RT_THREAD_RUNNING
)
{
...
...
@@ -429,7 +429,7 @@ void rt_schedule(void)
/* need_insert_from_thread: need to insert from_thread to ready queue */
int
need_insert_from_thread
=
0
;
to_thread
=
_get_highest_priority_thread
(
&
highest_ready_priority
);
to_thread
=
_
scheduler_
get_highest_priority_thread
(
&
highest_ready_priority
);
if
((
rt_current_thread
->
stat
&
RT_THREAD_STAT_MASK
)
==
RT_THREAD_RUNNING
)
{
...
...
@@ -582,7 +582,7 @@ void rt_scheduler_do_irq_switch(void *context)
if
(
rt_thread_ready_priority_group
!=
0
||
pcpu
->
priority_group
!=
0
)
{
to_thread
=
_get_highest_priority_thread
(
&
highest_ready_priority
);
to_thread
=
_
scheduler_
get_highest_priority_thread
(
&
highest_ready_priority
);
current_thread
->
oncpu
=
RT_CPU_DETACHED
;
if
((
current_thread
->
stat
&
RT_THREAD_STAT_MASK
)
==
RT_THREAD_RUNNING
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录