Open AsuraZeng opened 1 year ago
The fix appear correct to me, but you should rework the commit message: set the number of bits to those that the hardware reports - rather than hard-coded 10 bits.
Also, DEFAULT_BITS seems unused now.
yes, remove the DEFAULT_BITS
and rewrote the commit.
On second look, the situation looks less clear to me again: raw_bits
is actually a global variable and not a local var that was forgotten to be used in mraa_aio_set_bit
as I initially thought. So, it should be perfectly fine to first set a smaller value_bits by calling mraa_aio_set_bit
and then let node-red-nodes raise that again to the value the concrete platform supports. The actual bug must be elsewhere, this here is just papering over it.
None-issue, see https://github.com/siemens/meta-iot2050/issues/407. MRAA chose to start AIO pins with a hardware-independent number bit of bits, even if the hardware can do more. Nothing to do here.
Set the adc bits to the default value of 10, so the raw bits of the platform will not take effect during initialization, and it is always the default value
Signed-off-by: chao zeng chao.zeng@siemens.com