2021-10-27 04:00 PM
So I have run into this a couple of times. Right now I have one that I cannot find a good fix for.
I set SNTP_GET_SERVERS_FROM_DHCP to 1 in CubeMX and generated the project then compiled. It is correctly set in lwipopts.h but in sntp.h and sntp.c it acts as if it is set to zero!
sntp.c has sntp.h and lwip/opt.h included in it.
sntp.h has sntp_opts.h included in it.
sntp_opts.h has lwip/opt.h included in it.
lwip/opt.h has lwipopts.h included in it.
So there's a bunch of nesting of includes and it seems that lwip/opt.h is duplicated in the path to sntp.c.
This seems like an issue with how lwip is set up or a compiler issue... I'm not an expert on this stuff. Anyone have ideas?
Mike.
Solved! Go to Solution.
2021-10-27 06:54 PM
Defines are handled by the GNU GCC preprocessor, which is an extremely commonly used software and is unlikely to have glaring bugs in the #define handling.
Duplicated include files are generally fine as there should be include guards or a #pragma once to prevent it from being included multiple times.
> in sntp.h and sntp.c it acts as if it is set to zero!
How did you determine this exactly?
2021-10-27 06:54 PM
Defines are handled by the GNU GCC preprocessor, which is an extremely commonly used software and is unlikely to have glaring bugs in the #define handling.
Duplicated include files are generally fine as there should be include guards or a #pragma once to prevent it from being included multiple times.
> in sntp.h and sntp.c it acts as if it is set to zero!
How did you determine this exactly?
2021-10-28 08:58 AM
OK, turns out there was another Define I needed to SET that was resetting the one I was chasing...
Thanks for your reply!
Mike.