change vsupply to be a uint16 to enable reporting of voltages higher than 25.5V

fixes #294
closes #295
This commit is contained in:
Felix Ruess
2012-10-06 21:19:12 +02:00
parent dcf98cc389
commit 4663c47095
10 changed files with 16 additions and 15 deletions
+1 -1
View File
@@ -95,7 +95,7 @@ struct adc_buf vsupply_adc_buf;
#define LOW_BATTERY_DECIVOLT (CATASTROPHIC_BAT_LEVEL*10)
uint8_t rctx_vsupply_decivolt;
uint16_t rctx_vsupply_decivolt;
uint8_t rctx_under_voltage;
uint8_t rctx_mode;
+1 -1
View File
@@ -71,7 +71,7 @@ unsigned char gps_utm_zone;
int gps_lat, gps_lon; /* 1e7 deg */
int gps_hmsl;
short estimator_airspeed;
unsigned char electrical_vsupply;
unsigned short electrical_vsupply;
unsigned char nav_block;
unsigned char energy;
unsigned char throttle;
+2 -1
View File
@@ -74,7 +74,7 @@ unsigned char gps_utm_zone;
int gps_lat, gps_lon; /* 1e7 deg */
int gps_hmsl;
short estimator_airspeed;
unsigned char electrical_vsupply;
unsigned short electrical_vsupply;
unsigned char nav_block;
unsigned short energy;
unsigned char throttle;
@@ -124,6 +124,7 @@ static gboolean read_data(GIOChannel *chan, GIOCondition cond, gpointer data) {
// FillBufWith16bit(com_trans.buf, 15, (uint16_t)(estimator_airspeed*100)); // TAS (cm/s)
estimator_airspeed = buf2ushort(&buf[14]);
// com_trans.buf[17] = electrical.vsupply; // decivolt
//FIXME: electrical.vsupply is now a uint16
electrical_vsupply = buf[16];
// com_trans.buf[18] = (uint8_t)(energy / 100); // deciAh
energy = buf[17];