kopia lustrzana https://github.com/OpenRTX/OpenRTX
Made platform_getVbat returning the battery voltage in V instead of mV.
rodzic
50f6799ab9
commit
2350103831
|
@ -54,7 +54,7 @@ void platform_init();
|
||||||
void platform_terminate();
|
void platform_terminate();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function reads and returns the current battery voltage.
|
* This function reads and returns the current battery voltage in volt.
|
||||||
*/
|
*/
|
||||||
float platform_getVbat();
|
float platform_getVbat();
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,12 @@ void platform_terminate()
|
||||||
|
|
||||||
float platform_getVbat()
|
float platform_getVbat()
|
||||||
{
|
{
|
||||||
return adc1_getMeasurement(0);
|
/*
|
||||||
|
* Battery voltage is measured through an 1:3 voltage divider and
|
||||||
|
* adc1_getMeasurement returns a value in mV. Thus, to have effective
|
||||||
|
* battery voltage multiply by three and divide by 1000
|
||||||
|
*/
|
||||||
|
return adc1_getMeasurement(0)*3.0f/1000.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
float platform_getMicLevel()
|
float platform_getMicLevel()
|
||||||
|
|
|
@ -85,7 +85,12 @@ void platform_terminate()
|
||||||
|
|
||||||
float platform_getVbat()
|
float platform_getVbat()
|
||||||
{
|
{
|
||||||
return adc1_getMeasurement(0);
|
/*
|
||||||
|
* Battery voltage is measured through an 1:3 voltage divider and
|
||||||
|
* adc1_getMeasurement returns a value in mV. Thus, to have effective
|
||||||
|
* battery voltage multiply by three and divide by 1000
|
||||||
|
*/
|
||||||
|
return adc1_getMeasurement(0)*3.0f/1000.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
float platform_getMicLevel()
|
float platform_getMicLevel()
|
||||||
|
|
Ładowanie…
Reference in New Issue