p3p / pio-framework-arduino-lpc176x

10 stars 20 forks source link

Ability to use full-resolution 12-bit ADC values #21

Closed LinFor closed 4 years ago

LinFor commented 4 years ago

get_result() splitted into two methods: get_result() for arduino/current marlin compatability and get_result_12bit() to get full-resolution value

p3p commented 4 years ago

Hey thanks for this, but I have a few changes I'm working on that will supersede these changes.

Updates the adc reading to burst mode removing any overhead, and implements the void analogReadResolution(uint8_t resolution); Arduino api function allowing use of upto 16bit (lowpass filtered) with AnalogRead()

(https://github.com/p3p/pio-framework-arduino-lpc176x/tree/pr_gpio_new)

Allowing Marlin to use the higher resolution is a nice PR, I'l make sure it works with my changes.

LinFor commented 4 years ago

Ok, will be great! I'll change my Marlin PR to use analogReadResolution, it's not a problem at all. But to complete Marlin PR we'll need a release of this lib to correct PIO dependencies.

p3p commented 4 years ago

okay I'l try and get this tested so I can push it out, I will also need to push out a PR for Marlin compatibility with the changes, it was less stressful when no there wasn't so many people relying on it working ;)

If you look at my fork (https://github.com/p3p/Marlin/tree/pr_framework_update) you'l see that HAL_START_ADC will now just return a 16 bit value.

LinFor commented 4 years ago

Thanks, I'll moved lpc-specific part into another PR (https://github.com/MarlinFirmware/Marlin/pull/15727) with dependency on your new LPC HAL. I hope it will be quickly stabilized and merged.

I close this PR as unnecessary.