Refactor ADC reading and conversion

Introduce `VCC_MV` to `funconfig.h` for consistent voltage readings.
Add `get_current_ma` function to `main.c` for clearer current
calculations.
Remove unused `PIN_LED` and `Delay_Ms(5000)` from `main.c`.
Update VBUS voltage calculation to use `VCC_MV`.
Print TIP sensor voltage in millivolts instead of raw ADC values.
This commit is contained in:
Alessandro Mauri 2026-04-19 14:05:06 +02:00
parent ab5e54a9dd
commit 1ba352af4e
2 changed files with 18 additions and 14 deletions

View file

@ -6,6 +6,7 @@
#define FUNCONF_DEBUG_HARDFAULT 0
#define CH32X035 1
#define I2C_TARGET I2C1
#define VCC_MV 3480
#endif // _FUNCONFIG_H