Commit 0a201721 authored by MagoKimbra's avatar MagoKimbra

Same Fix

parent 48e1664e
...@@ -4,6 +4,10 @@ ...@@ -4,6 +4,10 @@
*/ */
#ifndef CONDITIONALS_H #ifndef CONDITIONALS_H
#ifndef M_PI
#define M_PI 3.1415926536
#endif
#ifndef CONFIGURATION_LCD // Get the LCD defines which are needed first #ifndef CONFIGURATION_LCD // Get the LCD defines which are needed first
#define CONFIGURATION_LCD #define CONFIGURATION_LCD
...@@ -286,7 +290,7 @@ ...@@ -286,7 +290,7 @@
* Advance calculated values * Advance calculated values
*/ */
#ifdef ADVANCE #ifdef ADVANCE
#define EXTRUSION_AREA (0.25 * D_FILAMENT * D_FILAMENT * 3.14159) #define EXTRUSION_AREA (0.25 * D_FILAMENT * D_FILAMENT * M_PI)
#define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS] / EXTRUSION_AREA) #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS] / EXTRUSION_AREA)
#endif #endif
...@@ -398,8 +402,6 @@ ...@@ -398,8 +402,6 @@
#define HAS_TEMP_2 (defined(TEMP_2_PIN) && (TEMP_2_PIN >= 0) && TEMP_SENSOR_2) #define HAS_TEMP_2 (defined(TEMP_2_PIN) && (TEMP_2_PIN >= 0) && TEMP_SENSOR_2)
#define HAS_TEMP_3 (defined(TEMP_3_PIN) && (TEMP_3_PIN >= 0) && TEMP_SENSOR_3) #define HAS_TEMP_3 (defined(TEMP_3_PIN) && (TEMP_3_PIN >= 0) && TEMP_SENSOR_3)
#define HAS_TEMP_BED (defined(TEMP_BED_PIN) && (TEMP_BED_PIN >= 0) && TEMP_SENSOR_BED) #define HAS_TEMP_BED (defined(TEMP_BED_PIN) && (TEMP_BED_PIN >= 0) && TEMP_SENSOR_BED)
#define HAS_FILAMENT_SENSOR (defined(FILAMENT_SENSOR) && defined(FILWIDTH_PIN) && FILWIDTH_PIN >= 0)
#define HAS_POWER_CONSUMPTION_SENSOR (defined(POWER_CONSUMPTION) && defined(POWER_CONSUMPTION_PIN) && POWER_CONSUMPTION_PIN >= 0)
#define HAS_HEATER_0 (defined(HEATER_0_PIN) && HEATER_0_PIN >= 0) #define HAS_HEATER_0 (defined(HEATER_0_PIN) && HEATER_0_PIN >= 0)
#define HAS_HEATER_1 (defined(HEATER_1_PIN) && HEATER_1_PIN >= 0) #define HAS_HEATER_1 (defined(HEATER_1_PIN) && HEATER_1_PIN >= 0)
#define HAS_HEATER_2 (defined(HEATER_2_PIN) && HEATER_2_PIN >= 0) #define HAS_HEATER_2 (defined(HEATER_2_PIN) && HEATER_2_PIN >= 0)
...@@ -438,10 +440,12 @@ ...@@ -438,10 +440,12 @@
#endif #endif
/** /**
* Shorthand for sensor test for ultralcd.cpp, dogm_lcd_implementation.h, ultralcd_implementation_hitachi_HD44780.h * Shorthand for filament sensor and power sensor for ultralcd.cpp, dogm_lcd_implementation.h, ultralcd_implementation_hitachi_HD44780.h
*/ */
#define HAS_LCD_FILAMENT_SENSOR (HAS_FILAMENT_SENSOR && defined(FILAMENT_LCD_DISPLAY)) #define HAS_FILAMENT_SENSOR (defined(FILAMENT_SENSOR) && defined(FILWIDTH_PIN) && FILWIDTH_PIN >= 0)
#define HAS_LCD_POWER_SENSOR (HAS_POWER_CONSUMPTION_SENSOR && defined(POWER_CONSUMPTION_LCD_DISPLAY)) #define HAS_POWER_CONSUMPTION_SENSOR (defined(POWER_CONSUMPTION) && defined(POWER_CONSUMPTION_PIN) && POWER_CONSUMPTION_PIN >= 0)
#define HAS_LCD_FILAMENT_SENSOR (HAS_FILAMENT_SENSOR && defined(FILAMENT_LCD_DISPLAY))
#define HAS_LCD_POWER_SENSOR (HAS_POWER_CONSUMPTION_SENSOR && defined(POWER_CONSUMPTION_LCD_DISPLAY))
#endif //CONFIGURATION_LCD #endif //CONFIGURATION_LCD
#endif //CONDITIONALS_H #endif //CONDITIONALS_H
...@@ -132,7 +132,7 @@ void Config_StoreSettings() { ...@@ -132,7 +132,7 @@ void Config_StoreSettings() {
#ifdef IDLE_OOZING_PREVENT #ifdef IDLE_OOZING_PREVENT
EEPROM_WRITE_VAR(i, idleoozing_enabled); EEPROM_WRITE_VAR(i, idleoozing_enabled);
#endif #endif
#if defined(POWER_CONSUMPTION) && defined(STORE_CONSUMPTION) #if defined(POWER_CONSUMPTION) && defined(STORE_CONSUMPTION)
EEPROM_WRITE_VAR(i, power_consumption_hour); EEPROM_WRITE_VAR(i, power_consumption_hour);
#endif #endif
...@@ -259,8 +259,8 @@ void Config_RetrieveSettings() ...@@ -259,8 +259,8 @@ void Config_RetrieveSettings()
#ifdef IDLE_OOZING_PREVENT #ifdef IDLE_OOZING_PREVENT
EEPROM_READ_VAR(i, idleoozing_enabled); EEPROM_READ_VAR(i, idleoozing_enabled);
#endif #endif
#if defined(POWER_CONSUMPTION) && defined(STORE_CONSUMPTION) #if defined(POWER_CONSUMPTION) && defined(STORE_CONSUMPTION)
EEPROM_READ_VAR(i, power_consumption_hour); EEPROM_READ_VAR(i, power_consumption_hour);
#endif #endif
...@@ -408,7 +408,7 @@ void Config_ResetDefault() ...@@ -408,7 +408,7 @@ void Config_ResetDefault()
#ifdef IDLE_OOZING_PREVENT #ifdef IDLE_OOZING_PREVENT
idleoozing_enabled = true; idleoozing_enabled = true;
#endif #endif
#if defined(POWER_CONSUMPTION) && defined(STORE_CONSUMPTION) #if defined(POWER_CONSUMPTION) && defined(STORE_CONSUMPTION)
power_consumption_hour = 0; power_consumption_hour = 0;
#endif #endif
...@@ -649,5 +649,12 @@ void Config_PrintSettings() ...@@ -649,5 +649,12 @@ void Config_PrintSettings()
SERIAL_ECHOLNPGM("Filament settings: Disabled"); SERIAL_ECHOLNPGM("Filament settings: Disabled");
} }
#endif //FWRETRACT #endif //FWRETRACT
#if defined(POWER_CONSUMPTION) && defined(STORE_CONSUMPTION)
SERIAL_ECHO_START;
SERIAL_ECHOLNPGM("Power consumation:");
SERIAL_ECHO_START;
SERIAL_ECHOPAIR(" W/h:", power_consumption_hour);
#endif
} }
#endif //!DISABLE_M503 #endif //!DISABLE_M503
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
#define BIT(b) (1<<(b)) #define BIT(b) (1<<(b))
#define TEST(n,b) (((n)&BIT(b))!=0) #define TEST(n,b) (((n)&BIT(b))!=0)
#define RADIANS(d) ((d)*M_PI/180.0)
#define DEGREES(r) ((d)*180.0/M_PI)
// Arduino < 1.0.0 does not define this, so we need to do it ourselves // Arduino < 1.0.0 does not define this, so we need to do it ourselves
#ifndef analogInputToDigitalPin #ifndef analogInputToDigitalPin
......
This diff is collapsed.
...@@ -199,11 +199,11 @@ static void lcd_implementation_init() ...@@ -199,11 +199,11 @@ static void lcd_implementation_init()
// digitalWrite(17, HIGH); // digitalWrite(17, HIGH);
#ifdef LCD_SCREEN_ROT_90 #ifdef LCD_SCREEN_ROT_90
u8g.setRot90(); // Rotate screen by 90° u8g.setRot90(); // Rotate screen by 90
#elif defined(LCD_SCREEN_ROT_180) #elif defined(LCD_SCREEN_ROT_180)
u8g.setRot180(); // Rotate screen by 180° u8g.setRot180(); // Rotate screen by 180
#elif defined(LCD_SCREEN_ROT_270) #elif defined(LCD_SCREEN_ROT_270)
u8g.setRot270(); // Rotate screen by 270° u8g.setRot270(); // Rotate screen by 270
#endif #endif
// Show splashscreen // Show splashscreen
...@@ -371,7 +371,7 @@ static void lcd_implementation_status_screen() { ...@@ -371,7 +371,7 @@ static void lcd_implementation_status_screen() {
#else #else
u8g.setPrintPos(0,63); u8g.setPrintPos(0,63);
#endif #endif
#if HAS_LCD_FILAMENT_SENSOR || HAS_LCD_POWER_SENSOR #if HAS_LCD_FILAMENT_SENSOR || HAS_LCD_POWER_SENSOR
if (millis() < message_millis + 5000) { //Display both Status message line and Filament display on the last line if (millis() < message_millis + 5000) { //Display both Status message line and Filament display on the last line
lcd_print(lcd_status_message); lcd_print(lcd_status_message);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment