Use first letter capital camel case for enum class members.

This commit is contained in:
Marek Bel 2019-06-12 16:20:21 +02:00
parent cc80bfa020
commit e393d91b12
2 changed files with 19 additions and 19 deletions

View File

@ -1511,20 +1511,20 @@ void mmu_continue_loading(bool blocking)
enum class Ls : uint_least8_t enum class Ls : uint_least8_t
{ {
enter, Enter,
retry, Retry,
unload, Unload,
}; };
Ls state = Ls::enter; Ls state = Ls::Enter;
while (PIN_GET(IR_SENSOR_PIN) != 0) while (PIN_GET(IR_SENSOR_PIN) != 0)
{ {
switch (state) switch (state)
{ {
case Ls::enter: case Ls::Enter:
increment_load_fail(); increment_load_fail();
// no break // no break
case Ls::retry: case Ls::Retry:
#ifdef MMU_HAS_CUTTER #ifdef MMU_HAS_CUTTER
if (1 == eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED)) if (1 == eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED))
{ {
@ -1535,9 +1535,9 @@ void mmu_continue_loading(bool blocking)
mmu_command(MmuCmd::T0 + tmp_extruder); mmu_command(MmuCmd::T0 + tmp_extruder);
manage_response(true, true, MMU_TCODE_MOVE); manage_response(true, true, MMU_TCODE_MOVE);
load_more(); load_more();
state = Ls::unload; state = Ls::Unload;
break; break;
case Ls::unload: case Ls::Unload:
stop_and_save_print_to_ram(0, 0); stop_and_save_print_to_ram(0, 0);
//lift z //lift z
@ -1562,7 +1562,7 @@ void mmu_continue_loading(bool blocking)
{ {
marlin_wait_for_click(); marlin_wait_for_click();
restore_print_from_ram_and_continue(0); restore_print_from_ram_and_continue(0);
state = Ls::retry; state = Ls::Retry;
} }
else else
{ {

View File

@ -2053,8 +2053,8 @@ void check_max_temp()
struct alert_automaton_mintemp { struct alert_automaton_mintemp {
private: private:
enum { ALERT_AUTOMATON_SPEED_DIV = 5 }; enum { ALERT_AUTOMATON_SPEED_DIV = 5 };
enum class States : uint8_t { INIT = 0, TEMP_ABOVE_MINTEMP, SHOW_PLEASE_RESTART, SHOW_MINTEMP }; enum class States : uint8_t { Init = 0, TempAboveMintemp, ShowPleaseRestart, ShowMintemp };
States state = States::INIT; States state = States::Init;
uint8_t repeat = ALERT_AUTOMATON_SPEED_DIV; uint8_t repeat = ALERT_AUTOMATON_SPEED_DIV;
void substep(States next_state){ void substep(States next_state){
@ -2073,26 +2073,26 @@ public:
static const char m2[] PROGMEM = "MINTEMP fixed"; static const char m2[] PROGMEM = "MINTEMP fixed";
static const char m1[] PROGMEM = "Please restart"; static const char m1[] PROGMEM = "Please restart";
switch(state){ switch(state){
case States::INIT: // initial state - check hysteresis case States::Init: // initial state - check hysteresis
if( current_temp > mintemp ){ if( current_temp > mintemp ){
state = States::TEMP_ABOVE_MINTEMP; state = States::TempAboveMintemp;
} }
// otherwise keep the Err MINTEMP alert message on the display, // otherwise keep the Err MINTEMP alert message on the display,
// i.e. do not transfer to state 1 // i.e. do not transfer to state 1
break; break;
case States::TEMP_ABOVE_MINTEMP: // the temperature has risen above the hysteresis check case States::TempAboveMintemp: // the temperature has risen above the hysteresis check
lcd_setalertstatuspgm(m2); lcd_setalertstatuspgm(m2);
substep(States::SHOW_MINTEMP); substep(States::ShowMintemp);
last_alert_sent_to_lcd = LCDALERT_MINTEMPFIXED; last_alert_sent_to_lcd = LCDALERT_MINTEMPFIXED;
break; break;
case States::SHOW_PLEASE_RESTART: // displaying "Please restart" case States::ShowPleaseRestart: // displaying "Please restart"
lcd_updatestatuspgm(m1); lcd_updatestatuspgm(m1);
substep(States::SHOW_MINTEMP); substep(States::ShowMintemp);
last_alert_sent_to_lcd = LCDALERT_PLEASERESTART; last_alert_sent_to_lcd = LCDALERT_PLEASERESTART;
break; break;
case States::SHOW_MINTEMP: // displaying "MINTEMP fixed" case States::ShowMintemp: // displaying "MINTEMP fixed"
lcd_updatestatuspgm(m2); lcd_updatestatuspgm(m2);
substep(States::SHOW_PLEASE_RESTART); substep(States::ShowPleaseRestart);
last_alert_sent_to_lcd = LCDALERT_MINTEMPFIXED; last_alert_sent_to_lcd = LCDALERT_MINTEMPFIXED;
break; break;
} }