Merge pull request #1141 from filipmu/Filament-Sensor

Display filament sensor data on a 20x4 LCD or Graphical LCD
This commit is contained in:
Bo Herrmannsen
2014-12-17 20:38:30 +01:00
6 changed files with 75 additions and 3 deletions

View File

@ -20,6 +20,12 @@ int absPreheatHPBTemp;
int absPreheatFanSpeed;
#ifdef FILAMENT_LCD_DISPLAY
unsigned long message_millis=0;
#endif
#ifdef ULTIPANEL
static float manual_feedrate[] = MANUAL_FEEDRATE;
#endif // ULTIPANEL
@ -216,6 +222,9 @@ static void lcd_status_screen()
encoderPosition = 0;
lcd_quick_feedback();
lcd_implementation_init(); // to maybe revive the LCD if static electricity killed it.
#ifdef FILAMENT_LCD_DISPLAY
message_millis=millis(); //get status message to show up for a while
#endif
}
#ifdef ULTIPANEL_FEEDMULTIPLY
@ -1355,6 +1364,9 @@ void lcd_setstatus(const char* message)
return;
strncpy(lcd_status_message, message, LCD_WIDTH);
lcdDrawUpdate = 2;
#ifdef FILAMENT_LCD_DISPLAY
message_millis=millis(); //get status message to show up for a while
#endif
}
void lcd_setstatuspgm(const char* message)
{
@ -1362,6 +1374,9 @@ void lcd_setstatuspgm(const char* message)
return;
strncpy_P(lcd_status_message, message, LCD_WIDTH);
lcdDrawUpdate = 2;
#ifdef FILAMENT_LCD_DISPLAY
message_millis=millis(); //get status message to show up for a while
#endif
}
void lcd_setalertstatuspgm(const char* message)
{
@ -1549,6 +1564,20 @@ char *ftostr32(const float &x)
return conv;
}
//Float to string with 1.23 format
char *ftostr12ns(const float &x)
{
long xx=x*100;
xx=abs(xx);
conv[0]=(xx/100)%10+'0';
conv[1]='.';
conv[2]=(xx/10)%10+'0';
conv[3]=(xx)%10+'0';
conv[4]=0;
return conv;
}
char *itostr31(const int &xx)
{
conv[0]=(xx>=0)?'+':'-';