mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 06:43:33 +08:00
update comments on scale factors
This commit is contained in:
committed by
Lorenz Meier
parent
ea4937491b
commit
4e4d1a98f6
@@ -147,7 +147,7 @@ void sPort_send_data(int uart, uint16_t id, uint32_t data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// TODO: correct scaling
|
// scaling correct with OpenTX 2.1.7
|
||||||
void sPort_send_BATV(int uart)
|
void sPort_send_BATV(int uart)
|
||||||
{
|
{
|
||||||
/* get a local copy of the vehicle status data */
|
/* get a local copy of the vehicle status data */
|
||||||
@@ -160,7 +160,7 @@ void sPort_send_BATV(int uart)
|
|||||||
sPort_send_data(uart, SMARTPORT_ID_VFAS, voltage);
|
sPort_send_data(uart, SMARTPORT_ID_VFAS, voltage);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: correct scaling
|
// TODO: verify scaling
|
||||||
void sPort_send_CUR(int uart)
|
void sPort_send_CUR(int uart)
|
||||||
{
|
{
|
||||||
/* get a local copy of the vehicle status data */
|
/* get a local copy of the vehicle status data */
|
||||||
@@ -169,7 +169,7 @@ void sPort_send_CUR(int uart)
|
|||||||
orb_copy(ORB_ID(vehicle_status), vehicle_status_sub, &vehicle_status);
|
orb_copy(ORB_ID(vehicle_status), vehicle_status_sub, &vehicle_status);
|
||||||
|
|
||||||
/* send data */
|
/* send data */
|
||||||
uint32_t current = (int)(255 * vehicle_status.battery_current / 50.0f);
|
uint32_t current = (int)(100 * vehicle_status.battery_current);
|
||||||
sPort_send_data(uart, SMARTPORT_ID_CURR, current);
|
sPort_send_data(uart, SMARTPORT_ID_CURR, current);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user