FreeRTOS / Lab-Project-FreeRTOS-LoRaWAN

Reference implementation of LoRaWAN connectivity on FreeRTOS.
MIT License
52 stars 22 forks source link

Applying LoRaMac-node not working - incompatible whitespaces #4

Closed omrisarig13 closed 3 years ago

omrisarig13 commented 3 years ago

I followed the download instructions but unfortunately, they did not work for me.

When I tried to apply the patch to change the LoRaMack-node repository, I receive errors. The errors I received were:

$ git apply FreeRTOS-LoRaMac-node-v4_4_4.patch
error: patch failed: LoRaMac-node/src/mac/LoRaMac.h:458
error: LoRaMac-node/src/mac/LoRaMac.h: patch does not apply
error: patch failed: LoRaMac-node/src/radio/radio.h:106
error: LoRaMac-node/src/radio/radio.h: patch does not apply
error: patch failed: LoRaMac-node/src/radio/sx126x/radio.c:319
error: LoRaMac-node/src/radio/sx126x/radio.c: patch does not apply
error: patch failed: LoRaMac-node/src/system/timer.h:32
error: LoRaMac-node/src/system/timer.h: patch does not apply

To fix this issue, I added the option of --whitespace=fix to the apply command, and then it worked as expected.

$ git apply --whitespace=fix FreeRTOS-LoRaMac-node-v4_4_4.patch

Looking at the diff after applying this patch, there are a bit more differences, but they are only changes in whitespace in the system.

I am using Windows, and needed to do the same both when I worked with git for windows and when I worked in WSL.

I believe that adding the whitespace flag should fix the problem and shouldn't cause any other issues. If you agree with that, I can provide a relevant pull request.

ravibhagavandas commented 3 years ago

Hi @omrisarig13

Thanks for bringing up this issue and suggesting the fix. I can confirm that the --whitespace=fix option works on posix based systems ( linux and MACOS) as well. Please go ahead and raise a pull request to update the documentation to include the option for this.