This commit is contained in:
kraus 2022-01-07 22:51:44 +01:00
parent fd85522318
commit 3c08a57aa2
3 changed files with 10 additions and 23 deletions

View File

@ -601,7 +601,7 @@ static void mui_u8g2_u8_vmm_draw_wm_pi(mui_t *ui)
{
u8g2_t *u8g2 = mui_get_U8g2(ui);
mui_u8g2_u8_min_max_t *vmm= (mui_u8g2_u8_min_max_t *)muif_get_data(ui->uif);
char *s = "999";
char s[4] = "999";
uint8_t *value = mui_u8g2_u8mm_get_valptr(vmm);
uint8_t min = mui_u8g2_u8mm_get_min(vmm);
uint8_t max = mui_u8g2_u8mm_get_max(vmm);
@ -714,7 +714,7 @@ static void mui_u8g2_u8_vmm_draw_wm_pf(mui_t *ui)
{
u8g2_t *u8g2 = mui_get_U8g2(ui);
mui_u8g2_u8_min_max_t *vmm= (mui_u8g2_u8_min_max_t *)muif_get_data(ui->uif);
char *s = "999";
char s[4] = "999";
uint8_t *value = mui_u8g2_u8mm_get_valptr(vmm);
uint8_t min = mui_u8g2_u8mm_get_min(vmm);
uint8_t max = mui_u8g2_u8mm_get_max(vmm);
@ -828,7 +828,7 @@ static void mui_u8g2_u8_bar_draw_wm(mui_t *ui, uint8_t flags)
{
u8g2_t *u8g2 = mui_get_U8g2(ui);
mui_u8g2_u8_min_max_step_t *vmms= (mui_u8g2_u8_min_max_step_t *)muif_get_data(ui->uif);
char *s = "999";
char s[4] = "999";
uint8_t *value = mui_u8g2_u8mms_get_valptr(vmms);
uint8_t min = mui_u8g2_u8mms_get_min(vmms);
uint8_t max = mui_u8g2_u8mms_get_max(vmms);

View File

@ -145,7 +145,7 @@
//U8G2_LD7032_60X32_ALT_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 11, /* data=*/ 12, /* cs=*/ 9, /* dc=*/ 10, /* reset=*/ 8); // SW SPI Nano Board
//U8G2_LD7032_60X32_ALT_1_4W_SW_I2C u8g2(U8G2_R0, /* clock=*/ 11, /* data=*/ 12, /* reset=*/ U8X8_PIN_NONE); // NOT TESTED!
//U8G2_UC1701_EA_DOGS102_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_UC1701_EA_DOGS102_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
U8G2_UC1701_EA_DOGS102_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_PCD8544_84X48_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Nokia 5110 Display
//U8G2_PCD8544_84X48_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Nokia 5110 Display
//U8G2_PCF8812_96X65_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Could be also PCF8814

View File

@ -321,42 +321,29 @@ uint8_t is_stop_watch_running = 1; // defines the current state of the
/* draw the current stop watch value */
uint8_t mui_draw_current_timer(mui_t *ui, uint8_t msg) {
u8g2_uint_t x = mui_get_x(ui);
u8g2_uint_t y = mui_get_y(ui);
switch(msg)
{
case MUIF_MSG_DRAW:
u8g2.setCursor(x,y);
if ( msg == MUIF_MSG_DRAW ) {
u8g2.setCursor(mui_get_x(ui), mui_get_y(ui));
u8g2.print(stop_watch_timer/1000);
u8g2.print(".");
u8g2.print((stop_watch_timer/10)%100);
break;
}
return 0;
}
/* start the stop watch */
uint8_t mui_start_current_timer(mui_t *ui, uint8_t msg) {
switch(msg)
{
case MUIF_MSG_FORM_START:
if ( msg == MUIF_MSG_FORM_START ) {
is_stop_watch_running = 1;
stop_watch_millis = millis();
stop_watch_timer = 0;
break;
}
return 0;
}
/* stop the stop watch timer */
uint8_t mui_stop_current_timer(mui_t *ui, uint8_t msg)
{
switch(msg)
{
case MUIF_MSG_FORM_START:
uint8_t mui_stop_current_timer(mui_t *ui, uint8_t msg) {
if ( msg == MUIF_MSG_FORM_START )
is_stop_watch_running = 0;
break;
}
return 0;
}
@ -397,7 +384,7 @@ muif_t muif_list[] = {
};
fds_t fds_data[] MUI_PROGMEM =
fds_t fds_data[] =
MUI_FORM(1)
MUI_AUX("SO") // this will stop the stop watch time once this form is entered
MUI_STYLE(0)