Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
MarlinKimbra
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
MarlinKimbra
Commits
8dabeadc
Commit
8dabeadc
authored
Apr 21, 2016
by
MagoKimbra
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'refs/remotes/origin/master' into dev
parents
b5ad3ab5
bda01841
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
57 additions
and
56 deletions
+57
-56
GCodes.md
Documentation/GCodes.md
+1
-1
changelog.md
Documentation/changelog.md
+1
-1
MK.ino
MK/MK.ino
+1
-1
MK_Main.cpp
MK/module/MK_Main.cpp
+4
-4
NexHardware.cpp
MK/module/nextion/NexHardware.cpp
+2
-1
NexUpload.cpp
MK/module/nextion/NexUpload.cpp
+24
-24
NexUpload.h
MK/module/nextion/NexUpload.h
+19
-19
Nextion.h
MK/module/nextion/Nextion.h
+1
-1
Nextion_lcd.cpp
MK/module/nextion/Nextion_lcd.cpp
+3
-3
Nextion_lcd.h
MK/module/nextion/Nextion_lcd.h
+1
-1
No files found.
Documentation/GCodes.md
View file @
8dabeadc
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
*
M30 - Delete file from SD (M30 filename.g)
*
M30 - Delete file from SD (M30 filename.g)
*
M31 - Output time since last M109 or SD card start to serial
*
M31 - Output time since last M109 or SD card start to serial
*
M32 - Make directory
*
M32 - Make directory
*
M35 -
Download Firmware
Nextion from SD
*
M35 -
Upload Firmware to
Nextion from SD
*
M42 - Change pin status via gcode Use M42 Px Sy to set pin x to value y, when omitting Px the onboard led will be used.
*
M42 - Change pin status via gcode Use M42 Px Sy to set pin x to value y, when omitting Px the onboard led will be used.
*
M49 - Z probe repetability test
*
M49 - Z probe repetability test
*
M80 - Turn on Power Supply
*
M80 - Turn on Power Supply
...
...
Documentation/changelog.md
View file @
8dabeadc
### Version 4.2.8
### Version 4.2.8
*
Add board folder with files of various board containing the pins
*
Add board folder with files of various board containing the pins
*
Add End time on Graphics display when SD print
*
Add End time on Graphics display when SD print
*
Add M35 for
download firmware n
extion from SD
*
Add M35 for
upload firmware to N
extion from SD
*
Rewrite macros
*
Rewrite macros
*
Fix M109 so it won't wait for cooling
*
Fix M109 so it won't wait for cooling
*
Clear code
*
Clear code
...
...
MK/MK.ino
View file @
8dabeadc
...
@@ -79,7 +79,7 @@
...
@@ -79,7 +79,7 @@
* M30 - Delete file from SD (M30 filename.g)
* M30 - Delete file from SD (M30 filename.g)
* M31 - Output time since last M109 or SD card start to serial
* M31 - Output time since last M109 or SD card start to serial
* M32 - Make directory
* M32 - Make directory
* M35 -
Download Firmware
Nextion from SD
* M35 -
Upload Firmware to
Nextion from SD
* M42 - Change pin status via gcode Use M42 Px Sy to set pin x to value y, when omitting Px the onboard led will be used.
* M42 - Change pin status via gcode Use M42 Px Sy to set pin x to value y, when omitting Px the onboard led will be used.
* M48 - Measure Z_Probe repeatability. M48 [P # of points] [X position] [Y position] [V_erboseness #] [E_ngage Probe] [L # of legs of travel]
* M48 - Measure Z_Probe repeatability. M48 [P # of points] [X position] [Y position] [V_erboseness #] [E_ngage Probe] [L # of legs of travel]
* M70 - Power consumption sensor calibration
* M70 - Power consumption sensor calibration
...
...
MK/module/MK_Main.cpp
View file @
8dabeadc
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
* MK Firmware
* MK Firmware
*
*
* Based on Marlin, Sprinter and grbl
* Based on Marlin, Sprinter and grbl
* Copyright (C) 2013 MagoKimbra
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
* Copyright (C) 2013 - 2016 Alberto Cotronei @MagoKimbra
*
*
* This program is free software: you can redistribute it and/or modify
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* it under the terms of the GNU General Public License as published by
...
@@ -4427,10 +4427,10 @@ inline void gcode_M17() {
...
@@ -4427,10 +4427,10 @@ inline void gcode_M17() {
#if ENABLED(NEXTION)
#if ENABLED(NEXTION)
/**
/**
* M35:
Download Firmware Nextion
* M35:
Upload Firmware to Nextion from SD
*/
*/
inline
void
gcode_M35
()
{
inline
void
gcode_M35
()
{
Down
loadNewFirmware
();
Up
loadNewFirmware
();
}
}
#endif
#endif
#endif
#endif
...
@@ -7448,7 +7448,7 @@ void process_next_command() {
...
@@ -7448,7 +7448,7 @@ void process_next_command() {
case
32
:
// M32 - Make directory
case
32
:
// M32 - Make directory
gcode_M32
();
break
;
gcode_M32
();
break
;
#if ENABLED(NEXTION)
#if ENABLED(NEXTION)
case
35
:
// M35 -
Download Firmware Nextion
case
35
:
// M35 -
Upload Firmware to Nextion from SD
gcode_M35
();
break
;
gcode_M35
();
break
;
#endif
#endif
#endif //SDSUPPORT
#endif //SDSUPPORT
...
...
MK/module/nextion/NexHardware.cpp
View file @
8dabeadc
...
@@ -240,7 +240,8 @@ bool nexInit(void)
...
@@ -240,7 +240,8 @@ bool nexInit(void)
return
ret1
&&
ret2
;
return
ret1
&&
ret2
;
// Else try to 115200 baudrate
// Else try to 115200 baudrate
}
else
{
}
else
{
nexSerial
.
end
();
nexSerial
.
end
();
HAL
::
delayMilliseconds
(
1000
);
HAL
::
delayMilliseconds
(
1000
);
nexSerial
.
begin
(
115200
);
nexSerial
.
begin
(
115200
);
...
...
MK/module/nextion/Nex
Down
load.cpp
→
MK/module/nextion/Nex
Up
load.cpp
View file @
8dabeadc
/**
/**
* @file Nex
Down
load.cpp
* @file Nex
Up
load.cpp
*
*
* The implementation of
down
load tft file for nextion.
* The implementation of
up
load tft file for nextion.
*
*
* @author Chen Zengpeng (email:<zengpeng.chen@itead.cc>)
* @author Chen Zengpeng (email:<zengpeng.chen@itead.cc>)
* @date 2016/3/29
* @date 2016/3/29
...
@@ -13,20 +13,20 @@
...
@@ -13,20 +13,20 @@
* the License, or (at your option) any later version.
* the License, or (at your option) any later version.
*/
*/
#include "Nex
Down
load.h"
#include "Nex
Up
load.h"
#if ENABLED(SDSUPPORT)
#if ENABLED(SDSUPPORT)
Nex
Download
::
NexDownload
(
const
char
*
file_name
,
uint32_t
down
load_baudrate
)
{
Nex
Upload
::
NexUpload
(
const
char
*
file_name
,
uint32_t
up
load_baudrate
)
{
_file_name
=
file_name
;
_file_name
=
file_name
;
_
download_baudrate
=
down
load_baudrate
;
_
upload_baudrate
=
up
load_baudrate
;
}
}
Nex
Download
::
NexDownload
(
const
String
file_Name
,
uint32_t
down
load_baudrate
)
{
Nex
Upload
::
NexUpload
(
const
String
file_Name
,
uint32_t
up
load_baudrate
)
{
Nex
Download
(
file_Name
.
c_str
(),
down
load_baudrate
);
Nex
Upload
(
file_Name
.
c_str
(),
up
load_baudrate
);
}
}
void
Nex
Download
::
startDown
load
(
void
)
{
void
Nex
Upload
::
startUp
load
(
void
)
{
if
(
!
_checkFile
())
{
if
(
!
_checkFile
())
{
ECHO_LM
(
ER
,
"The file is error"
);
ECHO_LM
(
ER
,
"The file is error"
);
return
;
return
;
...
@@ -35,19 +35,19 @@
...
@@ -35,19 +35,19 @@
ECHO_LM
(
ER
,
"baudrate error"
);
ECHO_LM
(
ER
,
"baudrate error"
);
return
;
return
;
}
}
if
(
!
_set
DownloadBaudrate
(
_down
load_baudrate
))
{
if
(
!
_set
UploadBaudrate
(
_up
load_baudrate
))
{
ECHO_LM
(
ER
,
"modify baudrate error"
);
ECHO_LM
(
ER
,
"modify baudrate error"
);
return
;
return
;
}
}
if
(
!
_
down
loadTftFile
())
{
if
(
!
_
up
loadTftFile
())
{
ECHO_LM
(
ER
,
"
down
load file error"
);
ECHO_LM
(
ER
,
"
up
load file error"
);
return
;
return
;
}
}
card
.
closeFile
();
card
.
closeFile
();
ECHO_LM
(
DB
,
"
down
load ok"
);
ECHO_LM
(
DB
,
"
up
load ok"
);
}
}
uint16_t
Nex
Down
load
::
_getBaudrate
(
void
)
{
uint16_t
Nex
Up
load
::
_getBaudrate
(
void
)
{
uint32_t
baudrate_array
[
7
]
=
{
115200
,
57600
,
38400
,
19200
,
9600
,
4800
,
2400
};
uint32_t
baudrate_array
[
7
]
=
{
115200
,
57600
,
38400
,
19200
,
9600
,
4800
,
2400
};
for
(
uint8_t
i
=
0
;
i
<
7
;
i
++
)
{
for
(
uint8_t
i
=
0
;
i
<
7
;
i
++
)
{
if
(
_searchBaudrate
(
baudrate_array
[
i
]))
{
if
(
_searchBaudrate
(
baudrate_array
[
i
]))
{
...
@@ -58,17 +58,17 @@
...
@@ -58,17 +58,17 @@
return
_baudrate
;
return
_baudrate
;
}
}
bool
Nex
Down
load
::
_checkFile
(
void
)
{
bool
Nex
Up
load
::
_checkFile
(
void
)
{
ECHO_LM
(
DB
,
"start _checkFile"
);
ECHO_LM
T
(
DB
,
"Start checkFile "
,
_file_name
);
if
(
!
card
.
selectFile
(
_file_name
))
{
if
(
!
card
.
selectFile
(
_file_name
))
{
ECHO_LM
(
ER
,
"file is not exit"
);
ECHO_LM
(
ER
,
"file is not exit"
);
return
0
;
return
0
;
}
}
_un
down
loadByte
=
card
.
fileSize
;
_un
up
loadByte
=
card
.
fileSize
;
return
1
;
return
1
;
}
}
bool
Nex
Down
load
::
_searchBaudrate
(
uint32_t
baudrate
)
{
bool
Nex
Up
load
::
_searchBaudrate
(
uint32_t
baudrate
)
{
String
string
=
String
(
""
);
String
string
=
String
(
""
);
nexSerial
.
end
();
nexSerial
.
end
();
HAL
::
delayMilliseconds
(
100
);
HAL
::
delayMilliseconds
(
100
);
...
@@ -83,7 +83,7 @@
...
@@ -83,7 +83,7 @@
return
0
;
return
0
;
}
}
void
Nex
Down
load
::
sendCommand
(
const
char
*
cmd
)
{
void
Nex
Up
load
::
sendCommand
(
const
char
*
cmd
)
{
while
(
nexSerial
.
available
())
while
(
nexSerial
.
available
())
nexSerial
.
read
();
nexSerial
.
read
();
...
@@ -93,7 +93,7 @@
...
@@ -93,7 +93,7 @@
nexSerial
.
write
(
0xFF
);
nexSerial
.
write
(
0xFF
);
}
}
uint16_t
Nex
Down
load
::
recvRetString
(
String
&
string
,
uint32_t
timeout
,
bool
recv_flag
)
{
uint16_t
Nex
Up
load
::
recvRetString
(
String
&
string
,
uint32_t
timeout
,
bool
recv_flag
)
{
uint16_t
ret
=
0
;
uint16_t
ret
=
0
;
uint8_t
c
=
0
;
uint8_t
c
=
0
;
long
start
;
long
start
;
...
@@ -117,11 +117,11 @@
...
@@ -117,11 +117,11 @@
return
ret
;
return
ret
;
}
}
bool
Nex
Download
::
_setDown
loadBaudrate
(
uint32_t
baudrate
)
{
bool
Nex
Upload
::
_setUp
loadBaudrate
(
uint32_t
baudrate
)
{
String
string
=
String
(
""
);
String
string
=
String
(
""
);
String
cmd
=
String
(
""
);
String
cmd
=
String
(
""
);
String
filesize_str
=
String
(
_un
down
loadByte
,
10
);
String
filesize_str
=
String
(
_un
up
loadByte
,
10
);
String
baudrate_str
=
String
(
baudrate
,
10
);
String
baudrate_str
=
String
(
baudrate
,
10
);
cmd
=
"whmi-wri "
+
filesize_str
+
","
+
baudrate_str
+
",0"
;
cmd
=
"whmi-wri "
+
filesize_str
+
","
+
baudrate_str
+
",0"
;
...
@@ -136,13 +136,13 @@
...
@@ -136,13 +136,13 @@
return
0
;
return
0
;
}
}
bool
Nex
Download
::
_down
loadTftFile
(
void
)
{
bool
Nex
Upload
::
_up
loadTftFile
(
void
)
{
uint8_t
c
;
uint8_t
c
;
uint16_t
send_timer
=
0
;
uint16_t
send_timer
=
0
;
uint16_t
last_send_num
=
0
;
uint16_t
last_send_num
=
0
;
String
string
=
String
(
""
);
String
string
=
String
(
""
);
send_timer
=
_un
down
loadByte
/
4096
+
1
;
send_timer
=
_un
up
loadByte
/
4096
+
1
;
last_send_num
=
_un
down
loadByte
%
4096
;
last_send_num
=
_un
up
loadByte
%
4096
;
while
(
send_timer
)
{
while
(
send_timer
)
{
if
(
send_timer
==
1
)
{
if
(
send_timer
==
1
)
{
...
...
MK/module/nextion/Nex
Down
load.h
→
MK/module/nextion/Nex
Up
load.h
View file @
8dabeadc
/**
/**
* @file Nex
Down
load.h
* @file Nex
Up
load.h
*
*
* The definition of class Nex
Down
load.
* The definition of class Nex
Up
load.
*
*
* @author Chen Zengpeng (email:<zengpeng.chen@itead.cc>)
* @author Chen Zengpeng (email:<zengpeng.chen@itead.cc>)
* @date 2016/3/29
* @date 2016/3/29
...
@@ -14,8 +14,8 @@
...
@@ -14,8 +14,8 @@
* the License, or (at your option) any later version.
* the License, or (at your option) any later version.
*/
*/
#ifndef __NEX
DOWN
LOAD_H__
#ifndef __NEX
UP
LOAD_H__
#define __NEX
DOWN
LOAD_H__
#define __NEX
UP
LOAD_H__
#include "NexHardware.h"
#include "NexHardware.h"
...
@@ -26,9 +26,9 @@
...
@@ -26,9 +26,9 @@
/**
/**
*
*
* Provides the API for nextion to
down
load the ftf file.
* Provides the API for nextion to
up
load the ftf file.
*/
*/
class
Nex
Down
load
class
Nex
Up
load
{
{
public
:
/* methods */
public
:
/* methods */
...
@@ -36,31 +36,31 @@
...
@@ -36,31 +36,31 @@
* Constructor.
* Constructor.
*
*
* @param file_name - tft file name.
* @param file_name - tft file name.
* @
download_baudrate - set down
load baudrate.
* @
upload_baudrate - set up
load baudrate.
*/
*/
Nex
Download
(
const
char
*
file_name
,
uint32_t
down
load_baudrate
);
Nex
Upload
(
const
char
*
file_name
,
uint32_t
up
load_baudrate
);
/**
/**
* Constructor.
* Constructor.
*
*
* @param file_name - tft file name.
* @param file_name - tft file name.
* @param SD_chip_select - sd chip select pin.
* @param SD_chip_select - sd chip select pin.
* @
download_baudrate - set down
load baudrate.
* @
upload_baudrate - set up
load baudrate.
*/
*/
Nex
Download
(
const
String
file_Name
,
uint32_t
down
load_baudrate
);
Nex
Upload
(
const
String
file_Name
,
uint32_t
up
load_baudrate
);
/**
/**
* destructor.
* destructor.
*
*
*/
*/
~
Nex
Down
load
(){}
~
Nex
Up
load
(){}
/*
/*
* start
down
load.
* start
up
load.
*
*
* @return none.
* @return none.
*/
*/
void
start
Download
(
);
void
start
Upload
(
void
);
private
:
/* methods */
private
:
/* methods */
...
@@ -89,20 +89,20 @@
...
@@ -89,20 +89,20 @@
bool
_searchBaudrate
(
uint32_t
baudrate
);
bool
_searchBaudrate
(
uint32_t
baudrate
);
/*
/*
* set
down
load baudrate.
* set
up
load baudrate.
*
*
* @param baudrate - set
down
load baudrate.
* @param baudrate - set
up
load baudrate.
*
*
* @return true if success, false for failure.
* @return true if success, false for failure.
*/
*/
bool
_set
Down
loadBaudrate
(
uint32_t
baudrate
);
bool
_set
Up
loadBaudrate
(
uint32_t
baudrate
);
/**
/**
* start dowload tft file to nextion.
* start dowload tft file to nextion.
*
*
* @return none.
* @return none.
*/
*/
bool
_
down
loadTftFile
(
void
);
bool
_
up
loadTftFile
(
void
);
/*
/*
* Send command to Nextion.
* Send command to Nextion.
...
@@ -128,8 +128,8 @@
...
@@ -128,8 +128,8 @@
private
:
/* data */
private
:
/* data */
uint32_t
_baudrate
;
/*nextion serail baudrate*/
uint32_t
_baudrate
;
/*nextion serail baudrate*/
const
char
*
_file_name
;
/*nextion tft file name*/
const
char
*
_file_name
;
/*nextion tft file name*/
uint32_t
_un
downloadByte
;
/*undown
load byte of tft file*/
uint32_t
_un
uploadByte
;
/*unup
load byte of tft file*/
uint32_t
_
download_baudrate
;
/*down
load baudrate*/
uint32_t
_
upload_baudrate
;
/*up
load baudrate*/
};
};
#endif
/* #ifndef __NEXDOWNLOAD_H__ */
#endif
/* #ifndef __NEXDOWNLOAD_H__ */
MK/module/nextion/Nextion.h
View file @
8dabeadc
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
#include "NexConfig.h"
#include "NexConfig.h"
#include "NexTouch.h"
#include "NexTouch.h"
#include "NexHardware.h"
#include "NexHardware.h"
#include "Nex
Down
load.h"
#include "Nex
Up
load.h"
#include "NexButton.h"
#include "NexButton.h"
//#include "NexCrop.h"
//#include "NexCrop.h"
...
...
MK/module/nextion/Nextion_lcd.cpp
View file @
8dabeadc
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
#if ENABLED(SDSUPPORT)
#if ENABLED(SDSUPPORT)
uint8_t
SDstatus
=
0
;
// 0 SD not insert, 1 SD insert, 2 SD printing
uint8_t
SDstatus
=
0
;
// 0 SD not insert, 1 SD insert, 2 SD printing
Nex
Down
load
Firmware
(
NEXTION_FIRMWARE_FILE
,
57600
);
Nex
Up
load
Firmware
(
NEXTION_FIRMWARE_FILE
,
57600
);
#endif
#endif
#if ENABLED(NEXTION_GFX)
#if ENABLED(NEXTION_GFX)
...
@@ -356,9 +356,9 @@
...
@@ -356,9 +356,9 @@
setpageSDPopCallback
(
&
MSD1
);
setpageSDPopCallback
(
&
MSD1
);
}
}
void
Down
loadNewFirmware
()
{
void
Up
loadNewFirmware
()
{
if
(
IS_SD_INSERTED
||
card
.
cardOK
)
{
if
(
IS_SD_INSERTED
||
card
.
cardOK
)
{
Firmware
.
start
Down
load
();
Firmware
.
start
Up
load
();
nexSerial
.
end
();
nexSerial
.
end
();
lcd_init
();
lcd_init
();
}
}
...
...
MK/module/nextion/Nextion_lcd.h
View file @
8dabeadc
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
void
sdfolderUpPopCallback
(
void
*
ptr
);
void
sdfolderUpPopCallback
(
void
*
ptr
);
void
PlayPausePopCallback
(
void
*
ptr
);
void
PlayPausePopCallback
(
void
*
ptr
);
void
StopPopCallback
(
void
*
ptr
);
void
StopPopCallback
(
void
*
ptr
);
void
Down
loadNewFirmware
();
void
Up
loadNewFirmware
();
#endif
#endif
FORCE_INLINE
bool
lcd_hasstatus
()
{
return
false
;
}
FORCE_INLINE
bool
lcd_hasstatus
()
{
return
false
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment