-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(Other): Add zephyr related wrapper and system file in MSDK #990
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
############################################################################## | ||
# | ||
# Copyright (C) 2023-2024 Analog Devices, Inc. | ||
# | ||
# Licensed 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. | ||
# | ||
############################################################################## | ||
|
||
|
||
if (${CONFIG_SOC} MATCHES "max32666") | ||
set(TARGET_LC "max32665") | ||
elseif (${CONFIG_SOC} MATCHES "max326651") | ||
set(TARGET_LC "max32650") | ||
else () | ||
set(TARGET_LC ${CONFIG_SOC}) | ||
endif() | ||
string(TOUPPER ${TARGET_LC} TARGET_UC) | ||
|
||
zephyr_compile_definitions( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ozersa also suggest adding There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, will consider on next update. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Jake-Carter I took a look it now, to apply it on #996 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ozersa just to have both zephyr_compile_definitions(
-D${TARGET_UC}
-DTARGET=${TARGET_UC}
...
) Some places in the drivers need to check the target value. Since the pre-processor can't do string comparisons sometimes #ifdef MAX78000
// ...
#endif |
||
-DTARGET=${TARGET_UC} | ||
-DMSDK_NO_GPIO_CLK_INIT=1 | ||
-DMSDK_NO_LOCKING=1 | ||
) | ||
|
||
get_filename_component(MSDK_LIBRARY_DIR "./Libraries" ABSOLUTE) | ||
set(MSDK_CMSIS_DIR ${MSDK_LIBRARY_DIR}/CMSIS/Device/Maxim/${TARGET_UC}) | ||
set(MSDK_PERIPH_DIR ${MSDK_LIBRARY_DIR}/PeriphDrivers) | ||
set(MSDK_PERIPH_SRC_DIR ${MSDK_PERIPH_DIR}/Source) | ||
set(MSDK_PERIPH_INC_DIR ${MSDK_PERIPH_DIR}/Include/${TARGET_UC}) | ||
|
||
zephyr_include_directories( | ||
./Include | ||
${MSDK_CMSIS_DIR}/Include | ||
${MSDK_PERIPH_INC_DIR} | ||
) | ||
|
||
add_subdirectory_ifdef(CONFIG_SOC_MAX32520 Source/MAX32520) | ||
add_subdirectory_ifdef(CONFIG_SOC_MAX32570 Source/MAX32570) | ||
add_subdirectory_ifdef(CONFIG_SOC_MAX32572 Source/MAX32572) | ||
add_subdirectory_ifdef(CONFIG_SOC_MAX32650 Source/MAX32650) | ||
add_subdirectory_ifdef(CONFIG_SOC_MAX32655 Source/MAX32655) | ||
add_subdirectory_ifdef(CONFIG_SOC_MAX32660 Source/MAX32660) | ||
add_subdirectory_ifdef(CONFIG_SOC_MAX32662 Source/MAX32662) | ||
add_subdirectory_ifdef(CONFIG_SOC_MAX32665 Source/MAX32665) | ||
add_subdirectory_ifdef(CONFIG_SOC_MAX32666 Source/MAX32665) | ||
add_subdirectory_ifdef(CONFIG_SOC_MAX32670 Source/MAX32670) | ||
add_subdirectory_ifdef(CONFIG_SOC_MAX32672 Source/MAX32672) | ||
add_subdirectory_ifdef(CONFIG_SOC_MAX32675 Source/MAX32675) | ||
add_subdirectory_ifdef(CONFIG_SOC_MAX32680 Source/MAX32680) | ||
add_subdirectory_ifdef(CONFIG_SOC_MAX32690 Source/MAX32690) | ||
add_subdirectory_ifdef(CONFIG_SOC_MAX78000 Source/MAX78000) | ||
add_subdirectory_ifdef(CONFIG_SOC_MAX78002 Source/MAX78002) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ozersa does this add the source files to the top-level build? Since Zephyr uses CMake it would also be nice to start setting things up more modularly for each library to support find_package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks noted.