Skip to content

Commit 5881b1f

Browse files
committed
board/maix-bit: add cmake support
This adds initial CMake support for `maix-bit` device. Signed-off-by: Yanfeng Liu <[email protected]>
1 parent 93b520f commit 5881b1f

File tree

3 files changed

+91
-0
lines changed

3 files changed

+91
-0
lines changed

arch/risc-v/src/k210/CMakeLists.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# ##############################################################################
2+
# arch/risc-v/src/k210/CMakeLists.txt
3+
#
4+
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
5+
# license agreements. See the NOTICE file distributed with this work for
6+
# additional information regarding copyright ownership. The ASF licenses this
7+
# file to you under the Apache License, Version 2.0 (the "License"); you may not
8+
# use this file except in compliance with the License. You may obtain a copy of
9+
# the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16+
# License for the specific language governing permissions and limitations under
17+
# the License.
18+
#
19+
# ##############################################################################
20+
21+
set(SRCS k210_head.S k210_start.c k210_irq.c k210_irq_dispatch.c)
22+
23+
list(APPEND SRCS k210_timerisr.c k210_allocateheap.c k210_clockconfig.c)
24+
25+
list(APPEND SRCS k210_lowputc.c k210_serial.c k210_fpioa.c k210_gpiohs.c)
26+
27+
if(CONFIG_BUILD_PROTECTED)
28+
list(APPEND SRCS k210_userspace.c)
29+
endif()
30+
31+
target_sources(arch PRIVATE ${SRCS})
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# ##############################################################################
2+
# boards/risc-v/k210/maix-bit/CMakeLists.txt
3+
#
4+
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
5+
# license agreements. See the NOTICE file distributed with this work for
6+
# additional information regarding copyright ownership. The ASF licenses this
7+
# file to you under the Apache License, Version 2.0 (the "License"); you may not
8+
# use this file except in compliance with the License. You may obtain a copy of
9+
# the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16+
# License for the specific language governing permissions and limitations under
17+
# the License.
18+
#
19+
# ##############################################################################
20+
21+
add_subdirectory(src)
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# ##############################################################################
2+
# boards/risc-v/k230/canmv230/src/CMakeLists.txt
3+
#
4+
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
5+
# license agreements. See the NOTICE file distributed with this work for
6+
# additional information regarding copyright ownership. The ASF licenses this
7+
# file to you under the Apache License, Version 2.0 (the "License"); you may not
8+
# use this file except in compliance with the License. You may obtain a copy of
9+
# the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16+
# License for the specific language governing permissions and limitations under
17+
# the License.
18+
#
19+
# ##############################################################################
20+
21+
set(SRCS k210_bringup.c k210_boot.c)
22+
23+
if(CONFIG_BOARDCTL)
24+
list(APPEND SRCS k210_appinit.c)
25+
endif()
26+
27+
if(CONFIG_ARCH_LEDS)
28+
list(APPEND SRCS k210_leds.c)
29+
endif()
30+
31+
if(CONFIG_DEV_GPIO)
32+
list(APPEND SRCS k210_gpio.c)
33+
endif()
34+
35+
target_sources(board PRIVATE ${SRCS})
36+
37+
set(LDFILE ld.script)
38+
39+
set_property(GLOBAL PROPERTY LD_SCRIPT "${NUTTX_BOARD_DIR}/scripts/${LDFILE}")

0 commit comments

Comments
 (0)