Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ The git repository is hosted at the following site:
* Changed gitignore to ignore the build folder.

### Added
* Added KERNEL_VERSION_MAJOR check in samples DTS overlay files to handle
changes in Zephyr OS version 4
* Added BACDL ZIGBEE and BSC datalink defines to Kconfig & CMakeLists.txt (#35)
* Added baclog, you-are, who-am-i, create-object, delete-object, write-group,
bramfs, bsramfs, and color-rgb modules to cmake. (#35)
Expand Down
49 changes: 30 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,25 +59,36 @@ of the following ways:

`west init -m https://github.com/bacnet-stack/bacnet-stack-zephyr --mr default $my_workspace`

- Note that as Zephyr OS versions change, their API often changes.
This library will use the following methods to accommodate the changes:
1. Use defines from <zephyr/version.h> for API changes:
```
#if ZEPHYR_VERSION_CODE >= ZEPHYR_VERSION(4,2,0)
typedef uint64_t mgmt_event_t;
#else
typedef uint32_t mgmt_event_t;
#endif
```
2. In CMakeLists.txt via trying to load specific versions of the Zephyr
package or checking using:
```
if ("${KERNEL_VERSION_STRING}" VERSION_GREATER_EQUAL "4.2.0")
# Do stuff...
endif()
```
3. In Kconfig by using 2 above and trying to load specific versions
of the Zephyr plugin and updating CONF_FILE accordingly.
# Backward Compatible Samples and Applications

Note that as Zephyr OS versions change, their API often changes.
This library will use the following methods to accommodate the changes:

1. Use defines from <zephyr/version.h> for API changes:
```
#if ZEPHYR_VERSION_CODE >= ZEPHYR_VERSION(4,2,0)
typedef uint64_t mgmt_event_t;
#else
typedef uint32_t mgmt_event_t;
#endif
```
2. In CMakeLists.txt via trying to load specific versions of the Zephyr
package or checking using:
```
if ("${KERNEL_VERSION_STRING}" VERSION_GREATER_EQUAL "4.2.0")
# Do stuff...
endif()
```
3. In Kconfig by using 2 above and trying to load specific versions
of the Zephyr plugin and updating CONF_FILE accordingly.
4. In .dts, .dtsi or .overlay files, use KERNEL_VERSION_NUMBER or
KERNEL_VERSION_MAJOR defines. The C preprocessor is run on all
devicetree files to expand macro references.
```
#if KERNEL_VERSION_MAJOR < 4
/delete-node/ &storage_partition;
#endif
```

## Hello BACnet Stack

Expand Down
3 changes: 2 additions & 1 deletion zephyr/samples/profiles/b-ld/boards/nucleo_f429zi.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
*
* SPDX-License-Identifier: Apache-2.0
*/

#if KERNEL_VERSION_MAJOR < 4
/delete-node/ &storage_partition;
#endif

/ {
leds {
Expand Down
3 changes: 2 additions & 1 deletion zephyr/samples/profiles/b-ls/boards/nucleo_f429zi.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
*
* SPDX-License-Identifier: Apache-2.0
*/

#if KERNEL_VERSION_MAJOR < 4
/delete-node/ &storage_partition;
#endif

&flash0 {
partitions {
Expand Down
3 changes: 2 additions & 1 deletion zephyr/samples/profiles/b-sa/boards/nucleo_f429zi.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
*
* SPDX-License-Identifier: Apache-2.0
*/

#if KERNEL_VERSION_MAJOR < 4
/delete-node/ &storage_partition;
#endif

&flash0 {
partitions {
Expand Down
3 changes: 2 additions & 1 deletion zephyr/samples/profiles/b-ss/boards/nucleo_f429zi.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
*
* SPDX-License-Identifier: Apache-2.0
*/

#if KERNEL_VERSION_MAJOR < 4
/delete-node/ &storage_partition;
#endif

&flash0 {
partitions {
Expand Down