Open uzi18 opened 4 years ago
ADC_MODE(ADC_VCC);
has to be outside the scope of any function, so you cannot make it runtime configurable.
If that has changed I would love to see a link explaining it.
this macro ADC_MODE creates such function like in my patch but with constant return, my idea is to avoid it and return what we want to measure
The call to that macro is more like a compile-time call if it is included in the code, then the Arduino core library does set the ADC mode to TOUT. It is like an override function definition of a weak function declaration. So it is still compile time and not runtime, as we cannot access variables declared in the Arduino stack. Or you should add core lib only code that will read something from RTC memory, which also forces a reboot to make it work if you do want to set it different from the 'default' value. But I'm not sure if that code is able to access RTC memory reserved for "user" code.
so ... maybe it is possible to workaround this part of hardware, but we need 1 free byte in rtc mem :)
And we need to be able to read that part of RTC... We cannot use anything that's part of the Arduino stack, only what's available in the SDK.
@TD-er maybe unused1 or unused2 byte in RTCStruct? need to figure out how to read exactly this what we want
You can use those unused. You need to realize you should read the RTC data per 32 bit and also the address is per 32 bit, so you have to divide by 4 when addressing. See the comments in the RTC struct to see what are we use.
yes, know but maybe will try tomorrow, priority is low so maybe afternon or late night will look at it, usually take bed at 3 or 4 morning :) why we have still no gitter.im channel??
Well I am connected to Slack. You can get an invite for the ESPEasy channel if you like.
yes but slack is locked, if you can?
How about such change:
@TD-er what do you think?