|
|
@@ -95,8 +95,8 @@ void draw_main(uint8_t sel)
|
|
|
update_flag = true;
|
|
|
|
|
|
#ifdef SCREEN_MENU
|
|
|
- //screen_draw_main(sel);
|
|
|
- screen_draw_settings(sel);
|
|
|
+ screen_draw_main(sel);
|
|
|
+ //screen_draw_settings(sel);
|
|
|
#endif
|
|
|
|
|
|
#ifdef KEYBOARD_MENU
|
|
|
@@ -170,10 +170,12 @@ static void screen_draw_main(uint8_t sel)
|
|
|
{
|
|
|
uint32_t raw_forw_turns, raw_back_turns, dir;
|
|
|
int total;
|
|
|
+ double distance;
|
|
|
move_t move;
|
|
|
|
|
|
get_raw_params(&raw_forw_turns, &raw_back_turns, &dir);
|
|
|
get_total(&total);
|
|
|
+ distance = get_distance();
|
|
|
move = get_move();
|
|
|
|
|
|
oled_clear(BLACK);
|
|
|
@@ -184,7 +186,7 @@ static void screen_draw_main(uint8_t sel)
|
|
|
|
|
|
// Total
|
|
|
memset(screen_str_buf, 0, SCREEN_BUF_LEN);
|
|
|
- sprintf(screen_str_buf, "%d", total);
|
|
|
+ sprintf(screen_str_buf, ".2%f", distance);
|
|
|
Paint_DrawString_EN(10, 52, screen_str_buf, &Font24, 0xf, 0x0);
|
|
|
|
|
|
|
|
|
@@ -229,86 +231,44 @@ static void screen_draw_settings(uint8_t sel)
|
|
|
bool select;
|
|
|
|
|
|
oled_clear(BLACK);
|
|
|
-
|
|
|
- //GFX_DrawRoundRectangle(0, 0, 127, 127, 5, 15);
|
|
|
- //Paint_DrawString_EN(45, 120, "Fly Electronics", &Font8, 0xf, 0x0);
|
|
|
|
|
|
select = sel == MCELL_K1 ? true : false;
|
|
|
memset(screen_str_buf, 0, SCREEN_BUF_LEN);
|
|
|
Paint_DrawString_EN(4, MENU_1_STR_Y, "Diameter:", &Font16, 0xf, 0x0);
|
|
|
memset(screen_str_buf, 0, SCREEN_BUF_LEN);
|
|
|
- sprintf(screen_str_buf, "%u", settings.factor_1);
|
|
|
- Paint_DrawString_EN(50, MENU_2_STR_Y, screen_str_buf, &Font16, 0xf, 0x0);
|
|
|
- //if (select)
|
|
|
- oled_double_frame(0);
|
|
|
-
|
|
|
- memset(screen_str_buf, 0, SCREEN_BUF_LEN);
|
|
|
- Paint_DrawString_EN(4, MENU_3_STR_Y + MENU_OFF_BETWEEN_DOUBLE_STR, "Diameter:", &Font16, 0xf, 0x0);
|
|
|
- memset(screen_str_buf, 0, SCREEN_BUF_LEN);
|
|
|
- sprintf(screen_str_buf, "%u", settings.factor_1);
|
|
|
- Paint_DrawString_EN(50, MENU_4_STR_Y + MENU_OFF_BETWEEN_DOUBLE_STR, screen_str_buf, &Font16, 0xf, 0x0);
|
|
|
-
|
|
|
- oled_display();
|
|
|
-
|
|
|
-#if 0
|
|
|
- // Рамка
|
|
|
- GFX_DrawRoundRectangle(1, 1, 126, 125, 3, 15);
|
|
|
-
|
|
|
- select = sel == MCELL_K1 ? true : false;
|
|
|
- memset(screen_str_buf, 0, SCREEN_BUF_LEN);
|
|
|
- sprintf(screen_str_buf, "F 1: %u", settings.factor_1);
|
|
|
- GFX_DrawString(8, 20, (char*)screen_str_buf, 15, 0);
|
|
|
-
|
|
|
+ oled_int_right_alignment_post(settings.factor_1, 11, (char*)"mm", screen_str_buf);
|
|
|
+ Paint_DrawString_EN(4, MENU_2_STR_Y, screen_str_buf, &Font16, 0xf, 0x0);
|
|
|
if (select)
|
|
|
- oled_draw_string_frame(0);
|
|
|
-
|
|
|
+ oled_frame(MENU_1_STR_Y, true);
|
|
|
+
|
|
|
select = sel == MCELL_K2 ? true : false;
|
|
|
memset(screen_str_buf, 0, SCREEN_BUF_LEN);
|
|
|
- sprintf(screen_str_buf, "F 2: %u", settings.factor_2);
|
|
|
- GFX_DrawString(8, 40, (char*)screen_str_buf, 15, 0);
|
|
|
-
|
|
|
+ Paint_DrawString_EN(4, MENU_3_STR_Y, "Gearbox:", &Font16, 0xf, 0x0);
|
|
|
+ memset(screen_str_buf, 0, SCREEN_BUF_LEN);
|
|
|
+ oled_int_right_alignment(settings.factor_2, 11, screen_str_buf);
|
|
|
+ Paint_DrawString_EN(4, MENU_4_STR_Y, screen_str_buf, &Font16, 0xf, 0x0);
|
|
|
if (select)
|
|
|
- oled_draw_string_frame(1);
|
|
|
+ oled_frame(MENU_3_STR_Y, true);
|
|
|
|
|
|
select = sel == MCELL_REV ? true : false;
|
|
|
memset(screen_str_buf, 0, SCREEN_BUF_LEN);
|
|
|
if (settings.revers == true)
|
|
|
- sprintf(screen_str_buf, "Rev.: yes");
|
|
|
+ Paint_DrawString_EN(4, MENU_5_STR_Y, "Revers: yes", &Font16, 0xf, 0x0);
|
|
|
else
|
|
|
- sprintf(screen_str_buf, "Rev.: no");
|
|
|
- GFX_DrawString(8, 60, (char*)screen_str_buf, 15, 0);
|
|
|
-
|
|
|
+ Paint_DrawString_EN(4, MENU_5_STR_Y, "Revers: no", &Font16, 0xf, 0x0);
|
|
|
if (select)
|
|
|
- oled_draw_string_frame(2);
|
|
|
+ oled_frame(MENU_5_STR_Y, false);
|
|
|
|
|
|
select = sel == MCELL_RES ? true : false;
|
|
|
memset(screen_str_buf, 0, SCREEN_BUF_LEN);
|
|
|
- if (settings.revers == true)
|
|
|
- sprintf(screen_str_buf, "Reset");
|
|
|
- else
|
|
|
- sprintf(screen_str_buf, "Reset");
|
|
|
- GFX_DrawString(8, 80, (char*)screen_str_buf, 15, 0);
|
|
|
-
|
|
|
+ Paint_DrawString_EN(4, MENU_6_STR_Y, "Reset", &Font16, 0xf, 0x0);
|
|
|
if (select)
|
|
|
- oled_draw_string_frame(3);
|
|
|
+ oled_frame(MENU_6_STR_Y, false);
|
|
|
|
|
|
oled_display();
|
|
|
-
|
|
|
- select = sel == MCELL_SAVE ? true : false;
|
|
|
- memset(screen_str_buf, 0, SCREEN_BUF_LEN);
|
|
|
- if (settings.revers == true)
|
|
|
- sprintf(screen_str_buf, "Save set");
|
|
|
- else
|
|
|
- sprintf(screen_str_buf, "Save set");
|
|
|
- GFX_DrawString(8, 100, (char*)screen_str_buf, 15, 0);
|
|
|
-
|
|
|
- if (select)
|
|
|
- oled_draw_string_frame(4);
|
|
|
-
|
|
|
- oled_display();
|
|
|
-#endif
|
|
|
}
|
|
|
#endif
|
|
|
+
|
|
|
// -------------------------------------------------------------------------- //
|
|
|
// Консольное меню. Вспомогательные функции.
|
|
|
#ifdef KEYBOARD_MENU
|