nRF24 / RF24Network

OSI Layer 3 Networking for nRF24L01(+) and nRF52x on Arduino and Raspberry Pi
https://nrf24.github.io/RF24Network/
GNU General Public License v2.0
353 stars 163 forks source link

Modifications for 64-bit OS #218

Closed TMRh20 closed 4 months ago

TMRh20 commented 4 months ago

All I did was change unsigned long to uint32_t in examples, and now the formatting check is failing lol. I'm thinking we should use the version of clang-format that ships with RPi, which is currently 14.0.6 on my RPi5.

In any case, I'm not sure whether to make the same changes in the regular Arduino and Pico examples, because I don't think there are any 64-bit Arduinos yet. We might want to change it for continuity, so they all read the same, but that would be the only reason I think.

2bndy5 commented 4 months ago

I'm thinking we should use the version of clang-format that ships with RPi, which is currently 14.0.6 on my RPi5

I have a PR in the org repo to update to ~v17~ v16. See nRF24/.github#11. But I see clang-format v16 is the latest available on my RPi4:

brendan@rpi4-64bit:~ $ sudo apt list clang-format*
Listing... Done
clang-format-13/stable 1:13.0.1-11+b2 arm64
clang-format-13/stable 1:13.0.1-11+b2 armhf
clang-format-14/stable 1:14.0.6-12 arm64
clang-format-14/stable 1:14.0.6-12 armhf
clang-format-15/stable 1:15.0.6-4+b1 arm64
clang-format-15/stable 1:15.0.6-4+b1 armhf
clang-format-16/stable 1:16.0.6-15~deb12u1 arm64
clang-format-16/stable 1:16.0.6-15~deb12u1 armhf
clang-format/stable 1:14.0-55.7~deb12u1 arm64
clang-format/stable 1:14.0-55.7~deb12u1 armhf
2bndy5 commented 4 months ago

I'm not sure whether to make the same changes in the regular Arduino and Pico examples

Whatever allocates a smaller footprint is preferable I think.

2bndy5 commented 4 months ago

It is odd (& annoying) that unchanged files passed the checks in master but are failing on this branch (RF24Network_config.h and RF24Network.cpp). I can limit the check-formatting step to only analyze changed lines...

TMRh20 commented 4 months ago

RPi3 & RPi2: RPi OS 32-bit

clang-format-11/stable 1:11.1.0-6+rpi2 armhf
clang-format-13/stable 1:13.0.1-11+rpi1+b1 armhf
clang-format-14/stable,now 1:14.0.6-12+rpi1 armhf [installed,automatic]
clang-format-15/stable 1:15.0.6-4+rpi1+b1 armhf
clang-format/stable,now 1:14.0-55.7~deb12u1 armhf [installed]

RPi5: RPi OS 64-bit

clang-format-13/stable 1:13.0.1-11+b2 arm64
clang-format-13/stable 1:13.0.1-11+b2 armhf
clang-format-14/stable,now 1:14.0.6-12 arm64 [installed,automatic]
clang-format-14/stable 1:14.0.6-12 armhf
clang-format-15/stable 1:15.0.6-4+b1 arm64
clang-format-15/stable 1:15.0.6-4+b1 armhf
clang-format-16/stable 1:16.0.6-15~deb12u1 arm64
clang-format-16/stable 1:16.0.6-15~deb12u1 armhf
clang-format/stable,now 1:14.0-55.7~deb12u1 arm64 [installed]
clang-format/stable 1:14.0-55.7~deb12u1 armhf

So v16 is available on newer RPis, but the default install across versions is v14.0.6 it looks like. As long as I can format stuff I'm good lol.

2bndy5 commented 4 months ago

Ok, I'll adjust for v14.

2bndy5 commented 4 months ago

BTW, you can use winget install LLVM --version xx.y.z to install clang-format (and other LLVM tools) on windows 10+. 😉 I rarely push commits directly from my RPi.

2bndy5 commented 4 months ago

Is this something we should also push to 1.x branch?

TMRh20 commented 4 months ago

Hmm, I forgot about the 1.x branch already. I'll do that one right before merging these changes I guess.

2bndy5 commented 4 months ago

It is odd (& annoying) that unchanged files passed the checks in master but are failing on this branch (RF24Network_config.h and RF24Network.cpp). I can limit the check-formatting step to only analyze changed lines...

We might have been using v12.0.0 before, but the CI seems to be using v12.0.1 now. I don't know if that was the actual problem though.