eProsima / Micro-XRCE-DDS-Client

Micro XRCE-DDS Client repository. Looking for commercial support? Contact info@eprosima.com
Apache License 2.0
130 stars 82 forks source link

Fixed removal of z_impl_clock_gettime in zephyr 3.5.99 #378

Closed danielallstar closed 7 months ago

danielallstar commented 7 months ago

Solution to the following problem: https://github.com/micro-ROS/micro_ros_zephyr_module/issues/134

The notified problem is: " in function uxr_nanos': undefined reference to z_impl_clock_gettime' " The Zephyr developers have removed the `z_impl_clock_gettime' function and replaced it by the clock_gettime function. I have implemented the new function in the time.c file, while maintaining compatibility with the older zephyr versions.

richiprosima commented 7 months ago

Build status:

pablogs9 commented 7 months ago

The CI is failing due to uncrustify failure, you can fix it using the following operation inside the folder and pushing the changes.

# Install uncrustify
# git clone https://github.com/uncrustify/uncrustify --branch uncrustify-0.72.0 --single-branch uncrustify
# mkdir -p uncrustify/build
# cd uncrustify/build
# cmake -DCMAKE_INSTALL_PREFIX=../install ..
# make -j$(nproc)
# cd ../..
# export PATH=${PWD}/uncrustify/install/bin:$PATH

# Get the config and check
curl -l https://raw.githubusercontent.com/eProsima/cpp-style/master/uncrustify.cfg -o uncrustify.cfg
find src test include examples \( -name "*.cpp" -o -name "*.c" -o -name "*.h" -o -name "*.hpp" \) -exec uncrustify -c uncrustify.cfg --check {} +
danielallstar commented 7 months ago

After running the crustify operation inside the folder, git does not see any changes to commit. This does not seem to be the expected behavior. What do you suggest to do now?

pablogs9 commented 7 months ago

Sorry I did not write the correct command, instead of --check use --no-backup in uncrustify command

danielallstar commented 7 months ago

I pushed the code with the applied crustify changes

richiprosima commented 7 months ago

Build status:

pablogs9 commented 7 months ago

Testing here: https://github.com/micro-ROS/micro_ros_zephyr_module/pull/136

pablogs9 commented 7 months ago

https://github.com/micro-ROS/micro_ros_zephyr_module/pull/136 is green, so I merge this.

@danielallstar thanks a lo for the contribution!