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:
parent
ab5e54a9dd
commit
1ba352af4e
2 changed files with 18 additions and 14 deletions
|
|
@ -6,6 +6,7 @@
|
|||
#define FUNCONF_DEBUG_HARDFAULT 0
|
||||
#define CH32X035 1
|
||||
#define I2C_TARGET I2C1
|
||||
#define VCC_MV 3480
|
||||
|
||||
|
||||
#endif // _FUNCONFIG_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue