Read temperature command works
This commit is contained in:
parent
1eaeeef9a0
commit
822845cc7a
@ -138,7 +138,32 @@ uint8_t route_command(int pos) {
|
||||
case READ_CONFIG:
|
||||
return READ_CONFIG;
|
||||
case READ_VOLTAGE:
|
||||
return READ_VOLTAGE;
|
||||
{
|
||||
// Create a union to store the data
|
||||
union {
|
||||
int16_t v;
|
||||
uint8_t bytes[2];
|
||||
} voltage;
|
||||
|
||||
// Figure out which voltage source to read
|
||||
switch (context.src_voltage) {
|
||||
case SRC_INTERNAL:
|
||||
voltage.v = internal_voltage_read();
|
||||
break;
|
||||
case SRC_EXTRNAL:
|
||||
voltage.v = external_voltage_read();
|
||||
break;
|
||||
case SRC_THERMISTOR:
|
||||
voltage.v = thermistor_voltage_read();
|
||||
break;
|
||||
default:
|
||||
return 0xFF;
|
||||
break;
|
||||
}
|
||||
|
||||
// Send the data
|
||||
return voltage.bytes[pos];
|
||||
}
|
||||
case READ_TERMPERATURE:
|
||||
{
|
||||
uint16_t v_therm = thermistor_voltage_read();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user