Skip to content
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

The macro definitions of IOT solution USB 4G module (AEGHB-804) #403

Closed
3 tasks done
JDingOneSelf opened this issue Sep 7, 2024 · 4 comments
Closed
3 tasks done

Comments

@JDingOneSelf
Copy link

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

Macro Definition of IOT solution USB 4G module IOT_USBH_MODEM_VER_MAJOR, IOT_USBH_MODEM_VER_MINOR, IOT_USBH_MODEM_VER_minor, IOT_USBH_MODEM_VER_PATCH is not defined in the file but can be used, how to implement it, I put the USB components in the components file of the local project, I need to define, is there a method to implement it like a routine
Error messages:
components/iot_usbh_modem/src/usbh_modem_board.c:654:80: error: expected expression before ',' tokenESP_LOGI(TAG, "iot_usbh_modem, version: %d.%d.%d", IOT_USBH_MODEM_VER_MAJOR,IOT_USBH_MODEM_VER_MINOR,IOT_USBH_MODEM_VER_PATCH);

@github-actions github-actions bot changed the title The macro definitions of IOT solution USB 4G module The macro definitions of IOT solution USB 4G module (AEGHB-804) Sep 7, 2024
@leeebo
Copy link
Collaborator

leeebo commented Sep 18, 2024

@JDingOneSelf the cmake_utilities provides the CMake API cu_pkg_define_version to parse the component's version from iot_usbh_modem/idf_component.yml then add version related macros.

@JDingOneSelf
Copy link
Author

如果我把这几个组件移出managed_components,放在components中如何为这几个宏赋值呢?试过-DIOT_USBH_MODEM_VER_MAJOR ,提示宏重复定义

@lijunru-hub
Copy link
Contributor

直接在组件的 CmakeLists 里面添加
cu_pkg_define_version(${CMAKE_CURRENT_LIST_DIR})
并在 idf_component.yml 里面添加对 camke_utilities 的依赖
cmake_utilities: "0.*"
如果只是为了编译成功,可以把这个打印注释掉

@JDingOneSelf
Copy link
Author

谢谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants