|
|
@@ -50,7 +50,7 @@ void menuChange(void* NewMenu, bool direction)
|
|
|
|
|
|
if (selectedMenuItem->Focus) {
|
|
|
selectedMenuItem->func_change(direction);
|
|
|
- (*(selectedMenuItem->func_draw))(selectedMenuItem->Select);
|
|
|
+ //(*(selectedMenuItem->func_draw))(selectedMenuItem->Select);
|
|
|
}
|
|
|
else {
|
|
|
selectedMenuItem = (menuItem*)NewMenu;
|
|
|
@@ -112,7 +112,7 @@ void draw_main(uint8_t sel)
|
|
|
//
|
|
|
void draw_settings(uint8_t sel)
|
|
|
{
|
|
|
- update_flag = false;
|
|
|
+ update_flag = true;
|
|
|
|
|
|
#ifdef SCREEN_MENU
|
|
|
screen_draw_settings(sel);
|
|
|
@@ -252,45 +252,115 @@ static void screen_draw_main(uint8_t sel)
|
|
|
static void screen_draw_settings(uint8_t sel)
|
|
|
{
|
|
|
bool select;
|
|
|
+ static bool blink = false;
|
|
|
|
|
|
oled_clear(BLACK);
|
|
|
-
|
|
|
+
|
|
|
select = sel == MCELL_K1 ? true : false;
|
|
|
+
|
|
|
+ if (select) {
|
|
|
+ if (selectedMenuItem->Focus == false)
|
|
|
+ draw_diameter(select);
|
|
|
+ else {
|
|
|
+ if (blink == true) {
|
|
|
+ oled_frame(MENU_1_STR_Y, true);
|
|
|
+ blink = false;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ draw_diameter(select);
|
|
|
+ blink = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ draw_diameter(select);
|
|
|
+
|
|
|
+
|
|
|
+ select = sel == MCELL_K2 ? true : false;
|
|
|
+
|
|
|
+ if (select) {
|
|
|
+ if (selectedMenuItem->Focus == false)
|
|
|
+ draw_gearbox(select);
|
|
|
+ else {
|
|
|
+ if (blink == true) {
|
|
|
+ oled_frame(MENU_3_STR_Y, true);
|
|
|
+ blink = false;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ draw_gearbox(select);
|
|
|
+ blink = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ draw_gearbox(select);
|
|
|
+
|
|
|
+
|
|
|
+ select = sel == MCELL_REV ? true : false;
|
|
|
+
|
|
|
+ if (select) {
|
|
|
+ if (selectedMenuItem->Focus == false)
|
|
|
+ draw_revers(select);
|
|
|
+ else {
|
|
|
+ if (blink == true) {
|
|
|
+ oled_frame(MENU_5_STR_Y, false);
|
|
|
+ blink = false;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ draw_revers(select);
|
|
|
+ blink = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ draw_revers(select);
|
|
|
+
|
|
|
+
|
|
|
+ select = sel == MCELL_RES ? true : false;
|
|
|
+ memset(screen_str_buf, 0, SCREEN_BUF_LEN);
|
|
|
+ Paint_DrawString_EN(4, MENU_6_STR_Y, "Reset", &Font16, 0xf, 0x0);
|
|
|
+ if (select)
|
|
|
+ oled_frame(MENU_6_STR_Y, false);
|
|
|
+
|
|
|
+ oled_display();
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
+//
|
|
|
+void draw_diameter(bool frame)
|
|
|
+{
|
|
|
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);
|
|
|
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)
|
|
|
+ if (frame)
|
|
|
oled_frame(MENU_1_STR_Y, true);
|
|
|
+}
|
|
|
|
|
|
- select = sel == MCELL_K2 ? true : false;
|
|
|
+//
|
|
|
+void draw_gearbox(bool frame)
|
|
|
+{
|
|
|
memset(screen_str_buf, 0, SCREEN_BUF_LEN);
|
|
|
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)
|
|
|
+ if (frame)
|
|
|
oled_frame(MENU_3_STR_Y, true);
|
|
|
-
|
|
|
- select = sel == MCELL_REV ? true : false;
|
|
|
+}
|
|
|
+
|
|
|
+//
|
|
|
+void draw_revers(bool frame)
|
|
|
+{
|
|
|
memset(screen_str_buf, 0, SCREEN_BUF_LEN);
|
|
|
if (settings.revers == true)
|
|
|
Paint_DrawString_EN(4, MENU_5_STR_Y, "Revers: yes", &Font16, 0xf, 0x0);
|
|
|
else
|
|
|
Paint_DrawString_EN(4, MENU_5_STR_Y, "Revers: no", &Font16, 0xf, 0x0);
|
|
|
- if (select)
|
|
|
+ if (frame)
|
|
|
oled_frame(MENU_5_STR_Y, false);
|
|
|
-
|
|
|
- select = sel == MCELL_RES ? true : false;
|
|
|
- memset(screen_str_buf, 0, SCREEN_BUF_LEN);
|
|
|
- Paint_DrawString_EN(4, MENU_6_STR_Y, "Reset", &Font16, 0xf, 0x0);
|
|
|
- if (select)
|
|
|
- oled_frame(MENU_6_STR_Y, false);
|
|
|
-
|
|
|
- oled_display();
|
|
|
}
|
|
|
-#endif
|
|
|
|
|
|
// -------------------------------------------------------------------------- //
|
|
|
// Консольное меню. Вспомогательные функции.
|