From 88ad6d1934a7a3637e1004832f594006152694ee Mon Sep 17 00:00:00 2001 From: YoungSoo Shin Date: Wed, 28 May 2025 15:23:57 +0900 Subject: [PATCH] ODROID-C5: change adc max value and adc file path ODROID-C5 has two internal 10bit ADCs. However, the value of in_voltage0_raw outputs a difficult number. So, klipper read "in_voltage0_input", which outputs the actual voltage value, to read the value of ADC. Change-Id: I32aada4e66e6034823bf66c41fccf178d6ff50d0 --- src/linux/analog.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/linux/analog.c b/src/linux/analog.c index 55420ce6..7ca1ee2d 100644 --- a/src/linux/analog.c +++ b/src/linux/analog.c @@ -13,13 +13,15 @@ #include "internal.h" // report_errno #include "sched.h" // sched_shutdown -DECL_CONSTANT("ADC_MAX", 4095); // Assume 12bit adc +// ODROID-C5 +DECL_CONSTANT("ADC_MAX", 1800); // Assume 12bit adc #define ANALOG_START (1<<12) DECL_ENUMERATION_RANGE("pin", "analog0", ANALOG_START, 8); -#define IIO_PATH "/sys/bus/iio/devices/iio:device0/in_voltage%d_raw" +// ODROID-C5 +#define IIO_PATH "/sys/bus/iio/devices/iio:device0/in_voltage%d_input" struct gpio_adc gpio_adc_setup(uint32_t pin)