Kalibrierung über Display hinzugefügt
This commit is contained in:
parent
af780439b3
commit
e068d199bb
@ -166,6 +166,20 @@ void set_new_sollstrom(uint32_t soll)
|
|||||||
i_soll = soll;
|
i_soll = soll;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void start_icall(void)
|
||||||
|
{
|
||||||
|
spannung = 0UL;
|
||||||
|
strom = 0UL;
|
||||||
|
modus = icall;
|
||||||
|
}
|
||||||
|
|
||||||
|
void start_ucall(void)
|
||||||
|
{
|
||||||
|
spannung = 0UL;
|
||||||
|
strom = 0UL;
|
||||||
|
modus = ucall;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Callback Function for Command Line
|
* @brief Callback Function for Command Line
|
||||||
* @param [in] pfvOutFunction Function to Print Data to Output
|
* @param [in] pfvOutFunction Function to Print Data to Output
|
||||||
@ -249,17 +263,13 @@ uint16_t set_dutyCyle (CLI_OutFunction pfvOutFunction, char *acCommands[], uint1
|
|||||||
}
|
}
|
||||||
uint16_t set_ucall(CLI_OutFunction pfvOutFunction, char *acCommands[], uint16_t u16ArgCount)
|
uint16_t set_ucall(CLI_OutFunction pfvOutFunction, char *acCommands[], uint16_t u16ArgCount)
|
||||||
{
|
{
|
||||||
spannung = 0UL;
|
start_ucall();
|
||||||
strom = 0UL;
|
|
||||||
modus = ucall;
|
|
||||||
return 0U;
|
return 0U;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t set_icall(CLI_OutFunction pfvOutFunction, char *acCommands[], uint16_t u16ArgCount)
|
uint16_t set_icall(CLI_OutFunction pfvOutFunction, char *acCommands[], uint16_t u16ArgCount)
|
||||||
{
|
{
|
||||||
spannung = 0UL;
|
start_icall();
|
||||||
strom = 0UL;
|
|
||||||
modus = icall;
|
|
||||||
return 0U;
|
return 0U;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,5 +13,7 @@
|
|||||||
void set_new_sollstrom(uint32_t soll);
|
void set_new_sollstrom(uint32_t soll);
|
||||||
uint32_t get_current_sollstrom(void);
|
uint32_t get_current_sollstrom(void);
|
||||||
|
|
||||||
|
void start_icall(void);
|
||||||
|
void start_ucall(void);
|
||||||
|
|
||||||
#endif /* ELEKTRONISCHELAST_HPP_ */
|
#endif
|
||||||
|
138
Source/Menu.cpp
138
Source/Menu.cpp
@ -57,6 +57,13 @@ namespace ElektronischeLast
|
|||||||
}
|
}
|
||||||
lcd.lcd_set_display(Display::eDispalyOn, Display::eCursorOff, Display::eCursorBlinkOff);
|
lcd.lcd_set_display(Display::eDispalyOn, Display::eCursorOff, Display::eCursorBlinkOff);
|
||||||
lcd.print(Display::Line1, "Elektronische Last");
|
lcd.print(Display::Line1, "Elektronische Last");
|
||||||
|
|
||||||
|
up.cyclic();
|
||||||
|
down.cyclic();
|
||||||
|
if(up.isPressed() && down.isPressed())
|
||||||
|
{
|
||||||
|
menu_level = MenuLevel_Call;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Menu::set_measurements(uint32_t spannung, uint32_t strom, uint32_t temperatur, uint32_t geschwindigkeit)
|
void Menu::set_measurements(uint32_t spannung, uint32_t strom, uint32_t temperatur, uint32_t geschwindigkeit)
|
||||||
@ -143,22 +150,153 @@ namespace ElektronischeLast
|
|||||||
|
|
||||||
void Menu::menu_call(void)
|
void Menu::menu_call(void)
|
||||||
{
|
{
|
||||||
|
if(lcd.ready_for_data())
|
||||||
|
{
|
||||||
|
switch(this->configurations)
|
||||||
|
{
|
||||||
|
case 0UL:
|
||||||
|
lcd.print(Display::Line1, "Kalibrierung: I");
|
||||||
|
lcd.print(Display::Line2, "Kalibrierung: U");
|
||||||
|
this->configurations++;
|
||||||
|
break;
|
||||||
|
case 1UL:
|
||||||
|
lcd.lcd_set_display(Display::eDispalyOn, Display::eCursorOn, Display::eCursorBlinkOn);
|
||||||
|
this->configurations++;
|
||||||
|
break;
|
||||||
|
case 2UL:
|
||||||
|
lcd.set_cursor(Display::Line1, 15U);
|
||||||
|
this->configurations++;
|
||||||
|
this->cursor = 1UL;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ok.isReleased())
|
||||||
|
{
|
||||||
|
if(this->cursor == 1UL)
|
||||||
|
{
|
||||||
|
this->menu_level = MenuLevel_ICallInit;
|
||||||
|
}
|
||||||
|
else if(this->cursor == 2UL)
|
||||||
|
{
|
||||||
|
this->menu_level = MenuLevel_UCallInit;
|
||||||
|
}
|
||||||
|
this->configurations = 0UL;
|
||||||
|
}
|
||||||
|
else if(up.isReleased())
|
||||||
|
{
|
||||||
|
if(this->cursor == 1UL)
|
||||||
|
{
|
||||||
|
this->cursor = 2UL;
|
||||||
|
lcd.set_cursor(Display::Line2, 15U);
|
||||||
|
}
|
||||||
|
else if(this->cursor == 2UL)
|
||||||
|
{
|
||||||
|
this->cursor = 1UL;
|
||||||
|
lcd.set_cursor(Display::Line1, 15U);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(down.isReleased())
|
||||||
|
{
|
||||||
|
if(this->cursor == 1UL)
|
||||||
|
{
|
||||||
|
this->cursor = 2UL;
|
||||||
|
lcd.set_cursor(Display::Line2, 15U);
|
||||||
|
}
|
||||||
|
else if(this->cursor == 2UL)
|
||||||
|
{
|
||||||
|
this->cursor = 1UL;
|
||||||
|
lcd.set_cursor(Display::Line1, 15U);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Menu::menu_icall_init(void)
|
void Menu::menu_icall_init(void)
|
||||||
{
|
{
|
||||||
|
char data[17U];
|
||||||
|
if(lcd.ready_for_data())
|
||||||
|
{
|
||||||
|
switch(this->configurations)
|
||||||
|
{
|
||||||
|
case 0UL:
|
||||||
|
set_new_sollstrom(1000UL);
|
||||||
|
soll = get_current_sollstrom();
|
||||||
|
snprintf(data, sizeof(data), "iSoll: %5" PRIu32 "mA", soll);
|
||||||
|
lcd.print(Display::Line1, "Stelle 1A ein ");
|
||||||
|
lcd.print(Display::Line2, data);
|
||||||
|
this->configurations++;
|
||||||
|
break;
|
||||||
|
case 1UL:
|
||||||
|
lcd.set_cursor(Display::Line2, 13UL);
|
||||||
|
this->configurations++;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ok.isReleased())
|
||||||
|
{
|
||||||
|
this->menu_level = MenuLevel_ICall;
|
||||||
|
this->configurations = 0UL;
|
||||||
|
}
|
||||||
|
else if(down.isReleased())
|
||||||
|
{
|
||||||
|
soll--;
|
||||||
|
set_new_sollstrom(soll);
|
||||||
|
snprintf(data, sizeof(data), "iSoll: %5" PRIu32 "mA", soll);
|
||||||
|
lcd.print(Display::Line2, data);
|
||||||
|
this->configurations = 1UL;
|
||||||
|
}
|
||||||
|
else if(up.isReleased())
|
||||||
|
{
|
||||||
|
soll++;
|
||||||
|
set_new_sollstrom(soll);
|
||||||
|
snprintf(data, sizeof(data), "iSoll: %5" PRIu32 "mA", soll);
|
||||||
|
lcd.print(Display::Line2, data);
|
||||||
|
this->configurations = 1UL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Menu::menu_icall(void)
|
void Menu::menu_icall(void)
|
||||||
{
|
{
|
||||||
|
if(this->configurations == 0UL)
|
||||||
|
{
|
||||||
|
start_icall();
|
||||||
|
lcd.print(Display::Line1, "Kalibrierung... ");
|
||||||
|
lcd.print(Display::Line2, " ");
|
||||||
|
this->configurations++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Menu::menu_ucall_init(void)
|
void Menu::menu_ucall_init(void)
|
||||||
{
|
{
|
||||||
|
if(this->configurations == 0UL)
|
||||||
|
{
|
||||||
|
set_new_sollstrom(0UL);
|
||||||
|
lcd.print(Display::Line1, "Lege 15V an ");
|
||||||
|
lcd.print(Display::Line2, " ");
|
||||||
|
this->configurations++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ok.isReleased())
|
||||||
|
{
|
||||||
|
this->menu_level = MenuLevel_UCall;
|
||||||
|
this->configurations = 0UL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Menu::menu_ucall(void)
|
void Menu::menu_ucall(void)
|
||||||
{
|
{
|
||||||
|
if(this->configurations == 0UL)
|
||||||
|
{
|
||||||
|
start_ucall();
|
||||||
|
lcd.print(Display::Line1, "Kalibrierung... ");
|
||||||
|
lcd.print(Display::Line2, " ");
|
||||||
|
this->configurations++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Menu::menu_isoll(void)
|
void Menu::menu_isoll(void)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user