mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-02-08 03:03:07 +08:00
Merge branch 'master' into security
This commit is contained in:
@@ -27,3 +27,4 @@ As part of this pull request, I've considered the following:
|
||||
- [ ] All modifications to BSP are justified and do not affect other components or BSPs.
|
||||
- [ ] I've commented appropriately where code is tricky.
|
||||
- [ ] Code in this PR is of high quality.
|
||||
- [ ] This PR complies with [RT-Thread code specification](../documentation/coding_style_en.txt)
|
||||
|
||||
@@ -27,3 +27,4 @@
|
||||
- [ ] 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或
|
||||
- [ ] 对难懂代码均提供对应的注释
|
||||
- [ ] 本拉取/合并请求代码是高质量的
|
||||
- [ ] 本拉取/合并符合[RT-Thread代码规范](../documentation/coding_style_cn.md)
|
||||
|
||||
@@ -27,3 +27,4 @@
|
||||
- [ ] 所有變更均有原因及合理的,並且不會影響到其他軟件組件代碼或
|
||||
- [ ] 對難懂代碼均提供對應的註釋
|
||||
- [ ] 本拉取/合並請求代碼是高質量的
|
||||
- [ ] 本拉取/合並符合[RT-Thread代碼規範](../documentation/coding_style_cn.md)
|
||||
|
||||
3
.github/ISSUE_TEMPLATE.md
vendored
Normal file
3
.github/ISSUE_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<!--- 请清晰详细地描述你遇到的问题,描述问题时请给出芯片/BSP/工具链,RT-Thread版本,复现步骤及现象或者有条理地描述你的问题。在问题得到解决后,请及时关闭issue。欢迎到论坛提问:https://club.rt-thread.org/ -->
|
||||
|
||||
<!--- Please describe your problem clearly and in detail. When describing the problem, please use numbers or bullet points to describe your problem coherently. After the problem is resolved, please close the issue in time. Welcome to the forum to ask questions: https://club.rt-thread.io/ -->
|
||||
1
.github/PULL_REQUEST_TEMPLATE.md
vendored
1
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -31,3 +31,4 @@ The following content must not be changed in the submitted PR message. Otherwise
|
||||
- [ ] 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或BSP All modifications are justified and not affect other components or BSP
|
||||
- [ ] 对难懂代码均提供对应的注释 I've commented appropriately where code is tricky
|
||||
- [ ] 本拉取/合并请求代码是高质量的 Code in this PR is of high quality
|
||||
- [ ] 本拉取/合并符合[RT-Thread代码规范](../documentation/coding_style_cn.md) This PR complies with [RT-Thread code specification](../documentation/coding_style_en.txt)
|
||||
|
||||
19
.github/workflows/action.yml
vendored
19
.github/workflows/action.yml
vendored
@@ -78,9 +78,12 @@ jobs:
|
||||
- {RTT_BSP: "stm32/stm32f103-onenet-nbiot", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "stm32/stm32f103-yf-ufun", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "stm32/stm32f107-uc-eval", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "stm32/stm32f207-st-nucleo", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "stm32/stm32f302-st-nucleo", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "stm32/stm32f401-st-nucleo", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "stm32/stm32f405-smdz-breadfruit", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "stm32/stm32f407-atk-explorer", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "stm32/stm32f407-robomaster-c", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "stm32/stm32f407-st-discovery", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "stm32/stm32f410-st-nucleo", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "stm32/stm32f411-atk-nano", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
@@ -96,7 +99,7 @@ jobs:
|
||||
- {RTT_BSP: "stm32/stm32f469-st-disco", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "stm32/stm32f746-st-disco", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "stm32/stm32f767-atk-apollo", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "stm32/stm32f767-fire-challenger", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "stm32/stm32f767-fire-challenger-v1", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "stm32/stm32f767-st-nucleo", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "stm32/stm32g070-st-nucleo", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "stm32/stm32g071-st-nucleo", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
@@ -104,7 +107,9 @@ jobs:
|
||||
- {RTT_BSP: "stm32/stm32h743-atk-apollo", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "stm32/stm32h743-st-nucleo", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "stm32/stm32h747-st-discovery", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "stm32/stm32h750-artpi-h750", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "stm32/stm32l4r9-st-eval", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "stm32/stm32l4r9-st-sensortile-box", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "stm32/stm32l010-st-nucleo", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "stm32/stm32l053-st-nucleo", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "stm32/stm32l412-st-nucleo", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
@@ -118,19 +123,17 @@ jobs:
|
||||
- {RTT_BSP: "stm32/stm32mp157a-st-discovery", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "stm32/stm32mp157a-st-ev1", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "stm32/stm32wb55-st-nucleo", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "stm32f20x", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "swm320", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "swm320-lq100", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "beaglebone", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "zynq7000", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "zynqmp-r5-axu4ev", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "frdm-k64f", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "fh8620", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "xplorer4330/M4", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {RTT_BSP: "at32/at32f403a-start", RTT_TOOL_CHAIN: "sourcery-arm"}
|
||||
- {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
|
||||
@@ -150,10 +153,10 @@ jobs:
|
||||
if: ${{ matrix.legs.RTT_TOOL_CHAIN == 'sourcery-arm' && success() }}
|
||||
shell: bash
|
||||
run: |
|
||||
wget -q https://github.com/RT-Thread/toolchains-ci/releases/download/arm-2017q2-v6/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2
|
||||
sudo tar xjf gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 -C /opt
|
||||
/opt/gcc-arm-none-eabi-6-2017-q2-update/bin/arm-none-eabi-gcc --version
|
||||
echo "RTT_EXEC_PATH=/opt/gcc-arm-none-eabi-6-2017-q2-update/bin" >> $GITHUB_ENV
|
||||
wget -q https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
|
||||
sudo tar xjf gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 -C /opt
|
||||
/opt/gcc-arm-none-eabi-10-2020-q4-major/bin/arm-none-eabi-gcc --version
|
||||
echo "RTT_EXEC_PATH=/opt/gcc-arm-none-eabi-10-2020-q4-major/bin" >> $GITHUB_ENV
|
||||
|
||||
- name: Install Mips ToolChains
|
||||
if: ${{ matrix.legs.RTT_TOOL_CHAIN == 'sourcery-mips' && success() }}
|
||||
|
||||
71
.github/workflows/action_utest.yml
vendored
Normal file
71
.github/workflows/action_utest.yml
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
name: AutoTestCI
|
||||
|
||||
# Controls when the action will run. Triggers the workflow on push or pull request
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
name: ${{ matrix.legs.UTEST }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
legs:
|
||||
- {UTEST: "kernel/mem", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", CONFIG_FILE: "kernel/mem.conf", SD_FILE: "sd.bin"}
|
||||
- {UTEST: "kernel/ipc", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", CONFIG_FILE: "kernel/ipc.conf", SD_FILE: "sd.bin"}
|
||||
- {UTEST: "components/utest", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", CONFIG_FILE: "utest_self/self.conf", SD_FILE: "sd.bin"}
|
||||
- {UTEST: "kernel/mem/riscv64", RTT_BSP: "bsp/qemu-riscv-virt64", QEMU_ARCH: "riscv64", QEMU_MACHINE: "virt", CONFIG_FILE: "kernel/mem.conf", SD_FILE: "None"}
|
||||
env:
|
||||
TEST_QEMU_ARCH: ${{ matrix.legs.QEMU_ARCH }}
|
||||
TEST_QEMU_MACHINE: ${{ matrix.legs.QEMU_MACHINE }}
|
||||
TEST_BSP_ROOT: ${{ matrix.legs.RTT_BSP }}
|
||||
TEST_CONFIG_FILE: ${{ matrix.legs.CONFIG_FILE }}
|
||||
TEST_SD_FILE: ${{ matrix.legs.SD_FILE }}
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Install Tools
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -yqq install scons qemu-system git
|
||||
|
||||
- name: Install Arm ToolChains
|
||||
if: ${{ matrix.legs.QEMU_ARCH == 'arm' && success() }}
|
||||
shell: bash
|
||||
run: |
|
||||
wget -q https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
|
||||
sudo tar xjf gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 -C /opt
|
||||
/opt/gcc-arm-none-eabi-10-2020-q4-major/bin/arm-none-eabi-gcc --version
|
||||
echo "RTT_EXEC_PATH=/opt/gcc-arm-none-eabi-10-2020-q4-major/bin" >> $GITHUB_ENV
|
||||
|
||||
- name: Install RISC-V ToolChains
|
||||
if: ${{ matrix.legs.QEMU_ARCH == 'riscv64' && success() }}
|
||||
run: |
|
||||
wget -q https://static.dev.sifive.com/dev-tools/freedom-tools/v2020.12/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14.tar.gz
|
||||
sudo tar zxvf riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14.tar.gz -C /opt
|
||||
/opt/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14/bin/riscv64-unknown-elf-gcc --version
|
||||
echo "RTT_EXEC_PATH=/opt/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14/bin" >> $GITHUB_ENV
|
||||
|
||||
- name: Build BSP
|
||||
run: |
|
||||
echo CONFIG_RT_USING_UTESTCASES=y >> $TEST_BSP_ROOT/.config
|
||||
cat examples/utest/configs/$TEST_CONFIG_FILE >> $TEST_BSP_ROOT/.config
|
||||
scons --pyconfig-silent -C $TEST_BSP_ROOT
|
||||
scons -j$(nproc) -C $TEST_BSP_ROOT
|
||||
|
||||
- name: Start Test
|
||||
if: ${{ success() }}
|
||||
run: |
|
||||
git clone https://github.com/armink/UtestRunner.git
|
||||
pushd $TEST_BSP_ROOT
|
||||
dd if=/dev/zero of=sd.bin bs=1024 count=65536
|
||||
popd
|
||||
pushd UtestRunner
|
||||
if [ $TEST_SD_FILE != "None" ]; then
|
||||
python3 qemu_runner.py --system $TEST_QEMU_ARCH --machine $TEST_QEMU_MACHINE --elf ../$TEST_BSP_ROOT/rtthread.elf --sd ../$TEST_BSP_ROOT/$TEST_SD_FILE
|
||||
else
|
||||
python3 qemu_runner.py --system $TEST_QEMU_ARCH --machine $TEST_QEMU_MACHINE --elf ../$TEST_BSP_ROOT/rtthread.elf
|
||||
fi
|
||||
cat rtt_console.log
|
||||
popd
|
||||
20
.github/workflows/file_check.yml
vendored
Normal file
20
.github/workflows/file_check.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
name: Check File Format and License
|
||||
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
scancode_job:
|
||||
runs-on: ubuntu-latest
|
||||
name: Scan code format and license
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@master
|
||||
with:
|
||||
python-version: 3.8
|
||||
|
||||
- name: Check Format and License
|
||||
shell: bash
|
||||
run: |
|
||||
pip install click chardet PyYaml
|
||||
python tools/file_check.py check 'https://github.com/RT-Thread/rt-thread' 'master'
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -35,3 +35,6 @@ ncscope.*
|
||||
#ctag files
|
||||
tags
|
||||
|
||||
.idea
|
||||
CMakeLists.txt
|
||||
cmake-build-debug
|
||||
|
||||
14
.ignore_format.yml
Normal file
14
.ignore_format.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
# files format check exclude path, please follow the instructions below to modify;
|
||||
# If you need to exclude an entire folder, add the folder path in dir_path;
|
||||
# If you need to exclude a file, add the path to the file in file_path.
|
||||
|
||||
file_path:
|
||||
- bsp/allwinner_tina/libcpu/cpu.c
|
||||
|
||||
dir_path:
|
||||
- tools
|
||||
- components/net/lwip-1.4.1
|
||||
- components/net/lwip-2.0.2
|
||||
- components/net/lwip-2.0.3
|
||||
- components/net/lwip-2.1.2
|
||||
- bsp/mm32f327x/Libraries
|
||||
3
Jenkinsfile
vendored
3
Jenkinsfile
vendored
@@ -29,7 +29,6 @@ pipeline {
|
||||
// ['gd32e230k-start', 'sourcery-arm'], /* CI compile not support */
|
||||
['gd32303e-eval', 'sourcery-arm'],
|
||||
// ['gd32450z-eval', 'sourcery-arm'], /* CI link not support */
|
||||
['gkipc', 'sourcery-arm'],
|
||||
['imx6sx/cortex-a9', 'sourcery-arm'],
|
||||
// ['imxrt/imxrt1052-atk-commander', 'sourcery-arm'], /* CI compile not support */
|
||||
// ['imxrt/imxrt1052-fire-pro', 'sourcery-arm'], /* CI compile not support */
|
||||
@@ -107,9 +106,7 @@ pipeline {
|
||||
['stm32f20x', 'sourcery-arm'],
|
||||
['swm320-lq100', 'sourcery-arm'],
|
||||
['beaglebone', 'sourcery-arm'],
|
||||
['zynq7000', 'sourcery-arm'],
|
||||
['frdm-k64f', 'sourcery-arm'],
|
||||
['fh8620', 'sourcery-arm'],
|
||||
['xplorer4330/M4', 'sourcery-arm'],
|
||||
// ['at32/at32f403a-start', 'sourcery-arm'],/* CI link not support */
|
||||
// ['at32/at32f407-start', 'sourcery-arm']/* CI compile C99 not support */
|
||||
|
||||
1
Kconfig
1
Kconfig
@@ -1,3 +1,4 @@
|
||||
source "$RTT_DIR/src/Kconfig"
|
||||
source "$RTT_DIR/libcpu/Kconfig"
|
||||
source "$RTT_DIR/components/Kconfig"
|
||||
source "$RTT_DIR/examples/utest/testcases/Kconfig"
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
/*
|
||||
* File : application.c
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2006-2014, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rt-thread.org/license/LICENSE
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
@@ -32,10 +28,10 @@ int rt_application_init()
|
||||
|
||||
tid = rt_thread_create("init",
|
||||
rt_init_thread_entry,
|
||||
RT_NULL,
|
||||
RT_NULL,
|
||||
2048,
|
||||
RT_THREAD_PRIORITY_MAX/3,
|
||||
20);
|
||||
RT_THREAD_PRIORITY_MAX/3,
|
||||
20);
|
||||
|
||||
if (tid != RT_NULL)
|
||||
rt_thread_startup(tid);
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
/*
|
||||
* File : board.c
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2009-2014, RT-Thread Develop Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rt-thread.org/license/LICENSE
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
/*
|
||||
* File : board.h
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2009-2014, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rt-thread.org/license/LICENSE
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
@@ -18,7 +14,7 @@
|
||||
#include "cmem7_includes.h"
|
||||
//#include "cmem7_retarget.h"
|
||||
|
||||
#define SRAM_SIZE 64 // KB
|
||||
#define SRAM_SIZE 64 // KB
|
||||
#define SRAM_END (0x20000000 + SRAM_SIZE * 1024)
|
||||
|
||||
//#define RT_USING_UART0
|
||||
|
||||
@@ -91,6 +91,7 @@
|
||||
|
||||
/* SECTION: lwip, a lighwight TCP/IP protocol stack */
|
||||
#define RT_USING_LWIP
|
||||
#define RT_USING_LWIP203
|
||||
/* Enable ICMP protocol*/
|
||||
#define RT_LWIP_ICMP
|
||||
/* Enable UDP protocol*/
|
||||
|
||||
719
bsp/Copyright_Notice.md
Normal file
719
bsp/Copyright_Notice.md
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* File : main.c
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2017, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* File : board.c
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2017, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* File : board.h
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2017, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* File : drv_clock.c
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2017, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
@@ -541,7 +527,7 @@ rt_err_t mmc_set_clk(enum mmc_clk_id clk_id, int hz)
|
||||
*mmc_clk &= ~(0x1 << 31);
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
|
||||
if (hz <= 24000000)
|
||||
{
|
||||
pll = (0x0 << 24);
|
||||
@@ -593,7 +579,7 @@ rt_err_t mmc_set_clk(enum mmc_clk_id clk_id, int hz)
|
||||
oclk_dly = 1;
|
||||
sclk_dly = 4;
|
||||
}
|
||||
|
||||
|
||||
*mmc_clk = (0x1 << 31) | pll | (sclk_dly << 20) | \
|
||||
(n << 16) | (oclk_dly << 8) | (div - 1);
|
||||
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* File : drv_clock.h
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2017, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
@@ -252,4 +238,4 @@ rt_err_t dram_gate_clk_enable(enum dram_gate dram_gate);
|
||||
rt_err_t dram_gate_clk_disable(enum dram_gate dram_gate);
|
||||
|
||||
rt_err_t mmc_set_clk(enum mmc_clk_id clk_id, int hz);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* File : drv_gpio.c
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2017, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* File : drv_gpio.h
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2017, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
@@ -241,4 +227,4 @@ void gpio_set_debounce(enum gpio_port port, rt_uint8_t prescaler);
|
||||
void gpio_set_irq_callback(enum gpio_port port, enum gpio_pin pin, void (*irq_cb)(void *), void *irq_arg);
|
||||
int rt_hw_gpio_init(void);
|
||||
|
||||
#endif /* __DRV_GPIO_H__ */
|
||||
#endif /* __DRV_GPIO_H__ */
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* File : drv_sdio.c
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2017, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
@@ -34,10 +20,10 @@
|
||||
|
||||
|
||||
#define DBG_TAG "MMC"
|
||||
// #define DBG_LVL DBG_LOG
|
||||
// #define DBG_LVL DBG_INFO
|
||||
// #define DBG_LVL DBG_LOG
|
||||
// #define DBG_LVL DBG_INFO
|
||||
#define DBG_LVL DBG_WARNING
|
||||
// #define DBG_LVL DBG_ERROR
|
||||
// #define DBG_LVL DBG_ERROR
|
||||
#include <rtdbg.h>
|
||||
|
||||
#ifdef RT_USING_SDIO
|
||||
@@ -47,12 +33,12 @@
|
||||
struct mmc_xfe_des
|
||||
{
|
||||
rt_uint32_t size; /* block size */
|
||||
rt_uint32_t num; /* block num */
|
||||
rt_uint8_t *buff; /* buff addr */
|
||||
rt_uint32_t flag; /* write or read or stream */
|
||||
#define MMC_DATA_WRITE (1 << 0)
|
||||
#define MMC_DATA_READ (1 << 1)
|
||||
#define MMC_DATA_STREAM (1 << 2)
|
||||
rt_uint32_t num; /* block num */
|
||||
rt_uint8_t *buff; /* buff addr */
|
||||
rt_uint32_t flag; /* write or read or stream */
|
||||
#define MMC_DATA_WRITE (1 << 0)
|
||||
#define MMC_DATA_READ (1 << 1)
|
||||
#define MMC_DATA_STREAM (1 << 2)
|
||||
};
|
||||
|
||||
struct mmc_flag
|
||||
@@ -71,7 +57,7 @@ struct sdio_drv
|
||||
tina_mmc_t mmc_des;
|
||||
rt_uint8_t *mmc_buf;
|
||||
rt_uint8_t usedma;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#ifdef CONFIG_MMC_USE_DMA
|
||||
@@ -136,7 +122,7 @@ static int mmc_update_clk(tina_mmc_t mmc)
|
||||
mmc->risr_reg = mmc->risr_reg;
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
|
||||
static rt_err_t mmc_trans_data_by_dma(tina_mmc_t mmc, struct mmc_xfe_des *xfe)
|
||||
{
|
||||
ALIGN(32) static struct mmc_des_v4p1 pdes[128]; // mast ALIGN(32)
|
||||
@@ -145,7 +131,7 @@ static rt_err_t mmc_trans_data_by_dma(tina_mmc_t mmc, struct mmc_xfe_des *xfe)
|
||||
unsigned length = xfe->size * xfe->num;
|
||||
unsigned buff_frag_num = length >> SDXC_DES_NUM_SHIFT;
|
||||
unsigned remain = length & (SDXC_DES_BUFFER_MAX_LEN - 1);
|
||||
|
||||
|
||||
if (remain)
|
||||
{
|
||||
buff_frag_num ++;
|
||||
@@ -156,7 +142,7 @@ static rt_err_t mmc_trans_data_by_dma(tina_mmc_t mmc, struct mmc_xfe_des *xfe)
|
||||
}
|
||||
memset(pdes, 0, sizeof(pdes));
|
||||
mmu_clean_dcache((rt_uint32_t)(xfe->buff), length);
|
||||
for (i = 0, des_idx = 0; i < buff_frag_num; i++, des_idx++)
|
||||
for (i = 0, des_idx = 0; i < buff_frag_num; i++, des_idx++)
|
||||
{
|
||||
// memset((void*)&pdes[des_idx], 0, sizeof(struct mmc_v4p1));
|
||||
pdes[des_idx].des_chain = 1;
|
||||
@@ -182,8 +168,8 @@ static rt_err_t mmc_trans_data_by_dma(tina_mmc_t mmc, struct mmc_xfe_des *xfe)
|
||||
pdes[des_idx].last_des = 1;
|
||||
pdes[des_idx].end_of_ring = 1;
|
||||
pdes[des_idx].buf_addr_ptr2 = 0;
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
pdes[des_idx].buf_addr_ptr2 = (unsigned long)&pdes[des_idx+1];
|
||||
}
|
||||
@@ -217,7 +203,7 @@ static rt_err_t mmc_trans_data_by_dma(tina_mmc_t mmc, struct mmc_xfe_des *xfe)
|
||||
mmc->dmac_reg = (1 << 1) | (1 << 7); /* idma on */
|
||||
rval = mmc->idie_reg & (~3);
|
||||
if (xfe->flag == MMC_DATA_WRITE)
|
||||
rval |= (1 << 0);
|
||||
rval |= (1 << 0);
|
||||
else
|
||||
rval |= (1 << 1);
|
||||
mmc->idie_reg = rval;
|
||||
@@ -236,7 +222,7 @@ static rt_err_t mmc_trans_data_by_cpu(tina_mmc_t mmc, struct mmc_xfe_des *xfe)
|
||||
|
||||
if (xfe->flag == MMC_DATA_WRITE)
|
||||
{
|
||||
for (i = 0; i < (byte_cnt >> 2); i++)
|
||||
for (i = 0; i < (byte_cnt >> 2); i++)
|
||||
{
|
||||
while(--timeout && (mmc->star_reg & (1 << 3)));
|
||||
|
||||
@@ -251,7 +237,7 @@ static rt_err_t mmc_trans_data_by_cpu(tina_mmc_t mmc, struct mmc_xfe_des *xfe)
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < (byte_cnt >> 2); i++)
|
||||
for (i = 0; i < (byte_cnt >> 2); i++)
|
||||
{
|
||||
while(--timeout && (mmc->star_reg & (1 << 2)));
|
||||
|
||||
@@ -290,7 +276,7 @@ static rt_err_t mmc_config_clock(tina_mmc_t mmc, int clk)
|
||||
{
|
||||
mmc_set_clk(SDMMC1, clk);
|
||||
}
|
||||
|
||||
|
||||
/* Re-enable card clock */
|
||||
rval = mmc->ckcr_reg;
|
||||
rval |= (0x1 << 16); //(3 << 16);
|
||||
@@ -383,7 +369,7 @@ static int mmc_send_cmd(struct rt_mmcsd_host *host, struct rt_mmcsd_cmd *cmd)
|
||||
cmdval |= (1 << 7);
|
||||
if ((resp_type(cmd) != RESP_R3) && (resp_type(cmd) != RESP_R4))
|
||||
cmdval |= (1 << 8);
|
||||
|
||||
|
||||
if (data)
|
||||
{
|
||||
cmdval |= (1 << 9) | (1 << 13);
|
||||
@@ -606,7 +592,7 @@ static void sdio_request_send(struct rt_mmcsd_host *host, struct rt_mmcsd_req *r
|
||||
|
||||
memset(&sdio->flag, 0, sizeof(struct mmc_flag));
|
||||
mmc_send_cmd(host, req->cmd);
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* File : drv_sdio.h
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2017, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
@@ -133,8 +119,8 @@ REG[31] : Load cmd
|
||||
#define SDXC_UPDATE_CLOCK_CMD BIT(21)
|
||||
#define SDXC_LOAD_CMD BIT(31)
|
||||
|
||||
/*
|
||||
SD status reg
|
||||
/*
|
||||
SD status reg
|
||||
REG[0] : FIFO_RX_LEVEL
|
||||
REG[1] : FIFO_TX_LEVEL
|
||||
REG[2] : FIFO_EMPTY
|
||||
@@ -143,7 +129,7 @@ REG[4-7] : FSM_STA
|
||||
REG[8] : CARD_PRESENT
|
||||
REG[9] : CARD_BUSY
|
||||
REG[10] : FSM_BUSY
|
||||
REG[11-16]: RESP_IDX
|
||||
REG[11-16]: RESP_IDX
|
||||
REG[17-21]: FIFO_LEVEL
|
||||
REG[31] : DMA_REQ
|
||||
*/
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* File : drv_uart.c
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2017, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
@@ -324,4 +310,4 @@ void uart_irq_handler(int irqno, void *param)
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* File : drv_uart.h
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2017, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* File : drv_spi.c
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2017, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* File : drv_spi.h
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2017, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* File : drv_spi_flash.c
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2017, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
@@ -65,4 +51,4 @@ INIT_PREV_EXPORT(rt_hw_spi_flash_with_sfud_init);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
;/*
|
||||
; * File : context_iar.S
|
||||
; * This file is part of RT-Thread RTOS
|
||||
; * COPYRIGHT (C) 2006, RT-Thread Development Team
|
||||
; * Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
; *
|
||||
; * This program is free software; you can redistribute it and/or modify
|
||||
; * it under the terms of the GNU General Public License as published by
|
||||
; * the Free Software Foundation; either version 2 of the License, or
|
||||
; * (at your option) any later version.
|
||||
; *
|
||||
; * This program is distributed in the hope that it will be useful,
|
||||
; * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
; * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
; * GNU General Public License for more details.
|
||||
; *
|
||||
; * You should have received a copy of the GNU General Public License along
|
||||
; * with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
; * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
; * SPDX-License-Identifier: Apache-2.0
|
||||
; *
|
||||
; * Change Logs:
|
||||
; * Date Author Notes
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* File : cpu.c
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2017, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* File : cpuport.c
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2017, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* File : interrupt.c
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2017-2021, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* File : interrupt.h
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2017-2021, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* File : mmu.c
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2017, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* File : mmu.h
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2017, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* File : rt_low_level_init.c
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2017, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* File : stack.c
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2017, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* File : trap.c
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2017, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
/*
|
||||
* File : startup.c
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2006, RT-Thread Develop Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://openlab.rt-thread.com/license/LICENSE
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* File : smartconfig_demo.c
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
/*
|
||||
* File : board.c
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2009 RT-Thread Develop Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rt-thread.org/license/LICENSE
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
@@ -44,7 +40,7 @@ void __wrap_rtl_printf(const char *fmt, ...)
|
||||
* length. */
|
||||
length = rt_vsnprintf(rt_log_buf, sizeof(rt_log_buf) - 1, fmt, args);
|
||||
if (length > RT_CONSOLEBUF_SIZE - 1)
|
||||
length = RT_CONSOLEBUF_SIZE - 1;
|
||||
length = RT_CONSOLEBUF_SIZE - 1;
|
||||
rt_kprintf("%s", rt_log_buf);
|
||||
va_end(args);
|
||||
}
|
||||
@@ -89,11 +85,11 @@ void rt_hw_board_init(void)
|
||||
#ifdef RT_USING_HEAP
|
||||
rt_system_heap_init((void*)HEAP_BEGIN, (void*)HEAP_END);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef RT_USING_COMPONENTS_INIT
|
||||
rt_components_board_init();
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef RT_USING_CONSOLE
|
||||
rt_hw_uart_init();
|
||||
rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
/*
|
||||
* File : board.h
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2009, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rt-thread.org/license/LICENSE
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* File : drv_uart.c
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2017, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
@@ -125,7 +111,7 @@ static int ameba_uart_getc (struct rt_serial_device *serial)
|
||||
{
|
||||
struct device_uart* uart = serial->parent.user_data;
|
||||
|
||||
if(!serial_readable(&uart->serial))
|
||||
if(!serial_readable(&uart->serial))
|
||||
return -1;
|
||||
|
||||
/* Receive Data Available */
|
||||
@@ -140,13 +126,13 @@ static rt_size_t ameba_uart_dma_transmit (struct rt_serial_device *serial, rt_ui
|
||||
static void ameba_uart_irq(uint32_t id, SerialIrq event)
|
||||
{
|
||||
struct rt_serial_device *serial = (struct rt_serial_device *)id;
|
||||
if(event == RxIrq)
|
||||
if(event == RxIrq)
|
||||
{
|
||||
rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_IND);
|
||||
}
|
||||
else if(event == TxIrq)
|
||||
}
|
||||
else if(event == TxIrq)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static rt_err_t dbg_configure(struct rt_serial_device *serial, struct serial_configure *cfg);
|
||||
@@ -155,7 +141,7 @@ static int dbg_putc(struct rt_serial_device *serial, char c);
|
||||
static int dbg_getc(struct rt_serial_device *serial);
|
||||
|
||||
static struct rt_serial_device ameba_dbg_serial;
|
||||
const struct rt_uart_ops _ambed_dbg_ops =
|
||||
const struct rt_uart_ops _ambed_dbg_ops =
|
||||
{
|
||||
dbg_configure,
|
||||
dbg_control,
|
||||
@@ -177,7 +163,7 @@ void dbg_uart_irq_handler(void * data)
|
||||
DiagSetIsrEnReg(0);
|
||||
|
||||
rt_hw_serial_isr(&ameba_dbg_serial, RT_SERIAL_EVENT_RX_IND);
|
||||
|
||||
|
||||
DiagSetIsrEnReg(IrqEn);
|
||||
}
|
||||
|
||||
@@ -192,9 +178,9 @@ static rt_err_t dbg_control(struct rt_serial_device *serial, int cmd, void *arg)
|
||||
|
||||
case RT_DEVICE_CTRL_SET_INT:
|
||||
/* install interrupt */
|
||||
DIAG_UartReInit((IRQ_FUN) dbg_uart_irq_handler);
|
||||
DIAG_UartReInit((IRQ_FUN) dbg_uart_irq_handler);
|
||||
/* Enable the UART Interrupt */
|
||||
NVIC_SetPriority(UART_LOG_IRQ, 10); /* this is rom_code_patch */
|
||||
NVIC_SetPriority(UART_LOG_IRQ, 10); /* this is rom_code_patch */
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -214,12 +200,12 @@ static int dbg_getc(struct rt_serial_device *serial)
|
||||
|
||||
if(!UART_Readable(UART2_DEV))
|
||||
return -1;
|
||||
|
||||
|
||||
c = DiagGetChar(_FALSE);
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* UART Initiation
|
||||
*/
|
||||
@@ -231,7 +217,7 @@ int rt_hw_uart_init(void)
|
||||
#ifdef BSP_USING_UART0
|
||||
{
|
||||
struct device_uart *uart;
|
||||
|
||||
|
||||
serial = &serial0;
|
||||
uart = &uart0;
|
||||
|
||||
@@ -256,7 +242,7 @@ int rt_hw_uart_init(void)
|
||||
|
||||
serial->ops = &_ambed_dbg_ops;
|
||||
serial->config = config;
|
||||
|
||||
|
||||
rt_hw_serial_register(serial,
|
||||
RT_CONSOLE_DEVICE_NAME,
|
||||
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX,
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* File : drv_uart.h
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2017, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* File : drv_wifi.c
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2017, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
@@ -115,7 +101,7 @@ void netif_pre_sleep_processing(void)
|
||||
}
|
||||
|
||||
unsigned char *rltk_wlan_get_ip(int idx)
|
||||
{
|
||||
{
|
||||
struct ameba_wifi *wifi;
|
||||
|
||||
wifi = rthw_wifi_get_dev(idx);
|
||||
@@ -130,7 +116,7 @@ unsigned char *rltk_wlan_get_ip(int idx)
|
||||
|
||||
int netif_is_valid_IP(int idx, unsigned char *ip_dest)
|
||||
{
|
||||
LOG_D("F:%s L:%d is run ip: %d:%d:%d:%d", __FUNCTION__, __LINE__,
|
||||
LOG_D("F:%s L:%d is run ip: %d:%d:%d:%d", __FUNCTION__, __LINE__,
|
||||
ip_dest[0], ip_dest[1], ip_dest[2], ip_dest[3]);
|
||||
return 1;
|
||||
}
|
||||
@@ -376,9 +362,9 @@ static rt_err_t rthw_wlan_join (struct rt_wlan_device *wlan, str
|
||||
ssid = &sta_info->ssid.val[0];
|
||||
if (sta_info->key.len > 0)
|
||||
key = &sta_info->key.val[0];
|
||||
LOG_D("bssid connect bssid: %02x:%02x:%02x:%02x:%02x:%02x ssid:%s ssid_len:%d key:%s key_len%d",
|
||||
LOG_D("bssid connect bssid: %02x:%02x:%02x:%02x:%02x:%02x ssid:%s ssid_len:%d key:%s key_len%d",
|
||||
sta_info->bssid[0],sta_info->bssid[1],sta_info->bssid[2],sta_info->bssid[3],sta_info->bssid[4],sta_info->bssid[5],
|
||||
ssid,
|
||||
ssid,
|
||||
sta_info->ssid.len,
|
||||
key,
|
||||
sta_info->key.len
|
||||
@@ -608,7 +594,7 @@ exit:
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
static const struct rt_wlan_dev_ops ops =
|
||||
static const struct rt_wlan_dev_ops ops =
|
||||
{
|
||||
.wlan_init = rthw_wlan_init ,
|
||||
.wlan_mode = rthw_wlan_mode ,
|
||||
|
||||
@@ -1,27 +1,13 @@
|
||||
/*
|
||||
* File : drv_wifi.h
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2017, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2017-5-30 Bernard the first version
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __DRV_WIFI_H__
|
||||
#define __DRV_WIFI_H__
|
||||
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* File : drv_wlan.c
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2017, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
@@ -151,20 +137,20 @@ int rthw_wifi_ap_start(char *ssid, char *password, int channel)
|
||||
return -1;
|
||||
}
|
||||
|
||||
while(1)
|
||||
while(1)
|
||||
{
|
||||
char essid[33];
|
||||
if(wext_get_ssid(name, (unsigned char *) essid) > 0)
|
||||
{
|
||||
if(strcmp((const char *) essid, (const char *)ssid) == 0)
|
||||
if(strcmp((const char *) essid, (const char *)ssid) == 0)
|
||||
{
|
||||
rt_kprintf("%s started\n", ssid);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(timeout == 0)
|
||||
if(timeout == 0)
|
||||
{
|
||||
rt_kprintf("Start AP timeout\n");
|
||||
rt_kprintf("Start AP timeout\n");
|
||||
return -1;
|
||||
}
|
||||
rt_thread_delay(1 * RT_TICK_PER_SECOND);
|
||||
@@ -183,7 +169,7 @@ static int rthw_wifi_disconnect(char *name)
|
||||
if (name == RT_NULL)
|
||||
return -1;
|
||||
|
||||
if (wext_get_ssid(name, (unsigned char *) essid) < 0)
|
||||
if (wext_get_ssid(name, (unsigned char *) essid) < 0)
|
||||
{
|
||||
rt_kprintf("\nWIFI disconnected!\n");
|
||||
return -1;
|
||||
@@ -203,7 +189,7 @@ static int rthw_wifi_disconnect(char *name)
|
||||
break;
|
||||
}
|
||||
|
||||
if(timeout == 0)
|
||||
if(timeout == 0)
|
||||
{
|
||||
rt_kprintf("ERROR: Deassoc timeout!\n");
|
||||
return -1;
|
||||
@@ -259,7 +245,7 @@ int rthw_wifi_ap_disconnect(void)
|
||||
|
||||
int rthw_wifi_rssi_get(void)
|
||||
{
|
||||
int rssi = 0;
|
||||
int rssi = 0;
|
||||
wifi_get_rssi(&rssi);
|
||||
return rssi;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user