payload.cpp fix cayenne battery value

This commit is contained in:
Klaus K Wilting 2018-07-22 17:35:26 +02:00
parent 62ebb534ba
commit 73f19ac654

View File

@ -221,12 +221,14 @@ void PayloadConvert::addStatus(uint16_t voltage, uint64_t uptime,
float celsius) { float celsius) {
uint16_t temp = celsius * 10; uint16_t temp = celsius * 10;
uint16_t volt = voltage / 10; uint16_t volt = voltage / 10;
#ifdef HAS_BATTERY_PROBE
#if (PAYLOAD_ENCODER == 3) #if (PAYLOAD_ENCODER == 3)
buffer[cursor++] = LPP_BATT_CHANNEL; buffer[cursor++] = LPP_BATT_CHANNEL;
#endif #endif
buffer[cursor++] = LPP_ANALOG_INPUT; buffer[cursor++] = LPP_ANALOG_INPUT;
buffer[cursor++] = highByte(volt); buffer[cursor++] = highByte(volt);
buffer[cursor++] = lowByte(volt); buffer[cursor++] = lowByte(volt);
#endif
#if (PAYLOAD_ENCODER == 3) #if (PAYLOAD_ENCODER == 3)
buffer[cursor++] = LPP_TEMP_CHANNEL; buffer[cursor++] = LPP_TEMP_CHANNEL;
#endif #endif
@ -253,7 +255,6 @@ void PayloadConvert::addGPS(gpsStatus_t value) {
buffer[cursor++] = (byte)((alt & 0xFF0000) >> 16); buffer[cursor++] = (byte)((alt & 0xFF0000) >> 16);
buffer[cursor++] = (byte)((alt & 0x00FF00) >> 8); buffer[cursor++] = (byte)((alt & 0x00FF00) >> 8);
buffer[cursor++] = (byte)((alt & 0x0000FF)); buffer[cursor++] = (byte)((alt & 0x0000FF));
} }
#endif #endif