Commit e372ecf9 authored by Philippe Kalaf's avatar Philippe Kalaf

Output to serial port for logging/plotting

parent a2f424f9
Pipeline #56202017 failed with stages
in 59 seconds
......@@ -102,7 +102,8 @@ float BrewControl::get_current_temperature_top()
float BrewControl::get_current_temperature()
{
// Let's return average of both sensors
return (_temp_sensor.read() + _temp2_sensor.read())/2;
//return (_temp_sensor.read() + _temp2_sensor.read())/2;
return _temp_sensor.read();
}
void BrewControl::set_shot_temperature(float shot_temp)
......@@ -301,22 +302,6 @@ uint8_t BrewControl::get_state()
return _state;
}
#ifdef LOG
void BrewControl::_log_brew_params()
{
if (_log_file)
{
fprintf(_log_file, "%f,%f,%f,%f,%f,%d\n",
get_current_time(),
get_current_volume(),
get_current_temperature(),
get_current_pressure(),
get_current_flow_rate(),
_state);
}
}
#endif
// Internal helper function to set brew states properly
void BrewControl::_set_state(uint8_t new_state)
{
......@@ -369,7 +354,7 @@ void BrewControl::_brew_worker()
if (_shot_clock.read() >= _preinfuse_time)
{
_mode = _prev_mode;
_pump_control.set_level(_prev_pressure);
_pump_control.set_level(60);
_flow_sensor.reset_count();
_shot_clock.reset();
_set_state(BREWING);
......@@ -474,7 +459,6 @@ uint8_t BrewControl::start(uint8_t mode)
if (_preinfuse_time && _mode != MODE_MANUAL && _mode != MODE_STEAM)
{
_prev_mode = _mode;
_prev_pressure = get_pump_level();
// set pre-infuse mode
_set_state(PRE_INFUSING);
......
......@@ -179,7 +179,6 @@ private:
// These are used for pre-infuse mode to go back to initial settings after
// pre-infuse is done
int _prev_mode;
int _prev_pressure;
int _preinfuse_time;
// This is for manual pre-infuse control
......
......@@ -732,7 +732,7 @@ int main()
heap_mutex.unlock();
}
/*
/*
pc.printf("%d %.3f ml %.2f bar %.1f C %.1f C %.1f s %.2f ml/s\n",
brew_control.get_pump_level(),
brew_control.get_current_volume(),
......@@ -741,14 +741,17 @@ int main()
brew_control.get_current_temperature_top(),
brew_control.get_current_time(),
brew_control.get_current_flow_rate());
*/
/*
pc.printf("%.1f %.1f %d %d\n", brew_control.get_current_temperature_side(),
brew_control.get_current_temperature_top(),
brew_control.get_last_pulse_count_side(),
brew_control.get_last_pulse_count_top()
);
*/
*/
pc.printf("%.1f, %.1f, %.1f, %d, %.2f, %.2f, %.2f, %d\n",
brew_control.get_current_time(),
brew_control.get_current_temperature_side(),
brew_control.get_current_temperature_top(),
brew_control.get_pump_level(),
brew_control.get_current_pressure(),
brew_control.get_current_volume(),
brew_control.get_current_flow_rate(),
brew_control.get_state());
#if MBED_HEAP_STATS_ENABLED
print_heap_stats();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment