Merge branch '2023_open_source_contest' of https://gitlink.org.cn/xuos/xiuos into pr2
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
# CONFIG_NSH_ARGCAT is not set
|
||||
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
|
||||
# CONFIG_NSH_CMDPARMS is not set
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="aiit-arm32-board"
|
||||
CONFIG_ARCH_BOARD_STM32F4_AIIT=y
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#
|
||||
# CONFIG_NSH_DISABLE_LOSMART is not set
|
||||
# CONFIG_STANDARD_SERIAL is not set
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="risc-v"
|
||||
CONFIG_ARCH_BOARD="aiit-riscv64-board"
|
||||
CONFIG_ARCH_BOARD_AIIT_RISCV64=y
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#
|
||||
# CONFIG_NSH_DISABLE_LOSMART is not set
|
||||
# CONFIG_STANDARD_SERIAL is not set
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="risc-v"
|
||||
CONFIG_ARCH_BOARD="edu-riscv64"
|
||||
CONFIG_ARCH_BOARD_EDU_RISCV64=y
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#
|
||||
# CONFIG_NSH_DISABLE_LOSMART is not set
|
||||
# CONFIG_STANDARD_SERIAL is not set
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="risc-v"
|
||||
CONFIG_ARCH_BOARD="edu-riscv64"
|
||||
CONFIG_ARCH_BOARD_EDU_RISCV64=y
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#
|
||||
# CONFIG_NSH_DISABLE_LOSMART is not set
|
||||
# CONFIG_STANDARD_SERIAL is not set
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="risc-v"
|
||||
CONFIG_ARCH_BOARD="edu-riscv64"
|
||||
CONFIG_ARCH_BOARD_EDU_RISCV64=y
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#
|
||||
# CONFIG_NSH_DISABLE_LOSMART is not set
|
||||
# CONFIG_STANDARD_SERIAL is not set
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="risc-v"
|
||||
CONFIG_ARCH_BOARD="edu-riscv64"
|
||||
CONFIG_ARCH_BOARD_EDU_RISCV64=y
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#
|
||||
# CONFIG_NSH_DISABLE_LOSMART is not set
|
||||
# CONFIG_STANDARD_SERIAL is not set
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="risc-v"
|
||||
CONFIG_ARCH_BOARD="edu-riscv64"
|
||||
CONFIG_ARCH_BOARD_EDU_RISCV64=y
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# CONFIG_NSH_ARGCAT is not set
|
||||
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
|
||||
# CONFIG_NSH_CMDPARMS is not set
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_ARMV7M=y
|
||||
CONFIG_ARCH_CORTEXM4=y
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="sabre-lite"
|
||||
CONFIG_ARCH_BOARD_SABRE_LITE=y
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# modifications.
|
||||
#
|
||||
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_ADDRENV=y
|
||||
CONFIG_ARCH_BOARD="sabre-lite"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# modifications.
|
||||
#
|
||||
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="sabre-lite"
|
||||
CONFIG_ARCH_BOARD_SABRE_LITE=y
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="sabre-lite"
|
||||
CONFIG_ARCH_BOARD_SABRE_LITE=y
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# modifications.
|
||||
#
|
||||
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="sabre-lite"
|
||||
CONFIG_ARCH_BOARD_SABRE_LITE=y
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
/****************************************************************************
|
||||
* boards/arm/imx6/sabre-lite/include/board.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2020 AIIT XUOS Lab
|
||||
* XiOS is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file board.h
|
||||
* @brief sabre-lite board.h file
|
||||
* @version 1.0
|
||||
* @author AIIT XUOS Lab
|
||||
* @date 2023.05.15
|
||||
*/
|
||||
|
||||
#ifndef __BOARDS_ARM_IMX6_SABRE_LITE_INCLUDE_BOARD_H
|
||||
#define __BOARDS_ARM_IMX6_SABRE_LITE_INCLUDE_BOARD_H
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
/****************************************************************************
|
||||
* boards/arm/imx6/sabre-lite/include/board_memorymap.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2020 AIIT XUOS Lab
|
||||
* XiOS is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file board_memorymap.h
|
||||
* @brief sabre-lite board memorymap
|
||||
* @version 1.0
|
||||
* @author AIIT XUOS Lab
|
||||
* @date 2023.05.15
|
||||
*/
|
||||
|
||||
#ifndef __BOARDS_ARM_IMX6_SABRE_LITE_INCLUDE_BOARD_MEMORYMAP_H
|
||||
#define __BOARDS_ARM_IMX6_SABRE_LITE_INCLUDE_BOARD_MEMORYMAP_H
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
/****************************************************************************
|
||||
* boards/arm/imx6/sabre-lite/src/imx_appinit.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2020 AIIT XUOS Lab
|
||||
* XiOS is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file imx_appinit.c
|
||||
* @brief sabre-lite imx_appinit.c file
|
||||
* @version 1.0
|
||||
* @author AIIT XUOS Lab
|
||||
* @date 2023.05.15
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
/****************************************************************************
|
||||
* boards/arm/imx6/sabre-lite/src/imx_autoleds.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2020 AIIT XUOS Lab
|
||||
* XiOS is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file imx_autoleds.c
|
||||
* @brief sabre-lite imx_autoleds.c file
|
||||
* @version 1.0
|
||||
* @author AIIT XUOS Lab
|
||||
* @date 2023.05.15
|
||||
*/
|
||||
|
||||
/* LEDs
|
||||
*
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
/****************************************************************************
|
||||
* boards/arm/imx6/sabre-lite/src/imx_boardinit.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2020 AIIT XUOS Lab
|
||||
* XiOS is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file imx_boardinit.c
|
||||
* @brief sabre-lite imx_boardinit.c file
|
||||
* @version 1.0
|
||||
* @author AIIT XUOS Lab
|
||||
* @date 2023.05.15
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
/****************************************************************************
|
||||
* boards/arm/imx6/sabre-lite/src/imx_bringup.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2020 AIIT XUOS Lab
|
||||
* XiOS is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file imx_bringup.c
|
||||
* @brief sabre-lite imx_bringup.c file
|
||||
* @version 1.0
|
||||
* @author AIIT XUOS Lab
|
||||
* @date 2023.05.15
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
/****************************************************************************
|
||||
* boards/arm/imx6/sabre-lite/src/imx_userleds.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2020 AIIT XUOS Lab
|
||||
* XiOS is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file imx_userleds.c
|
||||
* @brief sabre-lite imx_userleds.c file
|
||||
* @version 1.0
|
||||
* @author AIIT XUOS Lab
|
||||
* @date 2023.05.15
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
/****************************************************************************
|
||||
* boards/arm/imx6/sabre-lite/src/sabre-lite.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2020 AIIT XUOS Lab
|
||||
* XiOS is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file sabre-lite.h
|
||||
* @brief sabre-lite sabre-lite.h file
|
||||
* @version 1.0
|
||||
* @author AIIT XUOS Lab
|
||||
* @date 2023.05.15
|
||||
*/
|
||||
|
||||
#ifndef __BOARDS_ARM_IMX6_SABRE_LITE_SRC_SABRE_LITE_H
|
||||
#define __BOARDS_ARM_IMX6_SABRE_LITE_SRC_SABRE_LITE_H
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="xidatong-arm32"
|
||||
CONFIG_ARCH_BOARD_XIDATONG_ARM32=y
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="xidatong-arm32"
|
||||
CONFIG_ARCH_BOARD_XIDATONG_ARM32=y
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="xidatong-arm32"
|
||||
CONFIG_ARCH_BOARD_XIDATONG_ARM32=y
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="xidatong-arm32"
|
||||
CONFIG_ARCH_BOARD_XIDATONG_ARM32=y
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="xidatong-arm32"
|
||||
CONFIG_ARCH_BOARD_XIDATONG_ARM32=y
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="xidatong-arm32"
|
||||
CONFIG_ARCH_BOARD_XIDATONG_ARM32=y
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# modifications.
|
||||
#
|
||||
# CONFIG_ARCH_LEDS is not set
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="xidatong-arm32"
|
||||
CONFIG_ARCH_BOARD_XIDATONG_ARM32=y
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="xidatong-arm32"
|
||||
CONFIG_ARCH_BOARD_XIDATONG_ARM32=y
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="xidatong-arm32"
|
||||
CONFIG_ARCH_BOARD_XIDATONG_ARM32=y
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="xidatong-arm32"
|
||||
CONFIG_ARCH_BOARD_XIDATONG_ARM32=y
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="xidatong-arm32"
|
||||
CONFIG_ARCH_BOARD_XIDATONG_ARM32=y
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="xidatong-arm32"
|
||||
CONFIG_ARCH_BOARD_XIDATONG_ARM32=y
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#
|
||||
# CONFIG_NSH_DISABLE_LOSMART is not set
|
||||
# CONFIG_STANDARD_SERIAL is not set
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="risc-v"
|
||||
CONFIG_ARCH_BOARD="xidatong-riscv64"
|
||||
CONFIG_ARCH_BOARD_XIDATONG_RISCV64=y
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#
|
||||
# CONFIG_NSH_DISABLE_LOSMART is not set
|
||||
# CONFIG_STANDARD_SERIAL is not set
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="risc-v"
|
||||
CONFIG_ARCH_BOARD="xidatong-riscv64"
|
||||
CONFIG_ARCH_BOARD_XIDATONG_RISCV64=y
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#
|
||||
# CONFIG_NSH_DISABLE_LOSMART is not set
|
||||
# CONFIG_STANDARD_SERIAL is not set
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="risc-v"
|
||||
CONFIG_ARCH_BOARD="xidatong-riscv64"
|
||||
CONFIG_ARCH_BOARD_XIDATONG_RISCV64=y
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
#
|
||||
# CONFIG_NSH_DISABLE_LOSMART is not set
|
||||
# CONFIG_STANDARD_SERIAL is not set
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="risc-v"
|
||||
CONFIG_ARCH_BOARD="xidatong-riscv64"
|
||||
CONFIG_ARCH_BOARD_XIDATONG_RISCV64=y
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#
|
||||
# CONFIG_NSH_DISABLE_LOSMART is not set
|
||||
# CONFIG_STANDARD_SERIAL is not set
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="risc-v"
|
||||
CONFIG_ARCH_BOARD="xidatong-riscv64"
|
||||
CONFIG_ARCH_BOARD_XIDATONG_RISCV64=y
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#
|
||||
# CONFIG_NSH_DISABLE_LOSMART is not set
|
||||
# CONFIG_STANDARD_SERIAL is not set
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="risc-v"
|
||||
CONFIG_ARCH_BOARD="xidatong-riscv64"
|
||||
CONFIG_ARCH_BOARD_XIDATONG_RISCV64=y
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#
|
||||
# CONFIG_NSH_DISABLE_LOSMART is not set
|
||||
# CONFIG_STANDARD_SERIAL is not set
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="risc-v"
|
||||
CONFIG_ARCH_BOARD="xidatong-riscv64"
|
||||
CONFIG_ARCH_BOARD_XIDATONG_RISCV64=y
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
#
|
||||
# CONFIG_NSH_DISABLE_LOSMART is not set
|
||||
# CONFIG_STANDARD_SERIAL is not set
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="risc-v"
|
||||
CONFIG_ARCH_BOARD="xidatong-riscv64"
|
||||
CONFIG_ARCH_BOARD_XIDATONG_RISCV64=y
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
#
|
||||
# CONFIG_NSH_DISABLE_LOSMART is not set
|
||||
# CONFIG_STANDARD_SERIAL is not set
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="risc-v"
|
||||
CONFIG_ARCH_BOARD="xidatong-riscv64"
|
||||
CONFIG_ARCH_BOARD_XIDATONG_RISCV64=y
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#
|
||||
# CONFIG_NSH_DISABLE_LOSMART is not set
|
||||
# CONFIG_STANDARD_SERIAL is not set
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="risc-v"
|
||||
CONFIG_ARCH_BOARD="xidatong-riscv64"
|
||||
CONFIG_ARCH_BOARD_XIDATONG_RISCV64=y
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#
|
||||
# CONFIG_NSH_DISABLE_LOSMART is not set
|
||||
# CONFIG_STANDARD_SERIAL is not set
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="risc-v"
|
||||
CONFIG_ARCH_BOARD="xidatong-riscv64"
|
||||
CONFIG_ARCH_BOARD_XIDATONG_RISCV64=y
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
# CONFIG_NSH_ARGCAT is not set
|
||||
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
|
||||
# CONFIG_NSH_CMDPARMS is not set
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="stm32f4discovery"
|
||||
CONFIG_ARCH_BOARD_STM32F4_DISCOVERY=y
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
# CONFIG_NSH_ARGCAT is not set
|
||||
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
|
||||
# CONFIG_NSH_CMDPARMS is not set
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="stm32f4discovery"
|
||||
CONFIG_ARCH_BOARD_STM32F4_DISCOVERY=y
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
# CONFIG_NSH_ARGCAT is not set
|
||||
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
|
||||
# CONFIG_NSH_CMDPARMS is not set
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="stm32f4discovery"
|
||||
CONFIG_ARCH_BOARD_STM32F4_DISCOVERY=y
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
# CONFIG_NSH_ARGCAT is not set
|
||||
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
|
||||
# CONFIG_NSH_CMDPARMS is not set
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ADD_NUTTX_FEATURES=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="stm32f4discovery"
|
||||
CONFIG_ARCH_BOARD_STM32F4_DISCOVERY=y
|
||||
|
||||
@@ -313,9 +313,9 @@ CONFIG_USB_DEVICE_NAME="usb_dev"
|
||||
# Framework
|
||||
#
|
||||
CONFIG_TRANSFORM_LAYER_ATTRIUBUTE=y
|
||||
# CONFIG_ADD_XIZI_FETURES is not set
|
||||
# CONFIG_ADD_NUTTX_FETURES is not set
|
||||
CONFIG_ADD_RTTHREAD_FETURES=y
|
||||
# CONFIG_ADD_XIZI_FEATURES is not set
|
||||
# CONFIG_ADD_NUTTX_FEATURES is not set
|
||||
CONFIG_ADD_RTTHREAD_FEATURES=y
|
||||
# CONFIG_SUPPORT_SENSOR_FRAMEWORK is not set
|
||||
CONFIG_SUPPORT_CONNECTION_FRAMEWORK=y
|
||||
CONFIG_CONNECTION_FRAMEWORK_DEBUG=y
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
/* Framework */
|
||||
|
||||
#define TRANSFORM_LAYER_ATTRIUBUTE
|
||||
#define ADD_RTTHREAD_FETURES
|
||||
#define ADD_RTTHREAD_FEATURES
|
||||
#define SUPPORT_CONNECTION_FRAMEWORK
|
||||
#define CONNECTION_FRAMEWORK_DEBUG
|
||||
#define ADAPTER_HFA21_DRIVER "/dev/uart3"
|
||||
|
||||
@@ -327,9 +327,9 @@ CONFIG_PKG_KENDRYTE_SDK_VERNUM=0x0055
|
||||
# Framework
|
||||
#
|
||||
CONFIG_TRANSFORM_LAYER_ATTRIUBUTE=y
|
||||
# CONFIG_ADD_XIZI_FETURES is not set
|
||||
# CONFIG_ADD_NUTTX_FETURES is not set
|
||||
CONFIG_ADD_RTTHREAD_FETURES=y
|
||||
# CONFIG_ADD_XIZI_FEATURES is not set
|
||||
# CONFIG_ADD_NUTTX_FEATURES is not set
|
||||
CONFIG_ADD_RTTHREAD_FEATURES=y
|
||||
CONFIG_SUPPORT_SENSOR_FRAMEWORK=y
|
||||
CONFIG_SENSOR_HCHO=y
|
||||
CONFIG_SENSOR_TB600B_WQ_HCHO1OS=y
|
||||
|
||||
@@ -206,7 +206,7 @@
|
||||
/* Framework */
|
||||
|
||||
#define TRANSFORM_LAYER_ATTRIUBUTE
|
||||
#define ADD_RTTHREAD_FETURES
|
||||
#define ADD_RTTHREAD_FEATURES
|
||||
#define SUPPORT_SENSOR_FRAMEWORK
|
||||
#define SENSOR_HCHO
|
||||
#define SENSOR_TB600B_WQ_HCHO1OS
|
||||
|
||||
@@ -465,9 +465,9 @@ CONFIG_OV2640_Y_IMAGE_WINDOWS_SIZE=400
|
||||
# Framework
|
||||
#
|
||||
CONFIG_TRANSFORM_LAYER_ATTRIUBUTE=y
|
||||
CONFIG_ADD_XIZI_FETURES=y
|
||||
# CONFIG_ADD_NUTTX_FETURES is not set
|
||||
# CONFIG_ADD_RTTHREAD_FETURES is not set
|
||||
CONFIG_ADD_XIZI_FEATURES=y
|
||||
# CONFIG_ADD_NUTTX_FEATURES is not set
|
||||
# CONFIG_ADD_RTTHREAD_FEATURES is not set
|
||||
# CONFIG_SUPPORT_SENSOR_FRAMEWORK is not set
|
||||
# CONFIG_SUPPORT_CONNECTION_FRAMEWORK is not set
|
||||
CONFIG_SUPPORT_KNOWING_FRAMEWORK=y
|
||||
|
||||
@@ -318,7 +318,7 @@
|
||||
/* Framework */
|
||||
|
||||
#define TRANSFORM_LAYER_ATTRIUBUTE
|
||||
#define ADD_XIZI_FETURES
|
||||
#define ADD_XIZI_FEATURES
|
||||
#define SUPPORT_KNOWING_FRAMEWORK
|
||||
#define USING_KPU_PROCESSING
|
||||
#define USING_YOLOV2
|
||||
|
||||
@@ -482,9 +482,9 @@ CONFIG_OV2640_Y_IMAGE_WINDOWS_SIZE=400
|
||||
# Framework
|
||||
#
|
||||
CONFIG_TRANSFORM_LAYER_ATTRIUBUTE=y
|
||||
CONFIG_ADD_XIZI_FETURES=y
|
||||
# CONFIG_ADD_NUTTX_FETURES is not set
|
||||
# CONFIG_ADD_RTTHREAD_FETURES is not set
|
||||
CONFIG_ADD_XIZI_FEATURES=y
|
||||
# CONFIG_ADD_NUTTX_FEATURES is not set
|
||||
# CONFIG_ADD_RTTHREAD_FEATURES is not set
|
||||
CONFIG_SUPPORT_SENSOR_FRAMEWORK=y
|
||||
# CONFIG_SENSOR_HCHO is not set
|
||||
# CONFIG_SENSOR_TVOC is not set
|
||||
|
||||
@@ -311,7 +311,7 @@
|
||||
/* Framework */
|
||||
|
||||
#define TRANSFORM_LAYER_ATTRIUBUTE
|
||||
#define ADD_XIZI_FETURES
|
||||
#define ADD_XIZI_FEATURES
|
||||
#define SUPPORT_SENSOR_FRAMEWORK
|
||||
#define SENSOR_VOICE
|
||||
#define SENSOR_D124
|
||||
|
||||
@@ -324,9 +324,9 @@ CONFIG_BSP_USING_USBD=y
|
||||
# Framework
|
||||
#
|
||||
CONFIG_TRANSFORM_LAYER_ATTRIUBUTE=y
|
||||
CONFIG_ADD_XIZI_FETURES=y
|
||||
# CONFIG_ADD_NUTTX_FETURES is not set
|
||||
# CONFIG_ADD_RTTHREAD_FETURES is not set
|
||||
CONFIG_ADD_XIZI_FEATURES=y
|
||||
# CONFIG_ADD_NUTTX_FEATURES is not set
|
||||
# CONFIG_ADD_RTTHREAD_FEATURES is not set
|
||||
# CONFIG_SUPPORT_SENSOR_FRAMEWORK is not set
|
||||
# CONFIG_SUPPORT_CONNECTION_FRAMEWORK is not set
|
||||
# CONFIG_SUPPORT_KNOWING_FRAMEWORK is not set
|
||||
|
||||
@@ -193,7 +193,7 @@
|
||||
/* Framework */
|
||||
|
||||
#define TRANSFORM_LAYER_ATTRIUBUTE
|
||||
#define ADD_XIZI_FETURES
|
||||
#define ADD_XIZI_FEATURES
|
||||
|
||||
/* Security */
|
||||
|
||||
|
||||
@@ -389,9 +389,9 @@ CONFIG_PHY_RESET_PIN=3
|
||||
# Framework
|
||||
#
|
||||
CONFIG_TRANSFORM_LAYER_ATTRIUBUTE=y
|
||||
# CONFIG_ADD_XIZI_FETURES is not set
|
||||
# CONFIG_ADD_NUTTX_FETURES is not set
|
||||
CONFIG_ADD_RTTHREAD_FETURES=y
|
||||
# CONFIG_ADD_XIZI_FEATURES is not set
|
||||
# CONFIG_ADD_NUTTX_FEATURES is not set
|
||||
CONFIG_ADD_RTTHREAD_FEATURES=y
|
||||
# CONFIG_SUPPORT_SENSOR_FRAMEWORK is not set
|
||||
# CONFIG_SUPPORT_CONNECTION_FRAMEWORK is not set
|
||||
# CONFIG_SUPPORT_KNOWING_FRAMEWORK is not set
|
||||
|
||||
@@ -248,7 +248,7 @@
|
||||
/* Framework */
|
||||
|
||||
#define TRANSFORM_LAYER_ATTRIUBUTE
|
||||
#define ADD_RTTHREAD_FETURES
|
||||
#define ADD_RTTHREAD_FEATURES
|
||||
|
||||
/* Security */
|
||||
|
||||
|
||||
@@ -352,9 +352,9 @@ CONFIG_PKG_WIZNET_VER="latest"
|
||||
# Framework
|
||||
#
|
||||
CONFIG_TRANSFORM_LAYER_ATTRIUBUTE=y
|
||||
# CONFIG_ADD_XIZI_FETURES is not set
|
||||
# CONFIG_ADD_NUTTX_FETURES is not set
|
||||
CONFIG_ADD_RTTHREAD_FETURES=y
|
||||
# CONFIG_ADD_XIZI_FEATURES is not set
|
||||
# CONFIG_ADD_NUTTX_FEATURES is not set
|
||||
CONFIG_ADD_RTTHREAD_FEATURES=y
|
||||
# CONFIG_SUPPORT_SENSOR_FRAMEWORK is not set
|
||||
# CONFIG_SUPPORT_CONNECTION_FRAMEWORK is not set
|
||||
# CONFIG_SUPPORT_KNOWING_FRAMEWORK is not set
|
||||
|
||||
@@ -217,7 +217,7 @@
|
||||
/* Framework */
|
||||
|
||||
#define TRANSFORM_LAYER_ATTRIUBUTE
|
||||
#define ADD_RTTHREAD_FETURES
|
||||
#define ADD_RTTHREAD_FEATURES
|
||||
|
||||
/* Security */
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
SRC_FILES := task.c schedule.c ipc.c
|
||||
SRC_FILES := schedule.c ipc.c
|
||||
|
||||
include $(KERNEL_ROOT)/compiler.mk
|
||||
|
||||
@@ -0,0 +1,537 @@
|
||||
|
||||
/*
|
||||
* Copyright (c) 2020 AIIT XUOS Lab
|
||||
* XiUOS is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file: task.c
|
||||
* @brief: file task.c
|
||||
* @version: 1.0
|
||||
* @author: AIIT XUOS Lab
|
||||
* @date: 2023/05/18
|
||||
*
|
||||
*/
|
||||
|
||||
#include <task.h>
|
||||
|
||||
|
||||
// 全局运行队列和本地运行队列
|
||||
tcb_t *global_run_queue_head = NULL;
|
||||
tcb_t *global_run_queue_tail = NULL;
|
||||
tcb_t *local_run_queue_head[8] = {NULL};
|
||||
tcb_t *local_run_queue_tail[8] = {NULL};
|
||||
|
||||
// 当前任务的指针
|
||||
volatile tcb_t *current_task = NULL;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* 函 数 名: tcb_init
|
||||
* 功能描述: 初始化任务控制块
|
||||
* 形 参: tcb:任务控制块指针,priority:任务优先级,stack_size:栈大小
|
||||
* 返 回 值: 无
|
||||
*******************************************************************************/
|
||||
void tcb_init(tcb_t *tcb, int priority, int stack_size) {
|
||||
tcb->priority = priority;
|
||||
tcb->state = TASK_CREATED;
|
||||
tcb->message_queue = NULL;
|
||||
tcb->stack = (uint8_t*)malloc(stack_size);
|
||||
tcb->stack_size = stack_size;
|
||||
tcb->stack_ptr = tcb->stack + stack_size - sizeof(context_t);
|
||||
// 将任务的上下文保存在栈中
|
||||
context_t *context = (context_t*)tcb->stack_ptr;
|
||||
context_init(context, (void*)task_entry, tcb->stack_ptr);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* 函 数 名: tcb_destroy
|
||||
* 功能描述: 销毁任务控制块
|
||||
* 形 参: tcb:任务控制块指针
|
||||
* 返 回 值: 无
|
||||
*******************************************************************************/
|
||||
void tcb_destroy(tcb_t *tcb) {
|
||||
free(tcb->stack_bottom);
|
||||
tcb->stack_ptr = NULL;
|
||||
tcb->stack_bottom = NULL;
|
||||
tcb->stack_size = 0;
|
||||
tcb->state = TASK_BLOCKED;
|
||||
tcb->priority = 0;
|
||||
tcb->next = NULL;
|
||||
if (tcb->message_queue != NULL) {
|
||||
message_queue_destroy(tcb->message_queue);
|
||||
tcb->message_queue = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* 函 数 名: get_current_task
|
||||
* 功能描述: 获取当前任务的指针
|
||||
* 形 参: 无
|
||||
* 返 回 值: 任务控制块指针
|
||||
*******************************************************************************/
|
||||
tcb_t *get_current_task() {
|
||||
return (tcb_t*)current_task;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* 函 数 名: get_local_run_queue_head
|
||||
* 功能描述: 获取本地运行队列的头指针
|
||||
* 形 参: cpu_id:当前cpu的id
|
||||
* 返 回 值: 任务控制块指针
|
||||
*******************************************************************************/
|
||||
tcb_t *get_local_run_queue_head(int cpu_id) {
|
||||
return local_run_queue_head[cpu_id];
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* 函 数 名: add_to_global_run_queue
|
||||
* 功能描述: 将任务添加到全局运行队列中
|
||||
* 形 参: tcb:任务控制块指针
|
||||
* 返 回 值: 无
|
||||
*******************************************************************************/
|
||||
void add_to_global_run_queue(tcb_t *tcb) {
|
||||
// 将任务添加到全局运行队列的尾部
|
||||
if (global_run_queue_head == NULL) {
|
||||
global_run_queue_head = tcb;
|
||||
global_run_queue_tail = tcb;
|
||||
} else {
|
||||
global_run_queue_tail->next = tcb;
|
||||
global_run_queue_tail = tcb;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* 函 数 名: take_from_global_run_queue
|
||||
* 功能描述: 从全局运行队列中取出一个任务
|
||||
* 形 参: 无
|
||||
* 返 回 值: tcb:任务控制块指针
|
||||
*******************************************************************************/
|
||||
tcb_t *take_from_global_run_queue() {
|
||||
// 从全局运行队列的头部取出一个任务
|
||||
if (global_run_queue_head == NULL) {
|
||||
return NULL;
|
||||
} else {
|
||||
tcb_t *tcb = global_run_queue_head;
|
||||
global_run_queue_head = tcb->next;
|
||||
if (global_run_queue_head == NULL) {
|
||||
global_run_queue_tail = NULL;
|
||||
}
|
||||
return tcb;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* 函 数 名: add_to_local_run_queue
|
||||
* 功能描述: 将任务添加到本地运行队列中
|
||||
* 形 参: tcb:任务控制块指针,cpu_id:任务绑定的CPU id
|
||||
* 返 回 值: 无
|
||||
*******************************************************************************/
|
||||
void add_to_local_run_queue(tcb_t *tcb, int cpu_id) {
|
||||
// 将任务添加到本地运行队列的尾部
|
||||
if (local_run_queue_head[cpu_id] == NULL) {
|
||||
local_run_queue_head[cpu_id] = tcb;
|
||||
local_run_queue_tail[cpu_id] = tcb;
|
||||
} else {
|
||||
local_run_queue_tail[cpu_id]->next = tcb;
|
||||
local_run_queue_tail[cpu_id] = tcb;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* 函 数 名: take_from_local_run_queue
|
||||
* 功能描述: 从本地运行队列中取出一个任务
|
||||
* 形 参: cpu_id:CPU id
|
||||
* 返 回 值: 无
|
||||
*******************************************************************************/
|
||||
tcb_t *take_from_local_run_queue(int cpu_id) {
|
||||
// 从本地运行队列的头部取出一个任务
|
||||
if (local_run_queue_head[cpu_id] == NULL) {
|
||||
return NULL;
|
||||
} else {
|
||||
tcb_t *tcb = local_run_queue_head[cpu_id];
|
||||
local_run_queue_head[cpu_id] = tcb->next;
|
||||
if (local_run_queue_head[cpu_id] == NULL) {
|
||||
local_run_queue_tail[cpu_id] = NULL;
|
||||
}
|
||||
return tcb;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* 函 数 名: move_current_task_to_global_run_queue
|
||||
* 功能描述: 将当前任务从本地运行队列中取出,并添加到全局运行队列中
|
||||
* 形 参: 无
|
||||
* 返 回 值: 无
|
||||
*******************************************************************************/
|
||||
void move_current_task_to_global_run_queue() {
|
||||
int cpu_id = get_cpu_id();
|
||||
tcb_t *tcb = (tcb_t*)current_task;
|
||||
tcb->state = TASK_READY;
|
||||
add_to_global_run_queue(tcb);
|
||||
local_run_queue_head[cpu_id] = NULL;
|
||||
local_run_queue_tail[cpu_id] = NULL;
|
||||
current_task = NULL;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* 函 数 名: switch_to_next_task
|
||||
* 功能描述: 切换到下一个任务
|
||||
* 形 参: 无
|
||||
* 返 回 值: 无
|
||||
*******************************************************************************/
|
||||
void switch_to_next_task() {
|
||||
int cpu_id = get_cpu_id();
|
||||
tcb_t *current_tcb = (tcb_t*)current_task;
|
||||
tcb_t *next_tcb = take_from_local_run_queue(cpu_id);
|
||||
if (next_tcb == NULL) {
|
||||
next_tcb = take_from_global_run_queue();
|
||||
}
|
||||
if (next_tcb == NULL) {
|
||||
// 如果没有可运行的任务,则将当前任务继续运行
|
||||
return;
|
||||
}
|
||||
// 保存当前任务的上下文
|
||||
if (current_tcb != NULL) {
|
||||
current_tcb->stack_ptr = get_stack_pointer();
|
||||
}
|
||||
// 切换到下一个任务的上下文
|
||||
current_task = next_tcb;
|
||||
set_stack_pointer(next_tcb->stack_ptr);
|
||||
// 如果切换到的任务是新的任务,需要执行任务初始化函数
|
||||
if (current_tcb != next_tcb) {
|
||||
next_tcb->state = TASK_RUNNING;
|
||||
task_init(next_tcb);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* 函 数 名: task_init
|
||||
* 功能描述: 任务初始化函数
|
||||
* 形 参: tcb:任务控制块指针
|
||||
* 返 回 值: 无
|
||||
*******************************************************************************/
|
||||
void task_init(tcb_t *tcb) {
|
||||
// 创建消息队列
|
||||
message_queue_t mq = (message_queue_t)malloc(sizeof(message_queue_t));
|
||||
mq->buffer = (message_t)malloc(sizeof(message_t) * 16);
|
||||
mq->capacity = 16;
|
||||
mq->head = 0;
|
||||
mq->tail = 0;
|
||||
mq->count = 0;
|
||||
tcb->message_queue = mq;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* 函 数 名: create_task
|
||||
* 功能描述: 创建任务
|
||||
* 形 参: priority:任务优先级,stack_size:栈大小
|
||||
* 返 回 值: 无
|
||||
*******************************************************************************/
|
||||
tcb_t *create_task(int priority, int stack_size) {
|
||||
tcb_t *tcb = (tcb_t*)malloc(sizeof(tcb_t));
|
||||
tcb_init(tcb, priority, stack_size);
|
||||
add_to_global_run_queue(tcb);
|
||||
return tcb;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* 函 数 名: destroy_task
|
||||
* 功能描述: 销毁任务
|
||||
* 形 参: tcb:任务控制块指针
|
||||
* 返 回 值: 无
|
||||
*******************************************************************************/
|
||||
void destroy_task(tcb_t *tcb) {
|
||||
tcb_destroy(tcb);
|
||||
free(tcb);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* 函 数 名: send_message
|
||||
* 功能描述: 发送消息
|
||||
* 形 参: dest_tcb:目标任务的控制块指针,type:消息类型,data:消息的具体内容
|
||||
* 返 回 值: 无
|
||||
*******************************************************************************/
|
||||
void send_message(tcb_t *dest_tcb, int type, void *data) {
|
||||
message_t message;
|
||||
message.type = type;
|
||||
message.data = data;
|
||||
if (dest_tcb->message_queue == NULL) {
|
||||
// 如果目标任务没有消息队列,则创建一个消息队列
|
||||
dest_tcb->message_queue = message_queue_create(16);
|
||||
}
|
||||
// 将消息添加到目标任务的消息队列中
|
||||
message_queue_push(dest_tcb->message_queue, &message);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* 函 数 名: receive_message
|
||||
* 功能描述: 接收消息
|
||||
* 形 参: type:接收的消息类型,data:存储接收到的消息
|
||||
* 返 回 值: 无
|
||||
*******************************************************************************/
|
||||
void receive_message(int type, void *data) {
|
||||
tcb_t *current_tcb = (tcb_t*)current_task;
|
||||
message_t message;
|
||||
// 从当前任务的消息队列中取出消息
|
||||
while (message_queue_pop(current_tcb->message_queue, &message) != 0) {
|
||||
if (message.type == type) {
|
||||
// 如果消息的类型匹配,则返回消息数据
|
||||
memcpy(data, message.data, sizeof(void*));
|
||||
return;
|
||||
}
|
||||
}
|
||||
// 如果没有匹配的消息,则当前任务被阻塞,直到有匹配的消息为止
|
||||
current_tcb->state = TASK_BLOCKED;
|
||||
while (message_queue_pop(current_tcb->message_queue, &message) != 0) {
|
||||
if (message.type == type) {
|
||||
// 如果有匹配的消息,则返回消息数据,并将当前任务状态设置为就绪
|
||||
memcpy(data, message.data, sizeof(void*));
|
||||
current_tcb->state = TASK_READY;
|
||||
return;
|
||||
}
|
||||
}
|
||||
// 如果还是没有匹配的消息,则当前任务一直被阻塞
|
||||
while (1) {
|
||||
wait_for_interrupt();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* 函 数 名: message_queue_create
|
||||
* 功能描述: 创建消息队列
|
||||
* 形 参: capacity:消息队列的容量
|
||||
* 返 回 值: 生成的消息队列的指针
|
||||
*******************************************************************************/
|
||||
message_queue_t *message_queue_create(int capacity) {
|
||||
message_queue_t *mq = (message_queue_t*)malloc(sizeof(message_queue_t));
|
||||
mq->buffer = (message_t*)malloc(sizeof(message_t) * capacity);
|
||||
mq->capacity = capacity;
|
||||
mq->head = 0;
|
||||
mq->tail = 0;
|
||||
mq->count = 0;
|
||||
return mq;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* 函 数 名: message_queue_destroy
|
||||
* 功能描述: 销毁消息队列
|
||||
* 形 参: mq:消息队列的指针
|
||||
* 返 回 值: 无
|
||||
*******************************************************************************/
|
||||
void message_queue_destroy(message_queue_t *mq) {
|
||||
free(mq->buffer);
|
||||
free(mq);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* 函 数 名: message_queue_push
|
||||
* 功能描述: 将消息添加到消息队列中
|
||||
* 形 参: message_queue_t:消息队列的指针,message_t:存储的消息
|
||||
* 返 回 值: 0:成功,-1:失败
|
||||
*******************************************************************************/
|
||||
int message_queue_push(message_queue_t *mq, message_t *message) {
|
||||
if (mq->count >= mq->capacity) {
|
||||
return -1; // 队列已满
|
||||
}
|
||||
mq->buffer[mq->tail] = *message;
|
||||
mq->tail = (mq->tail + 1) % mq->capacity;
|
||||
mq->count++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* 函 数 名: message_queue_pop
|
||||
* 功能描述: 从消息队列中取出消息
|
||||
* 形 参: message_queue_t:消息队列的指针,message_t:存储的消息
|
||||
* 返 回 值: 0:成功,-1:失败
|
||||
*******************************************************************************/
|
||||
int message_queue_pop(message_queue_t *mq, message_t *message) {
|
||||
if (mq->count <= 0) {
|
||||
return -1; // 队列已空
|
||||
}
|
||||
*message = mq->buffer[mq->head];
|
||||
mq->head = (mq->head + 1) % mq->capacity;
|
||||
mq->count--;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* 函 数 名: context_init
|
||||
* 功能描述: 初始化上下文
|
||||
* 形 参: message_queue_t:消息队列的指针,message_t:存储的消息
|
||||
* 返 回 值: 0:成功,-1:失败
|
||||
*******************************************************************************/
|
||||
void context_init(context_t *context, void (*entry)(void), void *stack_ptr) {
|
||||
context->cpsr = 0x10; // 设置 CPSR 的初始值
|
||||
context->pc = (uint32_t)entry; // 设置 PC 的初始值为任务入口地址
|
||||
context->r0 = (uint32_t)stack_ptr; // 设置 R0 的初始值为栈指针
|
||||
context->r1 = 0; // 设置 R1 的初始值为 0
|
||||
context->r2 = 0; // 设置 R2 的初始值为 0
|
||||
context->r3 = 0; // 设置 R3 的初始值为 0
|
||||
context->r4 = 0; // 设置 R4 的初始值为 0
|
||||
context->r5 = 0; // 设置 R5 的初始值为 0
|
||||
context->r6 = 0; // 设置 R6 的初始值为 0
|
||||
context->r7 = 0; // 设置 R7 的初始值为 0
|
||||
context->r8 = 0; // 设置 R8 的初始值为 0
|
||||
context->r9 = 0; // 设置 R9 的初始值为 0
|
||||
context->r10 = 0; // 设置 R10 的初始值为 0
|
||||
context->r11 = 0; // 设置 R11 的初始值为 0
|
||||
context->r12 = 0; // 设置 R12 的初始值为 0
|
||||
context->sp = (uint32_t)stack_ptr; // 设置 SP 的初始值为栈指针
|
||||
context->lr = (uint32_t)task_exit; // 设置 LR 的初始值为线程退出函数的地址
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* 函 数 名: wait_for_interrupt
|
||||
* 功能描述: 等待中断
|
||||
* 形 参: 无
|
||||
* 返 回 值: 无
|
||||
*******************************************************************************/
|
||||
void wait_for_interrupt() {
|
||||
// 在实现中,可以使用 WFI 指令等待中断
|
||||
__asm__ volatile("wfi");
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* 函 数 名: get_cpu_id
|
||||
* 功能描述: 获取CPU id
|
||||
* 形 参: 无
|
||||
* 返 回 值: 获取的cpu id
|
||||
*******************************************************************************/
|
||||
int get_cpu_id() {
|
||||
uint32_t mpidr;
|
||||
__asm__ volatile("mrc p15, 0, %0, c0, c0, 5" : "=r"(mpidr));
|
||||
return mpidr & 0xff;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* 函 数 名: get_stack_pointer
|
||||
* 功能描述: 获取栈指针
|
||||
* 形 参: 无
|
||||
* 返 回 值: 获取到的栈指针
|
||||
*******************************************************************************/
|
||||
void *get_stack_pointer() {
|
||||
// 在实现中,可以使用 ARM 的 SP 寄存器获取栈指针
|
||||
void *sp;
|
||||
__asm__ volatile("mov %0, sp" : "=r"(sp));
|
||||
return sp;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* 函 数 名: set_stack_pointer
|
||||
* 功能描述: 设置栈指针
|
||||
* 形 参: 设置的栈指针
|
||||
* 返 回 值: 无
|
||||
*******************************************************************************/
|
||||
void set_stack_pointer(void *sp) {
|
||||
// 在实现中,可以使用 ARM 的 SP 寄存器设置栈指针
|
||||
__asm__ volatile("mov sp, %0" : : "r"(sp));
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* 函 数 名: add_interrupt_handler
|
||||
* 功能描述: 添加中断处理函数
|
||||
* 形 参: irq:中断号,handler:中断句柄,priority:中断优先级
|
||||
* 返 回 值: 无
|
||||
*******************************************************************************/
|
||||
void add_interrupt_handler(int irq, void (*handler)(void), int priority) {
|
||||
uint32_t *vector_table = (uint32_t*)0x0;
|
||||
|
||||
// 将中断处理函数写入中断向量表中
|
||||
vector_table[irq + 16] = (uint32_t)handler;
|
||||
|
||||
// 设置中断优先级
|
||||
uint8_t priority_shift = 8 - __NVIC_PRIO_BITS;
|
||||
uint32_t priority_mask = 0xff << priority_shift;
|
||||
uint32_t priority_value = (priority << priority_shift) & priority_mask;
|
||||
uint32_t *priority_reg = (uint32_t*)0xE000E400;
|
||||
int index = irq / 4;
|
||||
int offset = irq % 4;
|
||||
priority_reg[index] &= ~(0xff << (offset * 8));
|
||||
priority_reg[index] |= (priority_value << (offset * 8));
|
||||
|
||||
// 使能中断
|
||||
uint32_t *enable_reg = (uint32_t*)0xE000E100;
|
||||
enable_reg[irq / 32] |= 1 << (irq % 32);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* 函 数 名: enter_critical
|
||||
* 功能描述: 进入临界区
|
||||
* 形 参: 无
|
||||
* 返 回 值: 无
|
||||
*******************************************************************************/
|
||||
void enter_critical() {
|
||||
// 在实现中,可以使用 ARM 的 CPSR 寄存器进入临界区
|
||||
__asm__ volatile("cpsid i");
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* 函 数 名: leave_critical
|
||||
* 功能描述: 离开临界区
|
||||
* 形 参: 无
|
||||
* 返 回 值: 无
|
||||
*******************************************************************************/
|
||||
void leave_critical() {
|
||||
// 在实现中,可以使用 ARM 的 CPSR 寄存器离开临界区
|
||||
__asm__ volatile("cpsie i");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* 函 数 名: task_exit
|
||||
* 功能描述: 任务退出函数
|
||||
* 形 参: 无
|
||||
* 返 回 值: 无
|
||||
*******************************************************************************/
|
||||
void task_exit() {
|
||||
// 切换到下一个任务
|
||||
switch_to_next_task();
|
||||
// 在实现中,可以使用 ARM 的 WFE 指令等待下一个中断
|
||||
__asm__ volatile("wfe");
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* 函 数 名: task_entry
|
||||
* 功能描述: 任务入口函数
|
||||
* 形 参: 无
|
||||
* 返 回 值: 无
|
||||
*******************************************************************************/
|
||||
void task_entry() {
|
||||
tcb_t *current_tcb = (tcb_t*)current_task;
|
||||
current_tcb->state = TASK_RUNNING;
|
||||
task_init(current_tcb);
|
||||
while (1) {
|
||||
switch_to_next_task();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
* Copyright (c) 2020 AIIT XUOS Lab
|
||||
* XiUOS is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file: task.h
|
||||
* @brief: file task.h
|
||||
* @version: 1.0
|
||||
* @author: AIIT XUOS Lab
|
||||
* @date: 2023/05/18
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __TASK_H__
|
||||
#define __TASK_H__
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
// 任务状态枚举类型
|
||||
typedef enum {
|
||||
TASK_CREATED, // 初始状态
|
||||
TASK_READY, // 就绪状态
|
||||
TASK_RUNNING, // 运行状态
|
||||
TASK_BLOCKED, // 阻塞状态
|
||||
} task_state_t;
|
||||
|
||||
|
||||
// 任务控制块结构体
|
||||
typedef struct tcb {
|
||||
uint32_t *stack_ptr; // 任务堆栈指针
|
||||
uint32_t *stack_bottom; // 任务堆栈底部指针
|
||||
uint32_t stack_size; // 任务堆栈大小
|
||||
task_state_t state; // 任务状态
|
||||
int priority; // 任务优先级
|
||||
struct tcb *next; // 指向下一个任务控制块的指针
|
||||
struct message_queue *message_queue; // 消息队列
|
||||
} tcb_t;
|
||||
|
||||
|
||||
// 消息结构体
|
||||
typedef struct message {
|
||||
int type; // 消息类型
|
||||
void *data; // 消息数据指针
|
||||
} message_t;
|
||||
|
||||
|
||||
// 消息队列结构体
|
||||
typedef struct message_queue {
|
||||
message_t *buffer; // 消息缓冲区
|
||||
int capacity; // 缓冲区容量
|
||||
int count; // 当前缓冲区中的消息数量
|
||||
int head; // 队头指针
|
||||
int tail; // 队尾指针
|
||||
semaphore_t *semaphore; // 信号量,用于实现消息队列的同步机制
|
||||
} message_queue_t;
|
||||
|
||||
|
||||
// 信号量结构体
|
||||
typedef struct semaphore {
|
||||
int count; // 计数器
|
||||
tcb_t *wait_list_head; // 指向等待信号量的任务控制块的指针
|
||||
mutex_t mutex; // 互斥锁,用于保护信号量和等待队列的访问
|
||||
} semaphore_t;
|
||||
|
||||
|
||||
// 互斥锁结构体
|
||||
typedef struct mutex {
|
||||
int lock; // 锁标志
|
||||
} mutex_t;
|
||||
|
||||
|
||||
// 上下文结构体
|
||||
typedef struct {
|
||||
uint32_t cpsr; // 控制寄存器
|
||||
uint32_t pc; // 程序计数器
|
||||
uint32_t r0; // 寄存器 R0
|
||||
uint32_t r1; // 寄存器 R1
|
||||
uint32_t r2; // 寄存器 R2
|
||||
uint32_t r3; // 寄存器 R3
|
||||
uint32_t r4; // 寄存器 R4
|
||||
uint32_t r5; // 寄存器 R5
|
||||
uint32_t r6; // 寄存器 R6
|
||||
uint32_t r7; // 寄存器 R7
|
||||
uint32_t r8; // 寄存器 R8
|
||||
uint32_t r9; // 寄存器 R9
|
||||
uint32_t r10; // 寄存器 R10
|
||||
uint32_t r11; // 寄存器 R11
|
||||
uint32_t r12; // 寄存器 R12
|
||||
uint32_t sp; // 栈指针
|
||||
uint32_t lr; // 链接寄存器
|
||||
} context_t;
|
||||
|
||||
void tcb_init(tcb_t *tcb, int priority, int stack_size);
|
||||
void tcb_destroy(tcb_t *tcb);
|
||||
tcb_t *get_current_task(void);
|
||||
tcb_t *get_local_run_queue_head(int cpu_id);
|
||||
void add_to_global_run_queue(tcb_t *tcb);
|
||||
tcb_t *take_from_global_run_queue(void);
|
||||
void add_to_local_run_queue(tcb_t *tcb, int cpu_id);
|
||||
tcb_t *take_from_local_run_queue(int cpu_id);
|
||||
void move_current_task_to_global_run_queue(void);
|
||||
void switch_to_next_task(void);
|
||||
void task_init(tcb_t *tcb);
|
||||
tcb_t *create_task(int priority, int stack_size);
|
||||
void destroy_task(tcb_t *tcb);
|
||||
void send_message(tcb_t *dest_tcb, int type, void *data);
|
||||
void receive_message(int type, void *data);
|
||||
message_queue_t *message_queue_create(int capacity);
|
||||
void message_queue_destroy(message_queue_t *mq);
|
||||
int message_queue_push(message_queue_t *mq, message_t *message);
|
||||
int message_queue_pop(message_queue_t *mq, message_t *message);
|
||||
int message_queue_push(message_queue_t *mq, message_t *message);
|
||||
void context_init(context_t *context, void (*entry)(void), void *stack_ptr);
|
||||
void wait_for_interrupt(void);
|
||||
int get_cpu_id(void);
|
||||
void *get_stack_pointer(void);
|
||||
void set_stack_pointer(void *sp);
|
||||
void add_interrupt_handler(int irq, void (*handler)(void), int priority);
|
||||
void enter_critical(void);
|
||||
void leave_critical(void);
|
||||
void task_exit(void);
|
||||
void task_entry(void);
|
||||
#endif
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
/**
|
||||
* @file gap8.h
|
||||
* @brief support gap8 chip fetures
|
||||
* @brief support gap8 chip features
|
||||
* @version 1.0
|
||||
* @author AIIT XUOS Lab
|
||||
* @date 2021-09-02
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
/*************************************************
|
||||
File name: gap8.h
|
||||
Description: support gap8 chip fetures
|
||||
Description: support gap8 chip features
|
||||
Others: take nuttx/arch/risc-v/src/gap8/gap8.h for references
|
||||
https://github.com/apache/incubator-nuttx.git
|
||||
History:
|
||||
|
||||
@@ -179,9 +179,9 @@ CONFIG_LIB_NEWLIB=y
|
||||
# Framework
|
||||
#
|
||||
CONFIG_TRANSFORM_LAYER_ATTRIUBUTE=y
|
||||
CONFIG_ADD_XIZI_FETURES=y
|
||||
# CONFIG_ADD_NUTTX_FETURES is not set
|
||||
# CONFIG_ADD_RTTHREAD_FETURES is not set
|
||||
CONFIG_ADD_XIZI_FEATURES=y
|
||||
# CONFIG_ADD_NUTTX_FEATURES is not set
|
||||
# CONFIG_ADD_RTTHREAD_FEATURES is not set
|
||||
# CONFIG_SUPPORT_SENSOR_FRAMEWORK is not set
|
||||
# CONFIG_SUPPORT_CONNECTION_FRAMEWORK is not set
|
||||
# CONFIG_SUPPORT_KNOWING_FRAMEWORK is not set
|
||||
|
||||
@@ -11,7 +11,7 @@ menuconfig BSP_USING_SPI
|
||||
bool "Using SPI device"
|
||||
default n
|
||||
select RESOURCES_SPI
|
||||
select BSP_USING_DMA
|
||||
select BSP_USING_DMA
|
||||
if BSP_USING_SPI
|
||||
source "$BSP_DIR/third_party_driver/spi/Kconfig"
|
||||
endif
|
||||
@@ -117,6 +117,7 @@ menuconfig BSP_USING_WIZCHIP
|
||||
bool "Using w5500 as network device"
|
||||
default n
|
||||
select RESOURCES_WIZCHIP
|
||||
select BSP_USING_SPI
|
||||
if BSP_USING_WIZCHIP
|
||||
source "$BSP_DIR/third_party_driver/ethernet/Kconfig"
|
||||
endif
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
# Kconfig file
|
||||
|
||||
config BSP_USING_W5500
|
||||
bool "Using w5500 "
|
||||
default y
|
||||
bool "Using w5500"
|
||||
default y
|
||||
|
||||
# if BSP_USING_W5500
|
||||
config BSP_WIZ_RST_PIN
|
||||
int
|
||||
default 13
|
||||
config BSP_WIZ_RST_PIN
|
||||
int
|
||||
default 13
|
||||
|
||||
config BSP_WIZ_INT_PIN
|
||||
int
|
||||
default 14
|
||||
# endif
|
||||
config BSP_WIZ_INT_PIN
|
||||
int
|
||||
default 14
|
||||
|
||||
config BSP_WIZ_USE_IPERF
|
||||
bool "Using iperf"
|
||||
default y
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include "w5500.h"
|
||||
#include "connect_w5500.h"
|
||||
|
||||
#ifdef BSP_WIZ_USE_IPERF
|
||||
|
||||
#define IPERF_PORT 5001
|
||||
#define IPERF_BUFSZ (4 * 1024)
|
||||
|
||||
@@ -459,4 +461,5 @@ __usage:
|
||||
}
|
||||
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0) | SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN),
|
||||
iperf, iperf,
|
||||
iperf throughput test);
|
||||
iperf throughput test);
|
||||
#endif
|
||||
|
||||
@@ -181,9 +181,9 @@ CONFIG_FS_VFS=n
|
||||
# Framework
|
||||
#
|
||||
CONFIG_TRANSFORM_LAYER_ATTRIUBUTE=y
|
||||
CONFIG_ADD_XIZI_FETURES=y
|
||||
# CONFIG_ADD_NUTTX_FETURES is not set
|
||||
# CONFIG_ADD_RTTHREAD_FETURES is not set
|
||||
CONFIG_ADD_XIZI_FEATURES=y
|
||||
# CONFIG_ADD_NUTTX_FEATURES is not set
|
||||
# CONFIG_ADD_RTTHREAD_FEATURES is not set
|
||||
# CONFIG_SUPPORT_SENSOR_FRAMEWORK is not set
|
||||
# CONFIG_SUPPORT_CONNECTION_FRAMEWORK is not set
|
||||
# CONFIG_SUPPORT_KNOWING_FRAMEWORK is not set
|
||||
|
||||
@@ -191,9 +191,9 @@ CONFIG_FS_VFS_FATFS=y
|
||||
# Framework
|
||||
#
|
||||
CONFIG_TRANSFORM_LAYER_ATTRIUBUTE=y
|
||||
CONFIG_ADD_XIZI_FETURES=y
|
||||
# CONFIG_ADD_NUTTX_FETURES is not set
|
||||
# CONFIG_ADD_RTTHREAD_FETURES is not set
|
||||
CONFIG_ADD_XIZI_FEATURES=y
|
||||
# CONFIG_ADD_NUTTX_FEATURES is not set
|
||||
# CONFIG_ADD_RTTHREAD_FEATURES is not set
|
||||
# CONFIG_SUPPORT_SENSOR_FRAMEWORK is not set
|
||||
# CONFIG_SUPPORT_CONNECTION_FRAMEWORK is not set
|
||||
# CONFIG_SUPPORT_KNOWING_FRAMEWORK is not set
|
||||
|
||||
@@ -6,3 +6,6 @@ config BOARD_NETWORK_USE_1G_ENET_PORT
|
||||
bool "Enable 1000M Enet Port"
|
||||
default y
|
||||
|
||||
config LWIP_REASSEMBLY_FRAG
|
||||
bool
|
||||
default y
|
||||
+2
-1
@@ -211,9 +211,10 @@ void ethernetif_phy_init(struct ethernetif *ethernetif,
|
||||
*
|
||||
* @param netif the lwip network interface structure for this ethernetif
|
||||
*/
|
||||
void ethernetif_input(struct netif *netif)
|
||||
void ethernetif_input(void *netif_arg)
|
||||
{
|
||||
struct pbuf *p;
|
||||
struct netif *netif = (struct netif *)netif_arg;
|
||||
|
||||
LWIP_ASSERT("netif != NULL", (netif != NULL));
|
||||
|
||||
|
||||
+1
-1
@@ -159,7 +159,7 @@ err_t ethernetif1_init(struct netif *netif);
|
||||
*
|
||||
* @param netif the lwip network interface structure for this ethernetif
|
||||
*/
|
||||
void ethernetif_input( struct netif *netif);
|
||||
void ethernetif_input( void *netif_arg);
|
||||
|
||||
int ETH_BSP_Config(void);
|
||||
void *ethernetif_config_enet_set(uint8_t enet_port);
|
||||
|
||||
@@ -223,9 +223,9 @@ CONFIG_FS_VFS_FATFS=y
|
||||
# Framework
|
||||
#
|
||||
CONFIG_TRANSFORM_LAYER_ATTRIUBUTE=y
|
||||
CONFIG_ADD_XIZI_FETURES=y
|
||||
# CONFIG_ADD_NUTTX_FETURES is not set
|
||||
# CONFIG_ADD_RTTHREAD_FETURES is not set
|
||||
CONFIG_ADD_XIZI_FEATURES=y
|
||||
# CONFIG_ADD_NUTTX_FEATURES is not set
|
||||
# CONFIG_ADD_RTTHREAD_FEATURES is not set
|
||||
# CONFIG_SUPPORT_SENSOR_FRAMEWORK is not set
|
||||
# CONFIG_SUPPORT_CONNECTION_FRAMEWORK is not set
|
||||
# CONFIG_SUPPORT_KNOWING_FRAMEWORK is not set
|
||||
|
||||
@@ -57,16 +57,12 @@
|
||||
#include "netif/ppp/pppoe.h"
|
||||
#include "lwip/igmp.h"
|
||||
#include "lwip/mld6.h"
|
||||
#include "lwip/sys.h"
|
||||
|
||||
#if USE_RTOS && defined(FSL_RTOS_FREE_RTOS)
|
||||
//#include "FreeRTOS.h"
|
||||
//#include "event_groups.h"
|
||||
#endif
|
||||
#include <board.h>
|
||||
#include "netif/ethernet.h"
|
||||
#include "enet_ethernetif.h"
|
||||
#include "enet_ethernetif_priv.h"
|
||||
|
||||
#include <board.h>
|
||||
#include "fsl_enet.h"
|
||||
#include "fsl_phy.h"
|
||||
#include "fsl_gpio.h"
|
||||
@@ -91,6 +87,7 @@ void enet_delay(uint32 ms)
|
||||
void Time_Update_LwIP(void)
|
||||
{
|
||||
}
|
||||
|
||||
ethernetif_config_t enet_cfg = {
|
||||
.phyAddress = BOARD_ENET0_PHY_ADDRESS,
|
||||
.clockName = kCLOCK_CoreSysClk,
|
||||
@@ -109,7 +106,6 @@ void ethernetif_clk_init(void)
|
||||
{
|
||||
const clock_enet_pll_config_t config = {.enableClkOutput = true, .enableClkOutput25M = false, .loopDivider = 1};
|
||||
CLOCK_InitEnetPll(&config);
|
||||
SysTick_Config(SystemCoreClock / TICK_PER_SECOND);
|
||||
}
|
||||
|
||||
void ethernetif_gpio_init(void)
|
||||
@@ -119,13 +115,15 @@ void ethernetif_gpio_init(void)
|
||||
IOMUXC_EnableMode(IOMUXC_GPR, kIOMUXC_GPR_ENET1TxClkOutputDir, true);
|
||||
|
||||
GPIO_PinInit(GPIO1, 3, &gpio_config);
|
||||
GPIO_PinInit(GPIO1, 10, &gpio_config);
|
||||
/* pull up the ENET_INT before RESET. */
|
||||
GPIO_WritePinOutput(GPIO1, 10, 1);
|
||||
GPIO_WritePinOutput(GPIO1, 3, 0);
|
||||
enet_delay(30);
|
||||
GPIO_WritePinOutput(GPIO1, 3, 1);
|
||||
}
|
||||
|
||||
void ETH_BSP_Config(void)
|
||||
int ETH_BSP_Config(void)
|
||||
{
|
||||
static int flag = 0;
|
||||
if(flag == 0)
|
||||
@@ -134,6 +132,7 @@ void ETH_BSP_Config(void)
|
||||
ethernetif_gpio_init();
|
||||
flag = 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ethernetif_phy_init(struct ethernetif *ethernetif,
|
||||
@@ -198,23 +197,27 @@ void ethernetif_phy_init(struct ethernetif *ethernetif,
|
||||
* @param netif the lwip network interface structure for this ethernetif
|
||||
*/
|
||||
|
||||
void ethernetif_input(struct netif *netif)
|
||||
void ethernetif_input(void *netif_arg)
|
||||
{
|
||||
struct pbuf *p;
|
||||
struct netif *netif = (struct netif *)netif_arg;
|
||||
err_t ret = 0;
|
||||
|
||||
LWIP_ASSERT("netif != NULL", (netif != NULL));
|
||||
|
||||
/* move received packet into a new pbuf */
|
||||
while ((p = ethernetif_linkinput(netif)) != NULL)
|
||||
{
|
||||
/* pass all packets to ethernet_input, which decides what packets it supports */
|
||||
if ((ret = netif->input(p, netif)) != ERR_OK)
|
||||
while (1) {
|
||||
sys_arch_sem_wait(get_eth_recv_sem(), WAITING_FOREVER);
|
||||
/* move received packet into a new pbuf */
|
||||
while ((p = ethernetif_linkinput(netif)) != NULL)
|
||||
{
|
||||
LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n"));
|
||||
lw_print("lw: [%s] ret %d p %p\n", __func__, ret, p);
|
||||
pbuf_free(p);
|
||||
p = NULL;
|
||||
/* pass all packets to ethernet_input, which decides what packets it supports */
|
||||
if ((ret = netif->input(p, netif)) != ERR_OK)
|
||||
{
|
||||
LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n"));
|
||||
lw_print("lw: [%s] ret %d p %p\n", __func__, ret, p);
|
||||
pbuf_free(p);
|
||||
p = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+18
-134
@@ -58,22 +58,9 @@
|
||||
#include "netif/ppp/pppoe.h"
|
||||
#include "lwip/igmp.h"
|
||||
#include "lwip/mld6.h"
|
||||
#include "lwip/sys.h"
|
||||
|
||||
#ifdef FSL_RTOS_XIUOS
|
||||
#define USE_RTOS 1
|
||||
#define FSL_RTOS_FREE_RTOS
|
||||
#endif
|
||||
|
||||
#if USE_RTOS && defined(FSL_RTOS_FREE_RTOS)
|
||||
|
||||
#ifdef FSL_RTOS_XIUOS
|
||||
#include "xs_sem.h"
|
||||
|
||||
#else
|
||||
#include "FreeRTOS.h"
|
||||
#include "event_groups.h"
|
||||
#include "list.h"
|
||||
#endif
|
||||
#include <xs_sem.h>
|
||||
|
||||
typedef uint32_t TickType_t;
|
||||
#define portMAX_DELAY ( TickType_t ) 0xffffffffUL
|
||||
@@ -91,27 +78,6 @@ typedef unsigned long UBaseType_t;
|
||||
#define pdPASS ( pdTRUE )
|
||||
#define pdFAIL ( pdFALSE )
|
||||
|
||||
#ifndef FSL_RTOS_XIUOS
|
||||
typedef struct EventGroupDef_t
|
||||
{
|
||||
EventBits_t uxEventBits;
|
||||
List_t xTasksWaitingForBits; /*< List of tasks waiting for a bit to be set. */
|
||||
|
||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||
UBaseType_t uxEventGroupNumber;
|
||||
#endif
|
||||
|
||||
#if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
|
||||
uint8_t ucStaticallyAllocated; /*< Set to pdTRUE if the event group is statically allocated to ensure no attempt is made to free the memory. */
|
||||
#endif
|
||||
} EventGroup_t;
|
||||
|
||||
struct EventGroupDef_t;
|
||||
typedef struct EventGroupDef_t * EventGroupHandle_t;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#include "enet_ethernetif.h"
|
||||
#include "enet_ethernetif_priv.h"
|
||||
|
||||
@@ -130,19 +96,13 @@ typedef struct EventGroupDef_t * EventGroupHandle_t;
|
||||
struct ethernetif
|
||||
{
|
||||
ENET_Type *base;
|
||||
#if (defined(FSL_FEATURE_SOC_ENET_COUNT) && (FSL_FEATURE_SOC_ENET_COUNT > 0)) || \
|
||||
(USE_RTOS && defined(FSL_RTOS_FREE_RTOS))
|
||||
#if (defined(FSL_FEATURE_SOC_ENET_COUNT) && (FSL_FEATURE_SOC_ENET_COUNT > 0))
|
||||
enet_handle_t handle;
|
||||
#endif
|
||||
#if USE_RTOS && defined(FSL_RTOS_FREE_RTOS)
|
||||
|
||||
#ifdef FSL_RTOS_XIUOS
|
||||
int enetSemaphore;
|
||||
#else
|
||||
EventGroupHandle_t enetTransmitAccessEvent;
|
||||
#endif
|
||||
EventBits_t txFlag;
|
||||
#endif
|
||||
|
||||
enet_rx_bd_struct_t *RxBuffDescrip;
|
||||
enet_tx_bd_struct_t *TxBuffDescrip;
|
||||
rx_buffer_t *RxDataBuff;
|
||||
@@ -153,14 +113,6 @@ struct ethernetif
|
||||
/*******************************************************************************
|
||||
* Code
|
||||
******************************************************************************/
|
||||
#if USE_RTOS && defined(FSL_RTOS_FREE_RTOS)
|
||||
|
||||
int32 lwip_obtain_semaphore(struct netif *netif)
|
||||
{
|
||||
struct ethernetif *ethernetif = netif->state;
|
||||
return (KSemaphoreObtain(ethernetif->enetSemaphore, WAITING_FOREVER) == EOK);
|
||||
}
|
||||
|
||||
#if FSL_FEATURE_ENET_QUEUE > 1
|
||||
static void ethernet_callback(ENET_Type *base, enet_handle_t *handle, uint32_t ringId, enet_event_t event, void *param)
|
||||
#else
|
||||
@@ -169,44 +121,19 @@ static void ethernet_callback(ENET_Type *base, enet_handle_t *handle, enet_event
|
||||
{
|
||||
struct netif *netif = (struct netif *)param;
|
||||
struct ethernetif *ethernetif = netif->state;
|
||||
BaseType_t xResult;
|
||||
|
||||
switch (event)
|
||||
{
|
||||
case kENET_RxEvent:
|
||||
ethernetif_input(netif);
|
||||
ENET_DisableInterrupts(ethernetif->base, kENET_RxFrameInterrupt);
|
||||
sys_sem_signal(get_eth_recv_sem());
|
||||
break;
|
||||
case kENET_TxEvent:
|
||||
#ifndef FSL_RTOS_XIUOS
|
||||
{
|
||||
portBASE_TYPE taskToWake = pdFALSE;
|
||||
|
||||
#ifdef __CA7_REV
|
||||
if (SystemGetIRQNestingLevel())
|
||||
#else
|
||||
if (__get_IPSR())
|
||||
#endif
|
||||
{
|
||||
xResult = xEventGroupSetBitsFromISR(ethernetif->enetTransmitAccessEvent, ethernetif->txFlag, &taskToWake);
|
||||
if ((pdPASS == xResult) && (pdTRUE == taskToWake))
|
||||
{
|
||||
portYIELD_FROM_ISR(taskToWake);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
xEventGroupSetBits(ethernetif->enetTransmitAccessEvent, ethernetif->txFlag);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
KSemaphoreAbandon(ethernetif->enetSemaphore);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LWIP_IPV4 && LWIP_IGMP
|
||||
err_t ethernetif_igmp_mac_filter(struct netif *netif, const ip4_addr_t *group,
|
||||
@@ -312,11 +239,9 @@ void ethernetif_enet_init(struct netif *netif, struct ethernetif *ethernetif,
|
||||
|
||||
ENET_GetDefaultConfig(&config);
|
||||
config.ringNum = ENET_RING_NUM;
|
||||
config.macSpecialConfig |= kENET_ControlPromiscuousEnable;
|
||||
|
||||
ethernetif_phy_init(ethernetif, ethernetifConfig, &config);
|
||||
|
||||
#if USE_RTOS && defined(FSL_RTOS_FREE_RTOS)
|
||||
uint32_t instance;
|
||||
static ENET_Type *const enetBases[] = ENET_BASE_PTRS;
|
||||
static const IRQn_Type enetTxIrqId[] = ENET_Transmit_IRQS;
|
||||
@@ -328,51 +253,37 @@ void ethernetif_enet_init(struct netif *netif, struct ethernetif *ethernetif,
|
||||
#endif /* ENET_ENHANCEDBUFFERDESCRIPTOR_MODE */
|
||||
|
||||
/* Create the Event for transmit busy release trigger. */
|
||||
#ifdef FSL_RTOS_XIUOS
|
||||
if(ethernetif->enetSemaphore < 0)
|
||||
{
|
||||
ethernetif->enetSemaphore = KSemaphoreCreate(0);
|
||||
}
|
||||
#else
|
||||
ethernetif->enetTransmitAccessEvent = xEventGroupCreate();
|
||||
#endif
|
||||
ethernetif->txFlag = 0x1;
|
||||
|
||||
sys_sem_new(get_eth_recv_sem(), 0);
|
||||
config.interrupt |= kENET_RxFrameInterrupt | kENET_TxFrameInterrupt | kENET_TxBufferInterrupt;
|
||||
|
||||
for (instance = 0; instance < ARRAY_SIZE(enetBases); instance++)
|
||||
{
|
||||
if (enetBases[instance] == ethernetif->base)
|
||||
{
|
||||
#ifdef __CA7_REV
|
||||
GIC_SetPriority(enetRxIrqId[instance], ENET_PRIORITY);
|
||||
GIC_SetPriority(enetTxIrqId[instance], ENET_PRIORITY);
|
||||
#if defined(ENET_ENHANCEDBUFFERDESCRIPTOR_MODE) && ENET_ENHANCEDBUFFERDESCRIPTOR_MODE
|
||||
GIC_SetPriority(enetTsIrqId[instance], ENET_1588_PRIORITY);
|
||||
#endif /* ENET_ENHANCEDBUFFERDESCRIPTOR_MODE */
|
||||
#else
|
||||
NVIC_SetPriority(enetRxIrqId[instance], ENET_PRIORITY);
|
||||
NVIC_SetPriority(enetTxIrqId[instance], ENET_PRIORITY);
|
||||
#if defined(ENET_ENHANCEDBUFFERDESCRIPTOR_MODE) && ENET_ENHANCEDBUFFERDESCRIPTOR_MODE
|
||||
NVIC_SetPriority(enetTsIrqId[instance], ENET_1588_PRIORITY);
|
||||
#endif /* ENET_ENHANCEDBUFFERDESCRIPTOR_MODE */
|
||||
#endif /* __CA7_REV */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
LWIP_ASSERT("Input Ethernet base error!", (instance != ARRAY_SIZE(enetBases)));
|
||||
#endif /* USE_RTOS */
|
||||
|
||||
config.txAccelerConfig = kENET_TxAccelIpCheckEnabled | kENET_TxAccelProtoCheckEnabled;
|
||||
|
||||
/* Initialize the ENET module.*/
|
||||
ENET_Init(ethernetif->base, ðernetif->handle, &config, &buffCfg[0], netif->hwaddr, sysClock);
|
||||
|
||||
#if USE_RTOS && defined(FSL_RTOS_FREE_RTOS)
|
||||
ENET_SetCallback(ðernetif->handle, ethernet_callback, netif);
|
||||
#endif
|
||||
|
||||
ENET_ActiveRead(ethernetif->base);
|
||||
// low_level_init();
|
||||
}
|
||||
|
||||
ENET_Type **ethernetif_enet_ptr(struct ethernetif *ethernetif)
|
||||
@@ -395,45 +306,17 @@ static unsigned char *enet_get_tx_buffer(struct ethernetif *ethernetif)
|
||||
*/
|
||||
static err_t enet_send_frame(struct ethernetif *ethernetif, unsigned char *data, const uint32_t length)
|
||||
{
|
||||
#if USE_RTOS && defined(FSL_RTOS_FREE_RTOS)
|
||||
uint32_t counter;
|
||||
|
||||
for (counter = ENET_TIMEOUT; counter != 0U; counter--)
|
||||
{
|
||||
status_t result;
|
||||
|
||||
lw_print("lw: [%s] len %d\n", __func__, length);
|
||||
|
||||
do
|
||||
if (ENET_SendFrame(ethernetif->base, ðernetif->handle, data, length) != kStatus_ENET_TxFrameBusy)
|
||||
{
|
||||
result = ENET_SendFrame(ethernetif->base, ðernetif->handle, data, length);
|
||||
|
||||
if (result == kStatus_ENET_TxFrameBusy)
|
||||
{
|
||||
#ifdef FSL_RTOS_XIUOS
|
||||
KSemaphoreObtain(ethernetif->enetSemaphore, portMAX_DELAY);
|
||||
#else
|
||||
xEventGroupWaitBits(ethernetif->enetTransmitAccessEvent, ethernetif->txFlag, pdTRUE, (BaseType_t) false,
|
||||
portMAX_DELAY);
|
||||
#endif
|
||||
}
|
||||
|
||||
} while (result == kStatus_ENET_TxFrameBusy);
|
||||
|
||||
return ERR_OK;
|
||||
}
|
||||
#else
|
||||
{
|
||||
uint32_t counter;
|
||||
|
||||
for (counter = ENET_TIMEOUT; counter != 0U; counter--)
|
||||
{
|
||||
if (ENET_SendFrame(ethernetif->base, ðernetif->handle, data, length) != kStatus_ENET_TxFrameBusy)
|
||||
{
|
||||
return ERR_OK;
|
||||
}
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
return ERR_TIMEOUT;
|
||||
}
|
||||
#endif
|
||||
|
||||
return ERR_TIMEOUT;
|
||||
}
|
||||
|
||||
struct pbuf *ethernetif_linkinput(struct netif *netif)
|
||||
@@ -538,6 +421,7 @@ struct pbuf *ethernetif_linkinput(struct netif *netif)
|
||||
}
|
||||
}
|
||||
|
||||
ENET_EnableInterrupts(ethernetif->base, kENET_RxFrameInterrupt);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ err_t ethernetif1_init(struct netif *netif);
|
||||
*
|
||||
* @param netif the lwip network interface structure for this ethernetif
|
||||
*/
|
||||
void ethernetif_input( struct netif *netif);
|
||||
void ethernetif_input( void *netif_arg);
|
||||
|
||||
void ETH_BSP_Config(void);
|
||||
void *ethernetif_config_enet_set(uint8_t enet_port);
|
||||
|
||||
@@ -223,9 +223,9 @@ CONFIG_FS_VFS_FATFS=y
|
||||
# Framework
|
||||
#
|
||||
CONFIG_TRANSFORM_LAYER_ATTRIUBUTE=y
|
||||
CONFIG_ADD_XIZI_FETURES=y
|
||||
# CONFIG_ADD_NUTTX_FETURES is not set
|
||||
# CONFIG_ADD_RTTHREAD_FETURES is not set
|
||||
CONFIG_ADD_XIZI_FEATURES=y
|
||||
# CONFIG_ADD_NUTTX_FEATURES is not set
|
||||
# CONFIG_ADD_RTTHREAD_FEATURES is not set
|
||||
# CONFIG_SUPPORT_SENSOR_FRAMEWORK is not set
|
||||
# CONFIG_SUPPORT_CONNECTION_FRAMEWORK is not set
|
||||
# CONFIG_SUPPORT_KNOWING_FRAMEWORK is not set
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+15
-15
@@ -57,11 +57,7 @@
|
||||
#include "netif/ppp/pppoe.h"
|
||||
#include "lwip/igmp.h"
|
||||
#include "lwip/mld6.h"
|
||||
|
||||
#if USE_RTOS && defined(FSL_RTOS_FREE_RTOS)
|
||||
//#include "FreeRTOS.h"
|
||||
//#include "event_groups.h"
|
||||
#endif
|
||||
#include "lwip/sys.h"
|
||||
|
||||
#include "netif/ethernet.h"
|
||||
#include "enet_ethernetif.h"
|
||||
@@ -201,23 +197,27 @@ void ethernetif_phy_init(struct ethernetif *ethernetif,
|
||||
* @param netif the lwip network interface structure for this ethernetif
|
||||
*/
|
||||
|
||||
void ethernetif_input(struct netif *netif)
|
||||
void ethernetif_input(void *netif_arg)
|
||||
{
|
||||
struct pbuf *p;
|
||||
struct netif *netif = (struct netif *)netif_arg;
|
||||
err_t ret = 0;
|
||||
|
||||
LWIP_ASSERT("netif != NULL", (netif != NULL));
|
||||
|
||||
/* move received packet into a new pbuf */
|
||||
while ((p = ethernetif_linkinput(netif)) != NULL)
|
||||
{
|
||||
/* pass all packets to ethernet_input, which decides what packets it supports */
|
||||
if ((ret = netif->input(p, netif)) != ERR_OK)
|
||||
while (1) {
|
||||
sys_arch_sem_wait(get_eth_recv_sem(), WAITING_FOREVER);
|
||||
/* move received packet into a new pbuf */
|
||||
while ((p = ethernetif_linkinput(netif)) != NULL)
|
||||
{
|
||||
LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n"));
|
||||
lw_print("lw: [%s] ret %d p %p\n", __func__, ret, p);
|
||||
pbuf_free(p);
|
||||
p = NULL;
|
||||
/* pass all packets to ethernet_input, which decides what packets it supports */
|
||||
if ((ret = netif->input(p, netif)) != ERR_OK)
|
||||
{
|
||||
LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n"));
|
||||
lw_print("lw: [%s] ret %d p %p\n", __func__, ret, p);
|
||||
pbuf_free(p);
|
||||
p = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+18
-133
@@ -58,22 +58,9 @@
|
||||
#include "netif/ppp/pppoe.h"
|
||||
#include "lwip/igmp.h"
|
||||
#include "lwip/mld6.h"
|
||||
#include "lwip/sys.h"
|
||||
|
||||
#ifdef FSL_RTOS_XIUOS
|
||||
#define USE_RTOS 1
|
||||
#define FSL_RTOS_FREE_RTOS
|
||||
#endif
|
||||
|
||||
#if USE_RTOS && defined(FSL_RTOS_FREE_RTOS)
|
||||
|
||||
#ifdef FSL_RTOS_XIUOS
|
||||
#include "xs_sem.h"
|
||||
|
||||
#else
|
||||
#include "FreeRTOS.h"
|
||||
#include "event_groups.h"
|
||||
#include "list.h"
|
||||
#endif
|
||||
#include <xs_sem.h>
|
||||
|
||||
typedef uint32_t TickType_t;
|
||||
#define portMAX_DELAY ( TickType_t ) 0xffffffffUL
|
||||
@@ -91,27 +78,6 @@ typedef unsigned long UBaseType_t;
|
||||
#define pdPASS ( pdTRUE )
|
||||
#define pdFAIL ( pdFALSE )
|
||||
|
||||
#ifndef FSL_RTOS_XIUOS
|
||||
typedef struct EventGroupDef_t
|
||||
{
|
||||
EventBits_t uxEventBits;
|
||||
List_t xTasksWaitingForBits; /*< List of tasks waiting for a bit to be set. */
|
||||
|
||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||
UBaseType_t uxEventGroupNumber;
|
||||
#endif
|
||||
|
||||
#if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
|
||||
uint8_t ucStaticallyAllocated; /*< Set to pdTRUE if the event group is statically allocated to ensure no attempt is made to free the memory. */
|
||||
#endif
|
||||
} EventGroup_t;
|
||||
|
||||
struct EventGroupDef_t;
|
||||
typedef struct EventGroupDef_t * EventGroupHandle_t;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#include "enet_ethernetif.h"
|
||||
#include "enet_ethernetif_priv.h"
|
||||
|
||||
@@ -130,19 +96,13 @@ typedef struct EventGroupDef_t * EventGroupHandle_t;
|
||||
struct ethernetif
|
||||
{
|
||||
ENET_Type *base;
|
||||
#if (defined(FSL_FEATURE_SOC_ENET_COUNT) && (FSL_FEATURE_SOC_ENET_COUNT > 0)) || \
|
||||
(USE_RTOS && defined(FSL_RTOS_FREE_RTOS))
|
||||
#if (defined(FSL_FEATURE_SOC_ENET_COUNT) && (FSL_FEATURE_SOC_ENET_COUNT > 0))
|
||||
enet_handle_t handle;
|
||||
#endif
|
||||
#if USE_RTOS && defined(FSL_RTOS_FREE_RTOS)
|
||||
|
||||
#ifdef FSL_RTOS_XIUOS
|
||||
int enetSemaphore;
|
||||
#else
|
||||
EventGroupHandle_t enetTransmitAccessEvent;
|
||||
#endif
|
||||
EventBits_t txFlag;
|
||||
#endif
|
||||
|
||||
enet_rx_bd_struct_t *RxBuffDescrip;
|
||||
enet_tx_bd_struct_t *TxBuffDescrip;
|
||||
rx_buffer_t *RxDataBuff;
|
||||
@@ -153,14 +113,6 @@ struct ethernetif
|
||||
/*******************************************************************************
|
||||
* Code
|
||||
******************************************************************************/
|
||||
#if USE_RTOS && defined(FSL_RTOS_FREE_RTOS)
|
||||
|
||||
int32 lwip_obtain_semaphore(struct netif *netif)
|
||||
{
|
||||
struct ethernetif *ethernetif = netif->state;
|
||||
return (KSemaphoreObtain(ethernetif->enetSemaphore, WAITING_FOREVER) == EOK);
|
||||
}
|
||||
|
||||
#if FSL_FEATURE_ENET_QUEUE > 1
|
||||
static void ethernet_callback(ENET_Type *base, enet_handle_t *handle, uint32_t ringId, enet_event_t event, void *param)
|
||||
#else
|
||||
@@ -169,44 +121,19 @@ static void ethernet_callback(ENET_Type *base, enet_handle_t *handle, enet_event
|
||||
{
|
||||
struct netif *netif = (struct netif *)param;
|
||||
struct ethernetif *ethernetif = netif->state;
|
||||
BaseType_t xResult;
|
||||
|
||||
switch (event)
|
||||
{
|
||||
case kENET_RxEvent:
|
||||
ethernetif_input(netif);
|
||||
ENET_DisableInterrupts(ethernetif->base, kENET_RxFrameInterrupt);
|
||||
sys_sem_signal(get_eth_recv_sem());
|
||||
break;
|
||||
case kENET_TxEvent:
|
||||
#ifndef FSL_RTOS_XIUOS
|
||||
{
|
||||
portBASE_TYPE taskToWake = pdFALSE;
|
||||
|
||||
#ifdef __CA7_REV
|
||||
if (SystemGetIRQNestingLevel())
|
||||
#else
|
||||
if (__get_IPSR())
|
||||
#endif
|
||||
{
|
||||
xResult = xEventGroupSetBitsFromISR(ethernetif->enetTransmitAccessEvent, ethernetif->txFlag, &taskToWake);
|
||||
if ((pdPASS == xResult) && (pdTRUE == taskToWake))
|
||||
{
|
||||
portYIELD_FROM_ISR(taskToWake);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
xEventGroupSetBits(ethernetif->enetTransmitAccessEvent, ethernetif->txFlag);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
KSemaphoreAbandon(ethernetif->enetSemaphore);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LWIP_IPV4 && LWIP_IGMP
|
||||
err_t ethernetif_igmp_mac_filter(struct netif *netif, const ip4_addr_t *group,
|
||||
@@ -315,7 +242,6 @@ void ethernetif_enet_init(struct netif *netif, struct ethernetif *ethernetif,
|
||||
|
||||
ethernetif_phy_init(ethernetif, ethernetifConfig, &config);
|
||||
|
||||
#if USE_RTOS && defined(FSL_RTOS_FREE_RTOS)
|
||||
uint32_t instance;
|
||||
static ENET_Type *const enetBases[] = ENET_BASE_PTRS;
|
||||
static const IRQn_Type enetTxIrqId[] = ENET_Transmit_IRQS;
|
||||
@@ -327,51 +253,37 @@ void ethernetif_enet_init(struct netif *netif, struct ethernetif *ethernetif,
|
||||
#endif /* ENET_ENHANCEDBUFFERDESCRIPTOR_MODE */
|
||||
|
||||
/* Create the Event for transmit busy release trigger. */
|
||||
#ifdef FSL_RTOS_XIUOS
|
||||
if(ethernetif->enetSemaphore < 0)
|
||||
{
|
||||
ethernetif->enetSemaphore = KSemaphoreCreate(0);
|
||||
}
|
||||
#else
|
||||
ethernetif->enetTransmitAccessEvent = xEventGroupCreate();
|
||||
#endif
|
||||
ethernetif->txFlag = 0x1;
|
||||
|
||||
sys_sem_new(get_eth_recv_sem(), 0);
|
||||
config.interrupt |= kENET_RxFrameInterrupt | kENET_TxFrameInterrupt | kENET_TxBufferInterrupt;
|
||||
|
||||
for (instance = 0; instance < ARRAY_SIZE(enetBases); instance++)
|
||||
{
|
||||
if (enetBases[instance] == ethernetif->base)
|
||||
{
|
||||
#ifdef __CA7_REV
|
||||
GIC_SetPriority(enetRxIrqId[instance], ENET_PRIORITY);
|
||||
GIC_SetPriority(enetTxIrqId[instance], ENET_PRIORITY);
|
||||
#if defined(ENET_ENHANCEDBUFFERDESCRIPTOR_MODE) && ENET_ENHANCEDBUFFERDESCRIPTOR_MODE
|
||||
GIC_SetPriority(enetTsIrqId[instance], ENET_1588_PRIORITY);
|
||||
#endif /* ENET_ENHANCEDBUFFERDESCRIPTOR_MODE */
|
||||
#else
|
||||
NVIC_SetPriority(enetRxIrqId[instance], ENET_PRIORITY);
|
||||
NVIC_SetPriority(enetTxIrqId[instance], ENET_PRIORITY);
|
||||
#if defined(ENET_ENHANCEDBUFFERDESCRIPTOR_MODE) && ENET_ENHANCEDBUFFERDESCRIPTOR_MODE
|
||||
NVIC_SetPriority(enetTsIrqId[instance], ENET_1588_PRIORITY);
|
||||
#endif /* ENET_ENHANCEDBUFFERDESCRIPTOR_MODE */
|
||||
#endif /* __CA7_REV */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
LWIP_ASSERT("Input Ethernet base error!", (instance != ARRAY_SIZE(enetBases)));
|
||||
#endif /* USE_RTOS */
|
||||
|
||||
config.txAccelerConfig = kENET_TxAccelIpCheckEnabled | kENET_TxAccelProtoCheckEnabled;
|
||||
|
||||
/* Initialize the ENET module.*/
|
||||
ENET_Init(ethernetif->base, ðernetif->handle, &config, &buffCfg[0], netif->hwaddr, sysClock);
|
||||
|
||||
#if USE_RTOS && defined(FSL_RTOS_FREE_RTOS)
|
||||
ENET_SetCallback(ðernetif->handle, ethernet_callback, netif);
|
||||
#endif
|
||||
|
||||
ENET_ActiveRead(ethernetif->base);
|
||||
// low_level_init();
|
||||
}
|
||||
|
||||
ENET_Type **ethernetif_enet_ptr(struct ethernetif *ethernetif)
|
||||
@@ -394,45 +306,17 @@ static unsigned char *enet_get_tx_buffer(struct ethernetif *ethernetif)
|
||||
*/
|
||||
static err_t enet_send_frame(struct ethernetif *ethernetif, unsigned char *data, const uint32_t length)
|
||||
{
|
||||
#if USE_RTOS && defined(FSL_RTOS_FREE_RTOS)
|
||||
uint32_t counter;
|
||||
|
||||
for (counter = ENET_TIMEOUT; counter != 0U; counter--)
|
||||
{
|
||||
status_t result;
|
||||
|
||||
lw_print("lw: [%s] len %d\n", __func__, length);
|
||||
|
||||
do
|
||||
if (ENET_SendFrame(ethernetif->base, ðernetif->handle, data, length) != kStatus_ENET_TxFrameBusy)
|
||||
{
|
||||
result = ENET_SendFrame(ethernetif->base, ðernetif->handle, data, length);
|
||||
|
||||
if (result == kStatus_ENET_TxFrameBusy)
|
||||
{
|
||||
#ifdef FSL_RTOS_XIUOS
|
||||
KSemaphoreObtain(ethernetif->enetSemaphore, portMAX_DELAY);
|
||||
#else
|
||||
xEventGroupWaitBits(ethernetif->enetTransmitAccessEvent, ethernetif->txFlag, pdTRUE, (BaseType_t) false,
|
||||
portMAX_DELAY);
|
||||
#endif
|
||||
}
|
||||
|
||||
} while (result == kStatus_ENET_TxFrameBusy);
|
||||
|
||||
return ERR_OK;
|
||||
}
|
||||
#else
|
||||
{
|
||||
uint32_t counter;
|
||||
|
||||
for (counter = ENET_TIMEOUT; counter != 0U; counter--)
|
||||
{
|
||||
if (ENET_SendFrame(ethernetif->base, ðernetif->handle, data, length) != kStatus_ENET_TxFrameBusy)
|
||||
{
|
||||
return ERR_OK;
|
||||
}
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
return ERR_TIMEOUT;
|
||||
}
|
||||
#endif
|
||||
|
||||
return ERR_TIMEOUT;
|
||||
}
|
||||
|
||||
struct pbuf *ethernetif_linkinput(struct netif *netif)
|
||||
@@ -537,6 +421,7 @@ struct pbuf *ethernetif_linkinput(struct netif *netif)
|
||||
}
|
||||
}
|
||||
|
||||
ENET_EnableInterrupts(ethernetif->base, kENET_RxFrameInterrupt);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -179,7 +179,7 @@ err_t ethernetif1_init(struct netif *netif);
|
||||
*
|
||||
* @param netif the lwip network interface structure for this ethernetif
|
||||
*/
|
||||
void ethernetif_input( struct netif *netif);
|
||||
void ethernetif_input( void *netif_arg);
|
||||
|
||||
int ETH_BSP_Config(void);
|
||||
void *ethernetif_config_enet_set(uint8_t enet_port);
|
||||
|
||||
@@ -223,9 +223,9 @@ CONFIG_FS_VFS_FATFS=y
|
||||
# Framework
|
||||
#
|
||||
CONFIG_TRANSFORM_LAYER_ATTRIUBUTE=y
|
||||
CONFIG_ADD_XIZI_FETURES=y
|
||||
# CONFIG_ADD_NUTTX_FETURES is not set
|
||||
# CONFIG_ADD_RTTHREAD_FETURES is not set
|
||||
CONFIG_ADD_XIZI_FEATURES=y
|
||||
# CONFIG_ADD_NUTTX_FEATURES is not set
|
||||
# CONFIG_ADD_RTTHREAD_FEATURES is not set
|
||||
# CONFIG_SUPPORT_SENSOR_FRAMEWORK is not set
|
||||
# CONFIG_SUPPORT_CONNECTION_FRAMEWORK is not set
|
||||
# CONFIG_SUPPORT_KNOWING_FRAMEWORK is not set
|
||||
|
||||
@@ -5,15 +5,29 @@ export AFLAGS := -c -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections
|
||||
|
||||
### if use USB function, use special lds file because USB uses ITCM
|
||||
|
||||
ifeq ($(CONFIG_BSP_USING_USB),y)
|
||||
export LFLAGS := -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi_xidatong.map,-cref,-u,Reset_Handler -T $(BSP_ROOT)/link-usb.lds
|
||||
ifeq ($(CONFIG_LIB_MUSLLIB), y)
|
||||
export LFLAGS += -nostdlib -nostdinc # -fno-builtin -nodefaultlibs
|
||||
export LIBCC := -lgcc
|
||||
export LINK_MUSLLIB := $(KERNEL_ROOT)/lib/musllib/libmusl.a
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_RESOURCES_LWIP), y)
|
||||
export LINK_LWIP := $(KERNEL_ROOT)/resources/ethernet/LwIP/liblwip.a
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_MCUBOOT_BOOTLOADER),y)
|
||||
export LFLAGS += -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi-xiwangtong-arm32-boot.map,-cref,-u,Reset_Handler -T $(BSP_ROOT)/link-bootloader.lds
|
||||
else ifeq ($(CONFIG_MCUBOOT_APPLICATION),y)
|
||||
export LFLAGS += -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi-xiwangtong-arm32-app.map,-cref,-u,Reset_Handler -T $(BSP_ROOT)/link-application.lds
|
||||
else ifeq ($(CONFIG_BSP_USING_USB),y)
|
||||
export LFLAGS += -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi-xiwangtong-arm32.map,-cref,-u,Reset_Handler -T $(BSP_ROOT)/link-usb.lds
|
||||
else
|
||||
export LFLAGS := -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi_xidatong.map,-cref,-u,Reset_Handler -T $(BSP_ROOT)/link.lds
|
||||
export LFLAGS += -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi-xiwangtong-arm32.map,-cref,-u,Reset_Handler -T $(BSP_ROOT)/link.lds
|
||||
endif
|
||||
|
||||
export CXXFLAGS := -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Dgcc -O0 -gdwarf-2 -g
|
||||
|
||||
export APPLFLAGS := -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi_app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
export APPLFLAGS := -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi-app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
|
||||
|
||||
export DEFINES := -DHAVE_CCONFIG_H -DCPU_MIMXRT1052CVL5B -DSKIP_SYSCLK_INIT -DEVK_MCIMXRM -DFSL_SDK_ENABLE_DRIVER_CACHE_CONTROL=1 -DXIP_EXTERNAL_FLASH=1 -D__STARTUP_INITIALIZE_NONCACHEDATA -D__STARTUP_CLEAR_BSS
|
||||
|
||||
@@ -51,6 +51,8 @@ void InitBoardHardware(void);
|
||||
/*! @brief The board name */
|
||||
#define BOARD_NAME "IMXRT1050"
|
||||
|
||||
#define configMAC_ADDR {0x02, 0x12, 0x13, 0x10, 0x15, 0x11}
|
||||
|
||||
#define NVIC_PRIORITYGROUP_0 0x00000007U /*!< 0 bits for pre-emption priority
|
||||
4 bits for subpriority */
|
||||
#define NVIC_PRIORITYGROUP_1 0x00000006U /*!< 1 bits for pre-emption priority
|
||||
|
||||
+32
-17
@@ -57,16 +57,12 @@
|
||||
#include "netif/ppp/pppoe.h"
|
||||
#include "lwip/igmp.h"
|
||||
#include "lwip/mld6.h"
|
||||
|
||||
#if USE_RTOS && defined(FSL_RTOS_FREE_RTOS)
|
||||
//#include "FreeRTOS.h"
|
||||
//#include "event_groups.h"
|
||||
#endif
|
||||
#include "lwip/sys.h"
|
||||
|
||||
#include "netif/ethernet.h"
|
||||
#include "enet_ethernetif.h"
|
||||
#include "enet_ethernetif_priv.h"
|
||||
|
||||
#include <board.h>
|
||||
#include "fsl_enet.h"
|
||||
#include "fsl_phy.h"
|
||||
#include "fsl_gpio.h"
|
||||
@@ -92,6 +88,20 @@ void Time_Update_LwIP(void)
|
||||
{
|
||||
}
|
||||
|
||||
ethernetif_config_t enet_cfg = {
|
||||
.phyAddress = BOARD_ENET0_PHY_ADDRESS,
|
||||
.clockName = kCLOCK_CoreSysClk,
|
||||
.macAddress = configMAC_ADDR,
|
||||
#if defined(FSL_FEATURE_SOC_LPC_ENET_COUNT) && (FSL_FEATURE_SOC_LPC_ENET_COUNT > 0)
|
||||
.non_dma_memory = non_dma_memory,
|
||||
#endif /* FSL_FEATURE_SOC_LPC_ENET_COUNT */
|
||||
};
|
||||
|
||||
void *ethernetif_config_enet_set(uint8_t enet_port)
|
||||
{
|
||||
return (void *)&enet_cfg;
|
||||
}
|
||||
|
||||
void ethernetif_clk_init(void)
|
||||
{
|
||||
const clock_enet_pll_config_t config = {.enableClkOutput = true, .enableClkOutput25M = false, .loopDivider = 1};
|
||||
@@ -113,7 +123,7 @@ void ethernetif_gpio_init(void)
|
||||
GPIO_WritePinOutput(GPIO1, 3, 1);
|
||||
}
|
||||
|
||||
void ETH_BSP_Config(void)
|
||||
int ETH_BSP_Config(void)
|
||||
{
|
||||
static int flag = 0;
|
||||
if(flag == 0)
|
||||
@@ -122,6 +132,7 @@ void ETH_BSP_Config(void)
|
||||
ethernetif_gpio_init();
|
||||
flag = 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ethernetif_phy_init(struct ethernetif *ethernetif,
|
||||
@@ -186,23 +197,27 @@ void ethernetif_phy_init(struct ethernetif *ethernetif,
|
||||
* @param netif the lwip network interface structure for this ethernetif
|
||||
*/
|
||||
|
||||
void ethernetif_input(struct netif *netif)
|
||||
void ethernetif_input(void *netif_arg)
|
||||
{
|
||||
struct pbuf *p;
|
||||
struct netif *netif = (struct netif *)netif_arg;
|
||||
err_t ret = 0;
|
||||
|
||||
LWIP_ASSERT("netif != NULL", (netif != NULL));
|
||||
|
||||
/* move received packet into a new pbuf */
|
||||
while ((p = ethernetif_linkinput(netif)) != NULL)
|
||||
{
|
||||
/* pass all packets to ethernet_input, which decides what packets it supports */
|
||||
if ((ret = netif->input(p, netif)) != ERR_OK)
|
||||
while (1) {
|
||||
sys_arch_sem_wait(get_eth_recv_sem(), WAITING_FOREVER);
|
||||
/* move received packet into a new pbuf */
|
||||
while ((p = ethernetif_linkinput(netif)) != NULL)
|
||||
{
|
||||
LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n"));
|
||||
lw_print("lw: [%s] ret %d p %p\n", __func__, ret, p);
|
||||
pbuf_free(p);
|
||||
p = NULL;
|
||||
/* pass all packets to ethernet_input, which decides what packets it supports */
|
||||
if ((ret = netif->input(p, netif)) != ERR_OK)
|
||||
{
|
||||
LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n"));
|
||||
lw_print("lw: [%s] ret %d p %p\n", __func__, ret, p);
|
||||
pbuf_free(p);
|
||||
p = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+18
-133
@@ -58,22 +58,9 @@
|
||||
#include "netif/ppp/pppoe.h"
|
||||
#include "lwip/igmp.h"
|
||||
#include "lwip/mld6.h"
|
||||
#include "lwip/sys.h"
|
||||
|
||||
#ifdef FSL_RTOS_XIUOS
|
||||
#define USE_RTOS 1
|
||||
#define FSL_RTOS_FREE_RTOS
|
||||
#endif
|
||||
|
||||
#if USE_RTOS && defined(FSL_RTOS_FREE_RTOS)
|
||||
|
||||
#ifdef FSL_RTOS_XIUOS
|
||||
#include "xs_sem.h"
|
||||
|
||||
#else
|
||||
#include "FreeRTOS.h"
|
||||
#include "event_groups.h"
|
||||
#include "list.h"
|
||||
#endif
|
||||
#include <xs_sem.h>
|
||||
|
||||
typedef uint32_t TickType_t;
|
||||
#define portMAX_DELAY ( TickType_t ) 0xffffffffUL
|
||||
@@ -91,27 +78,6 @@ typedef unsigned long UBaseType_t;
|
||||
#define pdPASS ( pdTRUE )
|
||||
#define pdFAIL ( pdFALSE )
|
||||
|
||||
#ifndef FSL_RTOS_XIUOS
|
||||
typedef struct EventGroupDef_t
|
||||
{
|
||||
EventBits_t uxEventBits;
|
||||
List_t xTasksWaitingForBits; /*< List of tasks waiting for a bit to be set. */
|
||||
|
||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||
UBaseType_t uxEventGroupNumber;
|
||||
#endif
|
||||
|
||||
#if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
|
||||
uint8_t ucStaticallyAllocated; /*< Set to pdTRUE if the event group is statically allocated to ensure no attempt is made to free the memory. */
|
||||
#endif
|
||||
} EventGroup_t;
|
||||
|
||||
struct EventGroupDef_t;
|
||||
typedef struct EventGroupDef_t * EventGroupHandle_t;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#include "enet_ethernetif.h"
|
||||
#include "enet_ethernetif_priv.h"
|
||||
|
||||
@@ -130,19 +96,13 @@ typedef struct EventGroupDef_t * EventGroupHandle_t;
|
||||
struct ethernetif
|
||||
{
|
||||
ENET_Type *base;
|
||||
#if (defined(FSL_FEATURE_SOC_ENET_COUNT) && (FSL_FEATURE_SOC_ENET_COUNT > 0)) || \
|
||||
(USE_RTOS && defined(FSL_RTOS_FREE_RTOS))
|
||||
#if (defined(FSL_FEATURE_SOC_ENET_COUNT) && (FSL_FEATURE_SOC_ENET_COUNT > 0))
|
||||
enet_handle_t handle;
|
||||
#endif
|
||||
#if USE_RTOS && defined(FSL_RTOS_FREE_RTOS)
|
||||
|
||||
#ifdef FSL_RTOS_XIUOS
|
||||
int enetSemaphore;
|
||||
#else
|
||||
EventGroupHandle_t enetTransmitAccessEvent;
|
||||
#endif
|
||||
EventBits_t txFlag;
|
||||
#endif
|
||||
|
||||
enet_rx_bd_struct_t *RxBuffDescrip;
|
||||
enet_tx_bd_struct_t *TxBuffDescrip;
|
||||
rx_buffer_t *RxDataBuff;
|
||||
@@ -153,14 +113,6 @@ struct ethernetif
|
||||
/*******************************************************************************
|
||||
* Code
|
||||
******************************************************************************/
|
||||
#if USE_RTOS && defined(FSL_RTOS_FREE_RTOS)
|
||||
|
||||
int32 lwip_obtain_semaphore(struct netif *netif)
|
||||
{
|
||||
struct ethernetif *ethernetif = netif->state;
|
||||
return (KSemaphoreObtain(ethernetif->enetSemaphore, WAITING_FOREVER) == EOK);
|
||||
}
|
||||
|
||||
#if FSL_FEATURE_ENET_QUEUE > 1
|
||||
static void ethernet_callback(ENET_Type *base, enet_handle_t *handle, uint32_t ringId, enet_event_t event, void *param)
|
||||
#else
|
||||
@@ -169,44 +121,19 @@ static void ethernet_callback(ENET_Type *base, enet_handle_t *handle, enet_event
|
||||
{
|
||||
struct netif *netif = (struct netif *)param;
|
||||
struct ethernetif *ethernetif = netif->state;
|
||||
BaseType_t xResult;
|
||||
|
||||
switch (event)
|
||||
{
|
||||
case kENET_RxEvent:
|
||||
ethernetif_input(netif);
|
||||
ENET_DisableInterrupts(ethernetif->base, kENET_RxFrameInterrupt);
|
||||
sys_sem_signal(get_eth_recv_sem());
|
||||
break;
|
||||
case kENET_TxEvent:
|
||||
#ifndef FSL_RTOS_XIUOS
|
||||
{
|
||||
portBASE_TYPE taskToWake = pdFALSE;
|
||||
|
||||
#ifdef __CA7_REV
|
||||
if (SystemGetIRQNestingLevel())
|
||||
#else
|
||||
if (__get_IPSR())
|
||||
#endif
|
||||
{
|
||||
xResult = xEventGroupSetBitsFromISR(ethernetif->enetTransmitAccessEvent, ethernetif->txFlag, &taskToWake);
|
||||
if ((pdPASS == xResult) && (pdTRUE == taskToWake))
|
||||
{
|
||||
portYIELD_FROM_ISR(taskToWake);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
xEventGroupSetBits(ethernetif->enetTransmitAccessEvent, ethernetif->txFlag);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
KSemaphoreAbandon(ethernetif->enetSemaphore);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LWIP_IPV4 && LWIP_IGMP
|
||||
err_t ethernetif_igmp_mac_filter(struct netif *netif, const ip4_addr_t *group,
|
||||
@@ -315,7 +242,6 @@ void ethernetif_enet_init(struct netif *netif, struct ethernetif *ethernetif,
|
||||
|
||||
ethernetif_phy_init(ethernetif, ethernetifConfig, &config);
|
||||
|
||||
#if USE_RTOS && defined(FSL_RTOS_FREE_RTOS)
|
||||
uint32_t instance;
|
||||
static ENET_Type *const enetBases[] = ENET_BASE_PTRS;
|
||||
static const IRQn_Type enetTxIrqId[] = ENET_Transmit_IRQS;
|
||||
@@ -327,51 +253,37 @@ void ethernetif_enet_init(struct netif *netif, struct ethernetif *ethernetif,
|
||||
#endif /* ENET_ENHANCEDBUFFERDESCRIPTOR_MODE */
|
||||
|
||||
/* Create the Event for transmit busy release trigger. */
|
||||
#ifdef FSL_RTOS_XIUOS
|
||||
if(ethernetif->enetSemaphore < 0)
|
||||
{
|
||||
ethernetif->enetSemaphore = KSemaphoreCreate(0);
|
||||
}
|
||||
#else
|
||||
ethernetif->enetTransmitAccessEvent = xEventGroupCreate();
|
||||
#endif
|
||||
ethernetif->txFlag = 0x1;
|
||||
|
||||
sys_sem_new(get_eth_recv_sem(), 0);
|
||||
config.interrupt |= kENET_RxFrameInterrupt | kENET_TxFrameInterrupt | kENET_TxBufferInterrupt;
|
||||
|
||||
for (instance = 0; instance < ARRAY_SIZE(enetBases); instance++)
|
||||
{
|
||||
if (enetBases[instance] == ethernetif->base)
|
||||
{
|
||||
#ifdef __CA7_REV
|
||||
GIC_SetPriority(enetRxIrqId[instance], ENET_PRIORITY);
|
||||
GIC_SetPriority(enetTxIrqId[instance], ENET_PRIORITY);
|
||||
#if defined(ENET_ENHANCEDBUFFERDESCRIPTOR_MODE) && ENET_ENHANCEDBUFFERDESCRIPTOR_MODE
|
||||
GIC_SetPriority(enetTsIrqId[instance], ENET_1588_PRIORITY);
|
||||
#endif /* ENET_ENHANCEDBUFFERDESCRIPTOR_MODE */
|
||||
#else
|
||||
NVIC_SetPriority(enetRxIrqId[instance], ENET_PRIORITY);
|
||||
NVIC_SetPriority(enetTxIrqId[instance], ENET_PRIORITY);
|
||||
#if defined(ENET_ENHANCEDBUFFERDESCRIPTOR_MODE) && ENET_ENHANCEDBUFFERDESCRIPTOR_MODE
|
||||
NVIC_SetPriority(enetTsIrqId[instance], ENET_1588_PRIORITY);
|
||||
#endif /* ENET_ENHANCEDBUFFERDESCRIPTOR_MODE */
|
||||
#endif /* __CA7_REV */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
LWIP_ASSERT("Input Ethernet base error!", (instance != ARRAY_SIZE(enetBases)));
|
||||
#endif /* USE_RTOS */
|
||||
|
||||
config.txAccelerConfig = kENET_TxAccelIpCheckEnabled | kENET_TxAccelProtoCheckEnabled;
|
||||
|
||||
/* Initialize the ENET module.*/
|
||||
ENET_Init(ethernetif->base, ðernetif->handle, &config, &buffCfg[0], netif->hwaddr, sysClock);
|
||||
|
||||
#if USE_RTOS && defined(FSL_RTOS_FREE_RTOS)
|
||||
ENET_SetCallback(ðernetif->handle, ethernet_callback, netif);
|
||||
#endif
|
||||
|
||||
ENET_ActiveRead(ethernetif->base);
|
||||
// low_level_init();
|
||||
}
|
||||
|
||||
ENET_Type **ethernetif_enet_ptr(struct ethernetif *ethernetif)
|
||||
@@ -394,45 +306,17 @@ static unsigned char *enet_get_tx_buffer(struct ethernetif *ethernetif)
|
||||
*/
|
||||
static err_t enet_send_frame(struct ethernetif *ethernetif, unsigned char *data, const uint32_t length)
|
||||
{
|
||||
#if USE_RTOS && defined(FSL_RTOS_FREE_RTOS)
|
||||
uint32_t counter;
|
||||
|
||||
for (counter = ENET_TIMEOUT; counter != 0U; counter--)
|
||||
{
|
||||
status_t result;
|
||||
|
||||
lw_print("lw: [%s] len %d\n", __func__, length);
|
||||
|
||||
do
|
||||
if (ENET_SendFrame(ethernetif->base, ðernetif->handle, data, length) != kStatus_ENET_TxFrameBusy)
|
||||
{
|
||||
result = ENET_SendFrame(ethernetif->base, ðernetif->handle, data, length);
|
||||
|
||||
if (result == kStatus_ENET_TxFrameBusy)
|
||||
{
|
||||
#ifdef FSL_RTOS_XIUOS
|
||||
KSemaphoreObtain(ethernetif->enetSemaphore, portMAX_DELAY);
|
||||
#else
|
||||
xEventGroupWaitBits(ethernetif->enetTransmitAccessEvent, ethernetif->txFlag, pdTRUE, (BaseType_t) false,
|
||||
portMAX_DELAY);
|
||||
#endif
|
||||
}
|
||||
|
||||
} while (result == kStatus_ENET_TxFrameBusy);
|
||||
|
||||
return ERR_OK;
|
||||
}
|
||||
#else
|
||||
{
|
||||
uint32_t counter;
|
||||
|
||||
for (counter = ENET_TIMEOUT; counter != 0U; counter--)
|
||||
{
|
||||
if (ENET_SendFrame(ethernetif->base, ðernetif->handle, data, length) != kStatus_ENET_TxFrameBusy)
|
||||
{
|
||||
return ERR_OK;
|
||||
}
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
return ERR_TIMEOUT;
|
||||
}
|
||||
#endif
|
||||
|
||||
return ERR_TIMEOUT;
|
||||
}
|
||||
|
||||
struct pbuf *ethernetif_linkinput(struct netif *netif)
|
||||
@@ -537,6 +421,7 @@ struct pbuf *ethernetif_linkinput(struct netif *netif)
|
||||
}
|
||||
}
|
||||
|
||||
ENET_EnableInterrupts(ethernetif->base, kENET_RxFrameInterrupt);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -21,11 +21,13 @@
|
||||
#ifndef __CONNECT_ETHERNET_H_
|
||||
#define __CONNECT_ETHERNET_H_
|
||||
|
||||
#include "enet_ethernetif.h"
|
||||
#include "enet_ethernetif_priv.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef sourceClock
|
||||
#define sourceClock CLOCK_GetFreq(kCLOCK_CoreSysClk)
|
||||
#endif
|
||||
|
||||
+5
-3
@@ -179,12 +179,14 @@ err_t ethernetif1_init(struct netif *netif);
|
||||
*
|
||||
* @param netif the lwip network interface structure for this ethernetif
|
||||
*/
|
||||
void ethernetif_input( struct netif *netif);
|
||||
|
||||
void ETH_BSP_Config(void);
|
||||
void ethernetif_input( void *netif_arg);
|
||||
|
||||
int ETH_BSP_Config(void);
|
||||
void *ethernetif_config_enet_set(uint8_t enet_port);
|
||||
int32 lwip_obtain_semaphore(struct netif *netif);
|
||||
|
||||
#define NETIF_ENET0_INIT_FUNC ethernetif0_init
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
@@ -9,7 +9,7 @@ ifeq ($(CONFIG_APP_SELECT_NEWLIB), y)
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(CONFIG_ADD_XIZI_FETURES), y)
|
||||
ifeq ($(CONFIG_ADD_XIZI_FEATURES), y)
|
||||
APPPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/transform_layer/xizi \
|
||||
-I$(KERNEL_ROOT)/../../APP_Framework/Framework/transform_layer/xizi/user_api/switch_api \
|
||||
-I$(KERNEL_ROOT)/../../APP_Framework/Framework/transform_layer/xizi/user_api/posix_support/include #
|
||||
|
||||
@@ -436,18 +436,18 @@ KERNELPATHS +=-I$(KERNEL_ROOT)/fs/compatibility_ch376 #
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_TRANSFORM_LAYER_ATTRIUBUTE), y)
|
||||
ifeq ($(CONFIG_ADD_XIZI_FETURES), y)
|
||||
ifeq ($(CONFIG_ADD_XIZI_FEATURES), y)
|
||||
ifeq ($(CONFIG_LIB_MUSLLIB), )
|
||||
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/transform_layer/xizi/user_api/posix_support/include #
|
||||
endif
|
||||
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/transform_layer/xizi #
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ADD_NUTTX_FETURES), y)
|
||||
ifeq ($(CONFIG_ADD_NUTTX_FEATURES), y)
|
||||
#
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ADD_RTTHREAD_FETURES), y)
|
||||
ifeq ($(CONFIG_ADD_RTTHREAD_FEATURES), y)
|
||||
#
|
||||
endif
|
||||
|
||||
@@ -533,6 +533,10 @@ KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lorawan_deviceno
|
||||
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lorawan_devicenode/lorawan-ed-stack/Mac/Crypto #
|
||||
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lorawan_devicenode/lorawan-ed-stack/Phy/region #
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LIB_USING_LORAWAN_GATEWAY_SC),y)
|
||||
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lorawan_gateway_single_channel/inc #
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CRYPTO), y)
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
#ifndef __LWIPOPTS_H__
|
||||
#define __LWIPOPTS_H__
|
||||
|
||||
#include <xsconfig.h>
|
||||
|
||||
/* ---------- Debug options ---------- */
|
||||
#ifndef LWIP_DEBUG
|
||||
#define LWIP_DEBUG 1
|
||||
@@ -535,10 +537,10 @@ The STM32F4x7 allows computing and verifying the IP, UDP, TCP and ICMP checksums
|
||||
#define DEFAULT_ACCEPTMBOX_SIZE 10
|
||||
|
||||
#define DEFAULT_THREAD_PRIO 20
|
||||
#define DEFAULT_THREAD_STACKSIZE 1024
|
||||
#define DEFAULT_THREAD_STACKSIZE 2048
|
||||
|
||||
#define TCPIP_THREAD_NAME "tcp"
|
||||
#define TCPIP_THREAD_STACKSIZE 4096
|
||||
#define TCPIP_THREAD_STACKSIZE 2048
|
||||
#define TCPIP_MBOX_SIZE 16
|
||||
#define TCPIP_THREAD_PRIO 20
|
||||
|
||||
|
||||
@@ -318,7 +318,6 @@ ip4_addr_t gw;
|
||||
void lwip_config_input(struct netif *net) {
|
||||
sys_thread_t th_id = 0;
|
||||
|
||||
extern void ethernetif_input(void *netif_arg);
|
||||
th_id = sys_thread_new("eth_input", ethernetif_input, net, LWIP_TASK_STACK_SIZE, 20);
|
||||
|
||||
if (th_id >= 0) {
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "tcpecho_raw.h"
|
||||
char tcp_demo_msg[LWIP_TEST_MSG_SIZE] = { 0 };
|
||||
char tcp_demo_ip[] = {192, 168, 250, 252};
|
||||
u16_t tcp_demo_port = LWIP_TARGET_PORT;
|
||||
u16_t tcp_demo_port = 80;
|
||||
int tcp_send_num = 0;
|
||||
int tcp_send_task_on = 0;
|
||||
uint32 tcp_interval = 50;
|
||||
|
||||
Reference in New Issue
Block a user