static volatile uint8_t adc_state = 0;
static volatile uint16_t adc_value = 0;
-static uint16_t track_current_milliamps(void);
-static uint16_t input_voltage_millivolts(void);
-
void monitor_init(void)
{
DDRB |= 0x02;
{
if(cmd_buf[0]==READ_TRACK_CURRENT)
{
- uint8_t reply[3];
-
if(cmd_length!=1)
return LENGTH_ERROR;
- uint16_t value = track_current_milliamps();
+ uint16_t value = monitor_track_current();
+ uint8_t reply[3];
reply[0] = TRACK_CURRENT;
reply[1] = value>>8;
reply[2] = value;
}
else if(cmd_buf[0]==READ_INPUT_VOLTAGE)
{
- uint8_t reply[3];
-
if(cmd_length!=1)
return LENGTH_ERROR;
- uint16_t value = input_voltage_millivolts();
+ uint16_t value = monitor_input_voltage();
+ uint8_t reply[3];
reply[0] = INPUT_VOLTAGE;
reply[1] = value>>8;
reply[2] = value;
return COMMAND_OK;
}
-static uint16_t track_current_milliamps(void)
+uint16_t monitor_track_current(void)
{
uint16_t value = track_current_sum;
}
}
-static uint16_t input_voltage_millivolts(void)
+uint16_t monitor_input_voltage(void)
{
uint16_t value = input_voltage_sum;