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
81a02a56
Commit
81a02a56
authored
Oct 05, 2015
by
MagoKimbra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix SD card detect
parent
d14f42ad
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
36 deletions
+26
-36
Configuration_Basic.h
MarlinKimbra/Configuration_Basic.h
+1
-1
ultralcd.cpp
MarlinKimbra/ultralcd.cpp
+25
-35
No files found.
MarlinKimbra/Configuration_Basic.h
View file @
81a02a56
...
@@ -134,7 +134,7 @@
...
@@ -134,7 +134,7 @@
* (but gives greater accuracy and more stable PID) *
* (but gives greater accuracy and more stable PID) *
* Please choose the one that matches your setup. *
* Please choose the one that matches your setup. *
* *
* *
* Temperature sensor settings (
4.7
kohm PULLUP): *
* Temperature sensor settings (
1
kohm PULLUP): *
* 51 is 100k thermistor - EPCOS (1k pullup) *
* 51 is 100k thermistor - EPCOS (1k pullup) *
* 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup) *
* 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup) *
* 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) *
* 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) *
...
...
MarlinKimbra/ultralcd.cpp
View file @
81a02a56
...
@@ -54,7 +54,7 @@ int gumPreheatFanSpeed;
...
@@ -54,7 +54,7 @@ int gumPreheatFanSpeed;
typedef
void
(
*
menuFunc_t
)();
typedef
void
(
*
menuFunc_t
)();
uint8_t
lcd_status_message_level
;
uint8_t
lcd_status_message_level
;
char
lcd_status_message
[
3
*
LCD_WIDTH
+
1
]
=
WELCOME_MSG
;
// worst case is kana with up to 3*LCD_WIDTH+1
char
lcd_status_message
[
3
*
LCD_WIDTH
+
1
]
=
WELCOME_MSG
;
// worst case is kana with up to 3*LCD_WIDTH+1
#if ENABLED(DOGLCD)
#if ENABLED(DOGLCD)
#include "dogm_lcd_implementation.h"
#include "dogm_lcd_implementation.h"
...
@@ -93,7 +93,6 @@ static void lcd_status_screen();
...
@@ -93,7 +93,6 @@ static void lcd_status_screen();
#if ENABLED(FWRETRACT)
#if ENABLED(FWRETRACT)
static
void
lcd_control_retract_menu
();
static
void
lcd_control_retract_menu
();
#endif
#endif
static
void
lcd_sdcard_menu
();
#if MECH(DELTA)
#if MECH(DELTA)
static
void
lcd_delta_calibrate_menu
();
static
void
lcd_delta_calibrate_menu
();
...
@@ -107,8 +106,6 @@ static void lcd_status_screen();
...
@@ -107,8 +106,6 @@ static void lcd_status_screen();
static
void
menu_action_submenu
(
menuFunc_t
data
);
static
void
menu_action_submenu
(
menuFunc_t
data
);
static
void
menu_action_gcode
(
const
char
*
pgcode
);
static
void
menu_action_gcode
(
const
char
*
pgcode
);
static
void
menu_action_function
(
menuFunc_t
data
);
static
void
menu_action_function
(
menuFunc_t
data
);
static
void
menu_action_sdfile
(
const
char
*
filename
,
char
*
longFilename
);
static
void
menu_action_sddirectory
(
const
char
*
filename
,
char
*
longFilename
);
static
void
menu_action_setting_edit_bool
(
const
char
*
pstr
,
bool
*
ptr
);
static
void
menu_action_setting_edit_bool
(
const
char
*
pstr
,
bool
*
ptr
);
static
void
menu_action_setting_edit_int3
(
const
char
*
pstr
,
int
*
ptr
,
int
minValue
,
int
maxValue
);
static
void
menu_action_setting_edit_int3
(
const
char
*
pstr
,
int
*
ptr
,
int
minValue
,
int
maxValue
);
static
void
menu_action_setting_edit_float3
(
const
char
*
pstr
,
float
*
ptr
,
float
minValue
,
float
maxValue
);
static
void
menu_action_setting_edit_float3
(
const
char
*
pstr
,
float
*
ptr
,
float
minValue
,
float
maxValue
);
...
@@ -128,6 +125,12 @@ static void lcd_status_screen();
...
@@ -128,6 +125,12 @@ static void lcd_status_screen();
static
void
menu_action_setting_edit_callback_float52
(
const
char
*
pstr
,
float
*
ptr
,
float
minValue
,
float
maxValue
,
menuFunc_t
callbackFunc
);
static
void
menu_action_setting_edit_callback_float52
(
const
char
*
pstr
,
float
*
ptr
,
float
minValue
,
float
maxValue
,
menuFunc_t
callbackFunc
);
static
void
menu_action_setting_edit_callback_long5
(
const
char
*
pstr
,
unsigned
long
*
ptr
,
unsigned
long
minValue
,
unsigned
long
maxValue
,
menuFunc_t
callbackFunc
);
static
void
menu_action_setting_edit_callback_long5
(
const
char
*
pstr
,
unsigned
long
*
ptr
,
unsigned
long
minValue
,
unsigned
long
maxValue
,
menuFunc_t
callbackFunc
);
#if ENABLED(SDSUPPORT)
static
void
lcd_sdcard_menu
();
static
void
menu_action_sdfile
(
const
char
*
filename
,
char
*
longFilename
);
static
void
menu_action_sddirectory
(
const
char
*
filename
,
char
*
longFilename
);
#endif
#define ENCODER_FEEDRATE_DEADZONE 10
#define ENCODER_FEEDRATE_DEADZONE 10
#if DISABLED(LCD_I2C_VIKI)
#if DISABLED(LCD_I2C_VIKI)
...
@@ -167,7 +170,6 @@ static void lcd_status_screen();
...
@@ -167,7 +170,6 @@ static void lcd_status_screen();
return; } \
return; } \
for (uint8_t _drawLineNr = 0; _drawLineNr < LCD_HEIGHT; _drawLineNr++, _lineNr++) { \
for (uint8_t _drawLineNr = 0; _drawLineNr < LCD_HEIGHT; _drawLineNr++, _lineNr++) { \
_menuItemNr = 0;
_menuItemNr = 0;
#else
#else
#define START_MENU(last_menu) do { \
#define START_MENU(last_menu) do { \
encoderRateMultiplierEnabled = false; \
encoderRateMultiplierEnabled = false; \
...
@@ -268,7 +270,7 @@ static void lcd_status_screen();
...
@@ -268,7 +270,7 @@ static void lcd_status_screen();
uint8_t
lastEncoderBits
;
uint8_t
lastEncoderBits
;
uint32_t
encoderPosition
;
uint32_t
encoderPosition
;
#if PIN_EXISTS(SD_DETECT)
#if PIN_EXISTS(SD_DETECT)
bool
lcd_oldcard
status
;
uint8_t
lcd_sd_
status
;
#endif
#endif
#endif // ULTIPANEL
#endif // ULTIPANEL
...
@@ -337,14 +339,10 @@ static void lcd_status_screen() {
...
@@ -337,14 +339,10 @@ static void lcd_status_screen() {
lcd_status_message
[
0
]
=
'\0'
;
lcd_status_message
[
0
]
=
'\0'
;
expire_status_ms
=
0
;
expire_status_ms
=
0
;
}
}
}
}
else
else
{
expire_status_ms
+=
LCD_UPDATE_INTERVAL
;
expire_status_ms
+=
LCD_UPDATE_INTERVAL
;
}
}
else
}
else
{
expire_status_ms
=
0
;
expire_status_ms
=
0
;
}
#else
#else
expire_status_ms
=
0
;
expire_status_ms
=
0
;
#endif // SDSUPPORT
#endif // SDSUPPORT
...
@@ -379,8 +377,7 @@ static void lcd_status_screen() {
...
@@ -379,8 +377,7 @@ static void lcd_status_screen() {
ignore_click
=
wait_for_unclick
=
false
;
ignore_click
=
wait_for_unclick
=
false
;
else
else
current_click
=
false
;
current_click
=
false
;
}
}
else
if
(
current_click
)
{
else
if
(
current_click
)
{
lcd_quick_feedback
();
lcd_quick_feedback
();
wait_for_unclick
=
true
;
wait_for_unclick
=
true
;
current_click
=
false
;
current_click
=
false
;
...
@@ -457,9 +454,8 @@ static void lcd_return_to_status() { lcd_goto_menu(lcd_status_screen); }
...
@@ -457,9 +454,8 @@ static void lcd_return_to_status() { lcd_goto_menu(lcd_status_screen); }
static
void
lcd_main_menu
()
{
static
void
lcd_main_menu
()
{
START_MENU
(
lcd_status_screen
);
START_MENU
(
lcd_status_screen
);
MENU_ITEM
(
back
,
MSG_WATCH
,
lcd_status_screen
);
MENU_ITEM
(
back
,
MSG_WATCH
,
lcd_status_screen
);
if
(
movesplanned
()
||
IS_SD_PRINTING
)
{
if
(
movesplanned
()
||
IS_SD_PRINTING
)
MENU_ITEM
(
submenu
,
MSG_TUNE
,
lcd_tune_menu
);
MENU_ITEM
(
submenu
,
MSG_TUNE
,
lcd_tune_menu
);
}
else
{
else
{
MENU_ITEM
(
submenu
,
MSG_PREPARE
,
lcd_prepare_menu
);
MENU_ITEM
(
submenu
,
MSG_PREPARE
,
lcd_prepare_menu
);
#if MECH(DELTA)
#if MECH(DELTA)
...
@@ -467,9 +463,7 @@ static void lcd_main_menu() {
...
@@ -467,9 +463,7 @@ static void lcd_main_menu() {
#endif // DELTA
#endif // DELTA
}
}
MENU_ITEM
(
submenu
,
MSG_CONTROL
,
lcd_control_menu
);
MENU_ITEM
(
submenu
,
MSG_CONTROL
,
lcd_control_menu
);
MENU_ITEM
(
submenu
,
MSG_STATS
,
lcd_stats_menu
);
MENU_ITEM
(
submenu
,
MSG_STATS
,
lcd_stats_menu
);
#if ENABLED(SDSUPPORT)
#if ENABLED(SDSUPPORT)
if
(
card
.
cardOK
)
{
if
(
card
.
cardOK
)
{
if
(
card
.
isFileOpen
())
{
if
(
card
.
isFileOpen
())
{
...
@@ -478,15 +472,13 @@ static void lcd_main_menu() {
...
@@ -478,15 +472,13 @@ static void lcd_main_menu() {
else
else
MENU_ITEM
(
function
,
MSG_RESUME_PRINT
,
lcd_sdcard_resume
);
MENU_ITEM
(
function
,
MSG_RESUME_PRINT
,
lcd_sdcard_resume
);
MENU_ITEM
(
function
,
MSG_STOP_PRINT
,
lcd_sdcard_stop
);
MENU_ITEM
(
function
,
MSG_STOP_PRINT
,
lcd_sdcard_stop
);
}
}
else
{
else
{
MENU_ITEM
(
submenu
,
MSG_CARD_MENU
,
lcd_sdcard_menu
);
MENU_ITEM
(
submenu
,
MSG_CARD_MENU
,
lcd_sdcard_menu
);
#if !PIN_EXISTS(SD_DETECT)
#if !PIN_EXISTS(SD_DETECT)
MENU_ITEM
(
gcode
,
MSG_CNG_SDCARD
,
PSTR
(
"M21"
));
// SD-card changed by user
MENU_ITEM
(
gcode
,
MSG_CNG_SDCARD
,
PSTR
(
"M21"
));
// SD-card changed by user
#endif
#endif
}
}
}
}
else
{
else
{
MENU_ITEM
(
submenu
,
MSG_NO_CARD
,
lcd_sdcard_menu
);
MENU_ITEM
(
submenu
,
MSG_NO_CARD
,
lcd_sdcard_menu
);
#if !PIN_EXISTS(SD_DETECT)
#if !PIN_EXISTS(SD_DETECT)
MENU_ITEM
(
gcode
,
MSG_INIT_SDCARD
,
PSTR
(
"M21"
));
// Manually initialize the SD-card via user interface
MENU_ITEM
(
gcode
,
MSG_INIT_SDCARD
,
PSTR
(
"M21"
));
// Manually initialize the SD-card via user interface
...
@@ -1681,7 +1673,7 @@ void lcd_init() {
...
@@ -1681,7 +1673,7 @@ void lcd_init() {
#if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT)
#if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT)
pinMode
(
SD_DETECT_PIN
,
INPUT
);
pinMode
(
SD_DETECT_PIN
,
INPUT
);
WRITE
(
SD_DETECT_PIN
,
HIGH
);
WRITE
(
SD_DETECT_PIN
,
HIGH
);
lcd_
oldcardstatus
=
IS_SD_INSERTED
;
lcd_
sd_status
=
2
;
// UNKNOWN
#endif
#endif
#if ENABLED(LCD_HAS_SLOW_BUTTONS)
#if ENABLED(LCD_HAS_SLOW_BUTTONS)
...
@@ -1738,24 +1730,22 @@ void lcd_update() {
...
@@ -1738,24 +1730,22 @@ void lcd_update() {
lcd_buttons_update
();
lcd_buttons_update
();
#if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT)
#if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT)
bool
sd_status
=
IS_SD_INSERTED
;
if
(
IS_SD_INSERTED
!=
lcd_oldcard
status
&&
lcd_detected
())
{
if
(
sd_status
!=
lcd_sd_
status
&&
lcd_detected
())
{
lcdDrawUpdate
=
2
;
lcdDrawUpdate
=
2
;
lcd_oldcardstatus
=
IS_SD_INSERTED
;
lcd_implementation_init
(
// to maybe revive the LCD if static electricity killed it.
lcd_implementation_init
(
// to maybe revive the LCD if static electricity killed it.
#if ENABLED(LCD_PROGRESS_BAR)
#if ENABLED(LCD_PROGRESS_BAR)
currentMenu
==
lcd_status_screen
currentMenu
==
lcd_status_screen
#endif
#endif
);
);
if
(
sd_status
)
{
if
(
lcd_oldcardstatus
)
{
card
.
initsd
();
card
.
initsd
();
LCD_MESSAGEPGM
(
MSG_SD_INSERTED
);
if
(
lcd_sd_status
!=
2
)
LCD_MESSAGEPGM
(
MSG_SD_INSERTED
);
}
}
else
{
else
{
card
.
release
();
card
.
release
();
LCD_MESSAGEPGM
(
MSG_SD_REMOVED
);
if
(
lcd_sd_status
!=
2
)
LCD_MESSAGEPGM
(
MSG_SD_REMOVED
);
}
}
lcd_sd_status
=
sd_status
;
}
}
#endif // SDSUPPORT && SD_DETECT_PIN
#endif // SDSUPPORT && SD_DETECT_PIN
...
...
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