Skip to content

Commit

Permalink
Introduce mylvgl as a UI graphics library
Browse files Browse the repository at this point in the history
  • Loading branch information
MKS-Sean committed May 7, 2020
1 parent 12cd07a commit f253be7
Show file tree
Hide file tree
Showing 301 changed files with 317 additions and 93,581 deletions.
8 changes: 4 additions & 4 deletions Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@
#include "gcode/queue.h"

#if ENABLED(TFT_LITTLE_VGL_UI)
#include "lvgl/lvgl.h"
#include "ui/inc/tft_lvgl_configuration.h"
#include "ui/inc/draw_ready_print.h"
#include "lvgl.h"
#include "lcd/extui/lib/mks_ui/inc/tft_lvgl_configuration.h"
#include "lcd/extui/lib/mks_ui/inc/draw_ready_print.h"
#if ENABLED(MKS_TEST)
#include "ui/inc/mks_hardware_test.h"
#include "lcd/extui/lib/mks_ui/inc/mks_hardware_test.h"
#endif
#endif

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ extern "C" { /* Make sure we have C-declarations in C++ programs */

#include <stdint.h>
#include <string.h>
#include "../../lvgl/lvgl.h"
#include "lvgl.h"
#include "../inc/tft_multi_language.h"
#include "../inc/draw_ready_print.h"
#include "../inc/draw_language.h"
Expand Down Expand Up @@ -162,7 +162,7 @@ typedef enum
typedef struct
{
DISP_STATE _disp_state[100];
char _disp_index;
int _disp_index;

} DISP_STATE_STACK;

Expand Down Expand Up @@ -201,6 +201,7 @@ extern void clear_cur_ui();
extern void draw_return_ui();
extern void sd_detection();
extern void gCfg_to_spiFlah();
extern void print_time_count();


#if defined(__cplusplus)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef MKS_HARDWARE_TEST_H
#define MKS_HARDWARE_TEST_H

#include "../../lvgl/lvgl.h"
#include "lvgl.h"

void Test_GPIO();
void disp_char_1624(uint16_t x,uint16_t y,uint8_t c,uint16_t charColor,uint16_t bkColor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ extern "C" { /* Make sure we have C-declarations in C++ programs */

#include <stdint.h>
#include <string.h>
#include "../../lvgl/lvgl.h"
#include "lvgl.h"

#if 1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@
#define DIALOG_RETRY_EN "Retry"
#define DIALOG_STOP_EN "Stop"
#define DIALOG_REPRINT_FROM_BREAKPOINT_EN "Reprint from breakpoint?"
#define DIALOG_UNBIND_PRINTER_EN "Unbind the printer?"
//#define DIALOG_UNBIND_PRINTER_EN "Unbind the printer?"
#define DIALOG_ERROR_TIPS1_EN "Error:no file,please check it again."
#define DIALOG_ERROR_TIPS2_EN "Error:transaction failed.please check display baudrate \nwhether as the same as mainboard!"
#define DIALOG_ERROR_TIPS3_EN "Error:file name or path is too long!"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@

#define DIALOG_STOP_FR "Arrêter"
#define DIALOG_REPRINT_FROM_BREAKPOINT_FR "Continuer?"
#define DIALOG_UNBIND_PRINTER_FR "Non lié?"
//#define DIALOG_UNBIND_PRINTER_FR "Non lié?"
#define DIALOG_ERROR_TIPS1_FR "Erreur:error:Aucun fichier, \nvérifiez à nouveau."
#define DIALOG_ERROR_TIPS2_FR "Erreur:La opération a échoué. \nVerifiez que le baudrate de l'écran et de \nla carte mère soient identique!"
#define DIALOG_ERROR_TIPS3_FR "Erreur: le nom du fichier ou le \nchemin d'accès est trop long."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
#define DIALOG_CANCEL_PRINT_IT "Stop stampa?"
#define DIALOG_STOP_IT "Stop"
#define DIALOG_REPRINT_FROM_BREAKPOINT_IT "Continua a stampare dal \npunto di interruzione?"
#define DIALOG_UNBIND_PRINTER_IT "Libero?"
//#define DIALOG_UNBIND_PRINTER_IT "Libero?"
#define DIALOG_ERROR_TIPS1_IT "Errore: nessun file, \nper favore controllare di nuovo."
#define DIALOG_ERROR_TIPS2_IT "Errore: operazione non riuscita, \nsi prega di controllare se il baudrate del \ndisplay è lo stesso scheda madre"
#define DIALOG_ERROR_TIPS3_IT "Errore: il nome del file o il \npercorso è troppo lungo!"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@
#define DIALOG_CANCEL_PRINT_RU "стоп?"
#define DIALOG_STOP_RU "стоп"
#define DIALOG_REPRINT_FROM_BREAKPOINT_RU "продолжить?"
#define DIALOG_UNBIND_PRINTER_RU "разрыв?"
//#define DIALOG_UNBIND_PRINTER_RU "разрыв?"
#define DIALOG_ERROR_TIPS1_RU "ошибка:нет файла, попробуйте ещё раз."
#define DIALOG_ERROR_TIPS2_RU "ошибка:сбой передачи. установите скорость \nпередачи данных как на плате управления!"
#define DIALOG_ERROR_TIPS3_RU "ошибка: имя файла слишком длинное!"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
#define DIALOG_RETRY_CN "重试"
#define DIALOG_STOP_CN "停止"
#define DIALOG_REPRINT_FROM_BREAKPOINT_CN "从断点续打?"
#define DIALOG_UNBIND_PRINTER_CN "解除绑定 ?"
//#define DIALOG_UNBIND_PRINTER_CN "解除绑定 ?"
#define DIALOG_ERROR_TIPS1_CN "错误:找不到文件,请插入sd卡/u盘!"
#define DIALOG_ERROR_TIPS2_CN "错误:通信失败,请检查波特率或主板硬件!"
#define DIALOG_ERROR_TIPS3_CN "错误:文件名或文件路径太长 !"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
#define DIALOG_RETRY_SP "Reintentar"
#define DIALOG_STOP_SP "Stop"
#define DIALOG_REPRINT_FROM_BREAKPOINT_SP "Reprint from breakpoint?"
#define DIALOG_UNBIND_PRINTER_SP "Unbind the printer?"
//#define DIALOG_UNBIND_PRINTER_SP "Unbind the printer?"
#define DIALOG_ERROR_TIPS1_SP "Error:archivo no encontrado, \npor favor insertar SD o disco USB."
#define DIALOG_ERROR_TIPS2_SP "error:transacción fallida, \nconfigurar baudrate del \ndisplay para la placa base!"
#define DIALOG_ERROR_TIPS3_SP "Error : nombre de archivo o \nruta demasiado largo!"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
#define DIALOG_RETRY_T_CN "重試"
#define DIALOG_STOP_T_CN "停止"
#define DIALOG_REPRINT_FROM_BREAKPOINT_T_CN "從斷點續打?"
#define DIALOG_UNBIND_PRINTER_T_CN "解除綁定?"
//#define DIALOG_UNBIND_PRINTER_T_CN "解除綁定?"
#define DIALOG_ERROR_TIPS1_T_CN "錯誤:找不到文件,請插入sd卡/u盤!"
#define DIALOG_ERROR_TIPS2_T_CN "錯誤:通信失敗,請檢查波特率或主板硬件!"
#define DIALOG_ERROR_TIPS3_T_CN "錯誤:文件名或文件路徑太長!"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//extern "C" {
//#endif

#include "../../lvgl/lvgl.h"
#include "lvgl.h"

void tft_lvgl_init();
void my_disp_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p);
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "../../inc/MarlinConfigPre.h"
#include "../../../../../inc/MarlinConfigPre.h"
#if 1//ENABLED(SPI_FLASH)
#include <SPI.h>
#include "../../inc/MarlinConfig.h"
#include "../../../../../inc/MarlinConfig.h"

#if ENABLED(TFT_LITTLE_VGL_UI)
#include "../inc/W25Qxx.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#include "../../lvgl/lv_conf.h"
#include "../../lvgl/src/lv_objx/lv_imgbtn.h"
#include "../../lvgl/src/lv_objx/lv_img.h"
#include "../../lvgl/src/lv_core/lv_disp.h"
#include "../../lvgl/src/lv_core/lv_refr.h"
#include "../../MarlinCore.h"
#include "../../../Configuration.h"
#include "../../../../../MarlinCore.h"
#if ENABLED(TFT_LITTLE_VGL_UI)
#include "lv_conf.h"
//#include "../../lvgl/src/lv_objx/lv_imgbtn.h"
//#include "../../lvgl/src/lv_objx/lv_img.h"
//#include "../../lvgl/src/lv_core/lv_disp.h"
//#include "../../lvgl/src/lv_core/lv_refr.h"
//#include "../../MarlinCore.h"
#include "../../../../../../Configuration.h"
#include "../inc/draw_ui.h"
#include "../../module/temperature.h"
#include "../../../../../module/temperature.h"

static lv_obj_t * scr;
static lv_obj_t * firmWare,*board;
Expand All @@ -33,7 +35,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event)

void lv_draw_about(void)
{
lv_obj_t *buttonBack,*labelBack;
lv_obj_t *buttonBack,*label_Back;
if(disp_state_stack._disp_state[disp_state_stack._disp_index] != ABOUT_UI)
{
disp_state_stack._disp_index++;
Expand Down Expand Up @@ -74,7 +76,7 @@ void lv_draw_about(void)
lv_btn_set_layout(buttonBack, LV_LAYOUT_OFF);
/*Create a label on the Image button*/

lv_obj_t * label_Back = lv_label_create(buttonBack, NULL);
label_Back = lv_label_create(buttonBack, NULL);

if(gCfgItems.multiple_language !=0)
{
Expand All @@ -97,3 +99,4 @@ void lv_clear_about()
{
lv_obj_del(scr);
}
#endif
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#include "../../lvgl/lv_conf.h"
#include "../../lvgl/src/lv_objx/lv_imgbtn.h"
#include "../../lvgl/src/lv_objx/lv_img.h"
#include "../../lvgl/src/lv_core/lv_disp.h"
#include "../../lvgl/src/lv_core/lv_refr.h"
#include "../../MarlinCore.h"
#include "../../../Configuration.h"
#include "../../../../../MarlinCore.h"
#if ENABLED(TFT_LITTLE_VGL_UI)
#include "lv_conf.h"
//#include "../../lvgl/src/lv_objx/lv_imgbtn.h"
//#include "../../lvgl/src/lv_objx/lv_img.h"
//#include "../../lvgl/src/lv_core/lv_disp.h"
//#include "../../lvgl/src/lv_core/lv_refr.h"
//#include "../../MarlinCore.h"
#include "../../../../../../Configuration.h"
#include "../inc/draw_ui.h"
#include "../../module/temperature.h"
#include "../../module/planner.h"
#include "../../../../../module/temperature.h"
#include "../../../../../module/planner.h"

static lv_obj_t * scr;
static lv_obj_t * labelStep,*buttonStep,*buttonMov,*buttonExt;
Expand Down Expand Up @@ -373,3 +375,4 @@ void lv_clear_change_speed()
{
lv_obj_del(scr);
}
#endif
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
#include "../../lvgl/lv_conf.h"
#include "../../lvgl/src/lv_objx/lv_imgbtn.h"
#include "../../lvgl/src/lv_objx/lv_img.h"
#include "../../lvgl/src/lv_core/lv_disp.h"
#include "../../lvgl/src/lv_core/lv_refr.h"
#include "../../MarlinCore.h"
#include "../../../../../MarlinCore.h"
#if ENABLED(TFT_LITTLE_VGL_UI)
#include "lv_conf.h"
//#include "../../lvgl/src/lv_objx/lv_imgbtn.h"
//#include "../../lvgl/src/lv_objx/lv_img.h"
//#include "../../lvgl/src/lv_core/lv_disp.h"
//#include "../../lvgl/src/lv_core/lv_refr.h"
//#include "../../MarlinCore.h"
#include "../inc/draw_ui.h"
#include "../../sd/cardreader.h"
#include "../../gcode/queue.h"
#include "../../module/temperature.h"
#include "../../module/planner.h"
#include "../../feature/powerloss.h"
#include "../../../../../sd/cardreader.h"
#include "../../../../../gcode/queue.h"
#include "../../../../../module/temperature.h"
#include "../../../../../module/planner.h"
#if ENABLED(POWER_LOSS_RECOVERY)
#include "../../../../../feature/powerloss.h"
#endif

static lv_obj_t * scr;
extern uint8_t sel_id;
Expand Down Expand Up @@ -120,8 +124,6 @@ static void btn_cancel_event_cb(lv_obj_t * btn, lv_event_t event)

void lv_draw_dialog(uint8_t type)
{
lv_obj_t *buttonPreHeat,*buttonExtrusion,*buttonMove,*buttonHome;
lv_obj_t *buttonLevel,*buttonFilament,*buttonMore,*buttonBack;

if(disp_state_stack._disp_state[disp_state_stack._disp_index] != DIALOG_UI)
{
Expand Down Expand Up @@ -235,4 +237,4 @@ void lv_clear_dialog()
lv_obj_del(scr);
}


#endif
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#include "../../lvgl/lv_conf.h"
#include "../../lvgl/src/lv_objx/lv_imgbtn.h"
#include "../../lvgl/src/lv_objx/lv_img.h"
#include "../../lvgl/src/lv_core/lv_disp.h"
#include "../../lvgl/src/lv_core/lv_refr.h"
#include "../../MarlinCore.h"
#include "../../../../../MarlinCore.h"
#if ENABLED(TFT_LITTLE_VGL_UI)
#include "lv_conf.h"
//#include "../../lvgl/src/lv_objx/lv_imgbtn.h"
//#include "../../lvgl/src/lv_objx/lv_img.h"
//#include "../../lvgl/src/lv_core/lv_disp.h"
//#include "../../lvgl/src/lv_core/lv_refr.h"
//#include "../../MarlinCore.h"
#include "../inc/draw_ui.h"
#include "../../module/temperature.h"
#include "../../gcode/queue.h"
#include "../../../../../module/temperature.h"
#include "../../../../../gcode/queue.h"

static lv_obj_t * scr;
static lv_obj_t * buttoType,*buttonStep,*buttonSpeed;
Expand Down Expand Up @@ -433,3 +435,4 @@ void lv_clear_extrusion()
{
lv_obj_del(scr);
}
#endif
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#include "../../lvgl/lv_conf.h"
#include "../../lvgl/src/lv_objx/lv_imgbtn.h"
#include "../../lvgl/src/lv_objx/lv_img.h"
#include "../../lvgl/src/lv_core/lv_disp.h"
#include "../../lvgl/src/lv_core/lv_refr.h"
#include "../../MarlinCore.h"
#include "../../../Configuration.h"
#include "../../../../../MarlinCore.h"
#if ENABLED(TFT_LITTLE_VGL_UI)
#include "lv_conf.h"
//#include "../../lvgl/src/lv_objx/lv_imgbtn.h"
//#include "../../lvgl/src/lv_objx/lv_img.h"
//#include "../../lvgl/src/lv_core/lv_disp.h"
//#include "../../lvgl/src/lv_core/lv_refr.h"
//#include "../../MarlinCore.h"
#include "../../../../../../Configuration.h"
#include "../inc/draw_ui.h"
#include "../../module/temperature.h"
#include "../../gcode/queue.h"
#include "../../../../../module/temperature.h"
#include "../../../../../gcode/queue.h"

static lv_obj_t * scr;
static lv_obj_t * fanText;
Expand Down Expand Up @@ -237,3 +239,4 @@ void lv_clear_fan()
{
lv_obj_del(scr);
}
#endif
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#include "../../../../../MarlinCore.h"
#if ENABLED(TFT_LITTLE_VGL_UI)
#include "../inc/draw_ready_print.h"
#include "../inc/draw_set.h"
#include "../../lvgl/lv_conf.h"
#include "../../lvgl/src/lv_objx/lv_imgbtn.h"
#include "../../lvgl/src/lv_objx/lv_img.h"
#include "../../lvgl/src/lv_core/lv_disp.h"
#include "../../lvgl/src/lv_core/lv_refr.h"
#include "../../MarlinCore.h"
#include "lv_conf.h"
//#include "../../lvgl/src/lv_objx/lv_imgbtn.h"
//#include "../../lvgl/src/lv_objx/lv_img.h"
//#include "../../lvgl/src/lv_core/lv_disp.h"
//#include "../../lvgl/src/lv_core/lv_refr.h"
//#include "../../MarlinCore.h"
#include "../inc/draw_ui.h"
#include "../../gcode/queue.h"
#include "../../../../../gcode/queue.h"

static lv_obj_t * scr;

Expand Down Expand Up @@ -264,4 +266,4 @@ void lv_clear_home()
lv_obj_del(scr);
}


#endif
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#include "../../lvgl/lv_conf.h"
#include "../../lvgl/src/lv_objx/lv_imgbtn.h"
#include "../../lvgl/src/lv_objx/lv_img.h"
#include "../../lvgl/src/lv_core/lv_disp.h"
#include "../../lvgl/src/lv_core/lv_refr.h"
#include "../../MarlinCore.h"
#include "../../../../../MarlinCore.h"
#if ENABLED(TFT_LITTLE_VGL_UI)
#include "lv_conf.h"
//#include "../../lvgl/src/lv_objx/lv_imgbtn.h"
//#include "../../lvgl/src/lv_objx/lv_img.h"
//#include "../../lvgl/src/lv_core/lv_disp.h"
//#include "../../lvgl/src/lv_core/lv_refr.h"
//#include "../../MarlinCore.h"
#include "../inc/draw_ui.h"
#include <string.h>

Expand Down Expand Up @@ -361,4 +363,4 @@ void lv_clear_language()
{
lv_obj_del(scr);
}

#endif
Loading

0 comments on commit f253be7

Please sign in to comment.