timmbogner / Farm-Data-Relay-System

A system that uses ESP-NOW, LoRa, and other protocols to transport sensor data in remote areas without relying on WiFi.
MIT License
485 stars 108 forks source link

move #ifdefs used to enable or disable features from function scope t… #144

Closed aviateur17 closed 1 year ago

aviateur17 commented 1 year ago

…o file scope

Takes the #ifdefs used to disable and enable features like filesystem logging, ESP-NOW, LoRa, Debug, WiFi, etc. from function by function to including or excluding entire header files thus being a cleaner or more straightforward and simpler approach.

aviateur17 commented 1 year ago

After modifying the code I went though and made sure all examples compiled using Arduino 1.8.19. I went through the config files and commented and uncommented the USE_xxx features out and compiled different combinations to make sure all the code works.

timmbogner commented 1 year ago

Awesome, thanks! That's gonna make things a lot simpler. I'll get this in before the release, which I'm hoping to do tomorrow.

timmbogner commented 1 year ago

ESP8266 does not like your const changes in ESP-NOW.

aviateur17 commented 1 year ago

Thanks for testing. I tested against ESP32 board only. Guess I will have to test ESP8266 in the future. I've been wondering if there are some automated compile tests that can be done to make sure changes compile against all configurations and all platforms. I'm not sure if that's called unit testing or what that automated testing would be called. I gotta believe there is a way to set that up.

aviateur17 commented 1 year ago

After I finish making these timekeeping changes I'll go back and compile against ESP8266 and update this PR.

timmbogner commented 1 year ago

No rush... I'm not going to finish up tonight so I won't get around to pulling it until tomorrow afternoon.

I gotta believe there is a way to set that up.

Maybe with Arduino CLI and a batch file? That would be really handy.

Actually... I should look into that in general to streamline my process of editing in the git folder, drag/copy to Arduino folder, click confirm, then clicking compile in Arduino IDE. It's not too bad til you have to fix three small errors in a row and suddenly want to give up 😅

aviateur17 commented 1 year ago

Fixed issue with const declaration in commit https://github.com/timmbogner/Farm-Data-Relay-System/pull/144/commits/9b5323e447870e7672bccaa8290489dcfc72594d