@@ -59,25 +59,36 @@ of the following ways:
5959
6060 ` west init -m https://github.com/bacnet-stack/bacnet-stack-zephyr --mr default $my_workspace `
6161
62- - Note that as Zephyr OS versions change, their API often changes.
63- This library will use the following methods to accommodate the changes:
64- 1 . Use defines from <zephyr/version.h> for API changes:
65- ```
66- #if ZEPHYR_VERSION_CODE >= ZEPHYR_VERSION(4,2,0)
67- typedef uint64_t mgmt_event_t;
68- #else
69- typedef uint32_t mgmt_event_t;
70- #endif
71- ```
72- 2. In CMakeLists.txt via trying to load specific versions of the Zephyr
73- package or checking using:
74- ```
75- if ("${KERNEL_VERSION_STRING}" VERSION_GREATER_EQUAL "4.2.0")
76- # Do stuff...
77- endif()
78- ```
79- 3. In Kconfig by using 2 above and trying to load specific versions
80- of the Zephyr plugin and updating CONF_FILE accordingly.
62+ # Backward Compatible Samples and Applications
63+
64+ Note that as Zephyr OS versions change, their API often changes.
65+ This library will use the following methods to accommodate the changes:
66+
67+ 1 . Use defines from <zephyr/version.h> for API changes:
68+ ```
69+ #if ZEPHYR_VERSION_CODE >= ZEPHYR_VERSION(4,2,0)
70+ typedef uint64_t mgmt_event_t;
71+ #else
72+ typedef uint32_t mgmt_event_t;
73+ #endif
74+ ```
75+ 2. In CMakeLists.txt via trying to load specific versions of the Zephyr
76+ package or checking using:
77+ ```
78+ if ("${KERNEL_VERSION_STRING}" VERSION_GREATER_EQUAL "4.2.0")
79+ # Do stuff...
80+ endif()
81+ ```
82+ 3. In Kconfig by using 2 above and trying to load specific versions
83+ of the Zephyr plugin and updating CONF_FILE accordingly.
84+ 4. In .dts, .dtsi or .overlay files, use KERNEL_VERSION_NUMBER or
85+ KERNEL_VERSION_MAJOR defines. The C preprocessor is run on all
86+ devicetree files to expand macro references.
87+ ```
88+ #if KERNEL_VERSION_MAJOR < 4
89+ /delete-node/ &storage_partition;
90+ #endif
91+ ```
8192
8293## Hello BACnet Stack
8394
0 commit comments