dbuezas / lgt8fx

Board Package for Logic Green LGT8F328P LGT8F328D and LGT8F88D
359 stars 90 forks source link

new: uint16_t analogReadVccmV() #238

Closed holgerlembke closed 1 year ago

holgerlembke commented 1 year ago

Discussion was at https://github.com/dbuezas/lgt8fx/issues/228

LaZsolt commented 1 year ago

Hi Holger!

  1. Do not remove VCCM constant from file pins_aruino.h for compatibility reasons. Old users or libraries may using it.
  2. In the definitions for LGT8F328D has no V5D1 or V5D4 and LGT8F328D has no ADCSRD register so the condition if (pin == V5D1 || pin == V5D4) { ADCSRD |= 0x06; } in your version of wiring_analog.c line 108 going to generate a compile error when trying to compile for LGT8F328D. This compiler condition must be respected: #if defined(__LGT8FX8P__) before if (pin == .... https://github.com/holgerlembke/lgt8fx/blob/d0b60422caf7e5b8f828a37ec1607e6bae0ba105/lgt8f/cores/lgt8f/wiring_analog.c#L106-L110
  3. Not important but analogReadVccmV() not the part of the basic Arduino functions.
dbuezas commented 1 year ago

Thank you @holgerlembke! Marked as draft to avoid merging it by accident. Feel free to remove the draft flag after implementing the requests from @LaZsolt, then we can merge it :)