-
-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix function not in scope #624
Conversation
I'm surprised you encouter these issues as we're not only using a PlatformIO workflow, but I also use PlatformIO and VS Code myself for development and don't run into these issues. It's also the reason we have already forward declarations where necessary. But since you are using the same environment as I do, I hope you could help me with this problem:
The weird thing is that the quoted line (which is indeed at 1008) has nothing to do with the added code which is actually in the 7700++ range. The error disappears when I remove the |
Ok, I managed to solve my problem by adding a |
Some things before considering merging: Secondly, please do not add preprocessor directives such as in the case of DHT_PINS. Nowadays these directives are just a leftover from earlier times where we used these directives as configuration options. Eventually, I'm trying to get rid of these and move everything to configuration using variables. |
I have the same platformio.ini except that I'm using For example I get: I don't see the forward declaration at the beginning of BSB_LAN.ino. Can you point me to the line? I'll do the change. |
|
So please run it with my platformio.ini. If neither the GitHub workflow (which runs under Linux) nor my MacOS build process exhibits this error, then the problem is more likely to be on your side... |
If the error is not reproducible here or elsewhere, you can also just add the required forward-declarations in you BSB_LAN_custom_global.h. |
I'm most likely not going to accept this because it will significantly increase completion of the workflow. One run usually takes around 40 seconds to one minute. This change would result in an approx. 20 minute run - per architecture. |
Sorry, commented in wrong PR... |
Just one more general comment on what kind of PRs help me (and thus the project) and which one not so much: |
I think this deserves a note in the config file. I thought I had to configure the options I was interested in and I run into several compilation issue. If I don't touch them, it works perfectly, the same way it works on github actions. |
The config file is not a manual. In the manual, we explain how and what to configure. If it is still mentioned there that you can disable these functions, then that is the place to correct that. I appreciate your desire to help, but as I mentioned before, I prefer to discuss any changes with me first before submitting PRs that may become obsolete in the forseeable future. And as you can see in the ChangeLog, removing the need for preprocessor directives has been something I've been working on in the last couple of weeks... |
I started now to move the BUTTONS code from main code (which I had planned to anyway because it no longer works with the default installation) to the custom code library and the result is as bizarre as the fact that I needed to define WiFiEvent_t for the Arduino code, despite it should only be active in ESP32 code segments. Why simply removing a few lines of code results in dozens of functions required to be forward-declared without these functions even being used in these lines of code, is really beyond me. Yes, it makes sense that these forward declarations are necessary, but why the compiler didn't complain before but does now doesn't. |
Ok, most configuration definements are now removed and almost all configuration options can now be done without reflashing. |
Your IDE is using a pre-processor that declares all your functions.
Platformio is not using such and fails to compile. I fixed the scope issue by moving a few functions and mainly pre-declaring functions that are used before their definition (what your pre-processor is doing to your code before compiling) to keep the diff small.
Also moved your recent
startLoggingDevice
function between #if defined LOGGER - #endif statements