lib.rs 805 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright (c) 2006-2025, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author notes
  8. * 2025-10-23 foxglove log component demo
  9. */
  10. #![no_std]
  11. extern crate alloc;
  12. /* When the `enable-log` feature is enabled, expose logging module and helpers */
  13. #[cfg(feature = "enable-log")]
  14. pub mod logging;
  15. #[cfg(feature = "enable-log")]
  16. use rt_rust::println;
  17. #[cfg(feature = "enable-log")]
  18. use crate::logging::Level;
  19. /* Import panic handler parameters from rt_rust library */
  20. use rt_rust::param::{Param, ParamItem};
  21. /* Provide a no-op implementation when the `enable-log` feature is disabled */
  22. #[cfg(not(feature = "enable-log"))]
  23. pub extern "C" fn component_init() {
  24. /* Empty implementation to ensure the library still links */
  25. }