Commit 3acc5a42 authored by MagoKimbra's avatar MagoKimbra

Update V4.2.3

parent 9d05f329
...@@ -41,7 +41,8 @@ ...@@ -41,7 +41,8 @@
#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" #define MACHINE_UUID "00000000-0000-0000-0000-000000000000"
// If you want test the firmware uncomment below. Use Serial arduino monitor... // If you want test the firmware uncomment below. Use Serial arduino monitor...
//#define FIRMWARE_TEST // ONLY BAUDRATE 115200 // ONLY BAUDRATE 115200
//#define FIRMWARE_TEST
// Some particular clients re-start sending commands only after receiving a 'wait' when there is a bed serial-connection. // Some particular clients re-start sending commands only after receiving a 'wait' when there is a bed serial-connection.
//#define NO_TIMEOUTS 1000 // Milliseconds //#define NO_TIMEOUTS 1000 // Milliseconds
......
...@@ -253,24 +253,24 @@ ...@@ -253,24 +253,24 @@
// Enable this to sample the bed in a grid (least squares solution) // Enable this to sample the bed in a grid (least squares solution)
// Note: this feature generates 10KB extra code size // Note: this feature generates 10KB extra code size
#define AUTO_BED_LEVELING_GRID //#define AUTO_BED_LEVELING_GRID
// yes AUTO_BED_LEVELING_GRID // yes AUTO_BED_LEVELING_GRID
#define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this //#define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this
// Set the number of grid points per dimension // Set the number of grid points per dimension
// You probably don't need more than 3 (squared=9) // You probably don't need more than 3 (squared=9)
#define AUTO_BED_LEVELING_GRID_POINTS 2 //#define AUTO_BED_LEVELING_GRID_POINTS 2
// yes AUTO_BED_LEVELING_GRID // yes AUTO_BED_LEVELING_GRID
// no AUTO_BED_LEVELING_GRID // no AUTO_BED_LEVELING_GRID
// Arbitrary points to probe. A simple cross-product // Arbitrary points to probe. A simple cross-product
// is used to estimate the plane of the bed. // is used to estimate the plane of the bed.
#define ABL_PROBE_PT_1_X 15 //#define ABL_PROBE_PT_1_X 15
#define ABL_PROBE_PT_1_Y 180 //#define ABL_PROBE_PT_1_Y 180
#define ABL_PROBE_PT_2_X 15 //#define ABL_PROBE_PT_2_X 15
#define ABL_PROBE_PT_2_Y 20 //#define ABL_PROBE_PT_2_Y 20
#define ABL_PROBE_PT_3_X 170 //#define ABL_PROBE_PT_3_X 170
#define ABL_PROBE_PT_3_Y 20 //#define ABL_PROBE_PT_3_Y 20
// no AUTO_BED_LEVELING_GRID // no AUTO_BED_LEVELING_GRID
// Offsets to the probe relative to the extruder tip (Hotend - Probe) // Offsets to the probe relative to the extruder tip (Hotend - Probe)
......
This diff is collapsed.
/** /**
* MarlinKimbra Firmware * MarlinKimbra Firmware
* *
* Based on 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
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
...@@ -16,20 +17,8 @@ ...@@ -16,20 +17,8 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* About Marlin
*
* This firmware is a mashup between Sprinter and grbl.
* - https://github.com/kliment/Sprinter
* - https://github.com/simen/grbl/tree
*
* It has preliminary support for Matthew Roberts advance algorithm
* - http://reprap.org/pipermail/reprap-dev/2011-May/003323.html
*/ */
/* All the implementation is done in *.cpp files to get better compatibility with avr-gcc without the Arduino IDE */
/* Use this file to help the Arduino IDE find which Arduino libraries are needed and to keep documentation on GCode */
#include "base.h" #include "base.h"
#if ENABLED(DIGIPOT_I2C) || ENABLED(BLINKM) #if ENABLED(DIGIPOT_I2C) || ENABLED(BLINKM)
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include "Marlin_main.h" #include "Marlin_main.h"
#include "ultralcd.h" #include "ultralcd.h"
#include "nextion/nextion_lcd.h" #include "module/nextion_lcd.h"
#include "base.h" #include "base.h"
#if ENABLED(AUTO_BED_LEVELING_FEATURE) #if ENABLED(AUTO_BED_LEVELING_FEATURE)
#include "vector_3.h" #include "vector_3.h"
...@@ -54,16 +54,15 @@ ...@@ -54,16 +54,15 @@
#endif #endif
#if HAS(BUZZER) #if HAS(BUZZER)
#include "buzzer.h" #include "module/buzzer.h"
#endif #endif
#if ENABLED(BLINKM) #if ENABLED(BLINKM)
#include "blinkm.h" #include "module/blinkm.h"
#include "Wire.h"
#endif #endif
#if HAS(SERVOS) #if HAS(SERVOS)
#include "servo.h" #include "module/servo.h"
#endif #endif
#if HAS(DIGIPOTSS) #if HAS(DIGIPOTSS)
...@@ -71,7 +70,7 @@ ...@@ -71,7 +70,7 @@
#endif #endif
#if ENABLED(FIRMWARE_TEST) #if ENABLED(FIRMWARE_TEST)
#include "firmware_test.h" #include "module/firmware_test.h"
#endif #endif
/** /**
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "stepper.h" #include "stepper.h"
#include "temperature.h" #include "temperature.h"
#include "ultralcd.h" #include "ultralcd.h"
#include "nextion/nextion_lcd.h" #include "module/nextion_lcd.h"
#include "cardreader.h" #include "cardreader.h"
CardReader::CardReader() { CardReader::CardReader() {
......
...@@ -708,6 +708,18 @@ ...@@ -708,6 +708,18 @@
* Servos * Servos
*/ */
#if HAS(SERVOS) #if HAS(SERVOS)
#ifndef X_ENDSTOP_SERVO_NR
#define X_ENDSTOP_SERVO_NR -1
#endif
#ifndef Y_ENDSTOP_SERVO_NR
#define Y_ENDSTOP_SERVO_NR -1
#endif
#ifndef Z_ENDSTOP_SERVO_NR
#define Z_ENDSTOP_SERVO_NR -1
#endif
#ifndef SERVO_DEACTIVATION_DELAY
#define SERVO_DEACTIVATION_DELAY 300
#endif
#if X_ENDSTOP_SERVO_NR >= 0 || Y_ENDSTOP_SERVO_NR >= 0 || Z_ENDSTOP_SERVO_NR >= 0 #if X_ENDSTOP_SERVO_NR >= 0 || Y_ENDSTOP_SERVO_NR >= 0 || Z_ENDSTOP_SERVO_NR >= 0
#define HAS_SERVO_ENDSTOPS true #define HAS_SERVO_ENDSTOPS true
#define SERVO_ENDSTOP_IDS { X_ENDSTOP_SERVO_NR, Y_ENDSTOP_SERVO_NR, Z_ENDSTOP_SERVO_NR } #define SERVO_ENDSTOP_IDS { X_ENDSTOP_SERVO_NR, Y_ENDSTOP_SERVO_NR, Z_ENDSTOP_SERVO_NR }
......
...@@ -2,11 +2,12 @@ ...@@ -2,11 +2,12 @@
blinkm.cpp - Library for controlling a BlinkM over i2c blinkm.cpp - Library for controlling a BlinkM over i2c
Created by Tim Koster, August 21 2013. Created by Tim Koster, August 21 2013.
*/ */
#include "base.h" #include "../base.h"
#if ENABLED(BLINKM) #if ENABLED(BLINKM)
#include "blinkm.h" #include "blinkm.h"
#include <Wire.h>
void SendColors(byte red, byte grn, byte blu) { void SendColors(byte red, byte grn, byte blu) {
Wire.begin(); Wire.begin();
......
#include "base.h" #include "../base.h"
#if HAS(BUZZER) #if HAS(BUZZER)
#include "buzzer.h" #include "buzzer.h"
#include "ultralcd.h" #include "../ultralcd.h"
void buzz(long duration, uint16_t freq) { void buzz(long duration, uint16_t freq) {
if (freq > 0) { if (freq > 0) {
......
/* /**
Test.h * Tools for firmware test
Tools for firmware test * By MagoKimbra
By MagoKimbra
*/ */
#include "base.h" #include "../base.h"
#if ENABLED(FIRMWARE_TEST) #if ENABLED(FIRMWARE_TEST)
#include "Marlin_main.h"
#include "firmware_test.h"
#include "../Marlin_main.h"
#include "../planner.h"
#include "../stepper_indirection.h"
#include "../stepper.h"
#include "../temperature.h"
#if ENABLED(AUTO_BED_LEVELING_FEATURE) #if ENABLED(AUTO_BED_LEVELING_FEATURE)
#include "vector_3.h" #include "../vector_3.h"
#endif #endif
#include "planner.h"
#include "stepper_indirection.h"
#include "stepper.h"
#include "temperature.h"
#include "firmware_test.h"
static char serial_answer; static char serial_answer;
void FirmwareTest() { void FirmwareTest() {
......
#ifndef FIRMWARE_TEST_H #ifndef FIRMWARE_TEST_H
#define FIRMWARE_TEST_H #define FIRMWARE_TEST_H
void FirmwareTest();
void FirmwareTest();
#endif #endif
...@@ -17,16 +17,18 @@ ...@@ -17,16 +17,18 @@
#include "nextion_gfx.h" #include "nextion_gfx.h"
#include <Nextion.h> #include <Nextion.h>
const float MaxWave = 0.2;
bool NextionON = false; bool NextionON = false;
bool PageInfo = false; bool PageInfo = false;
bool gfxON = false;
char buffer[100] = {0}; char buffer[100] = {0};
uint32_t slidermaxval = 20; uint32_t slidermaxval = 20;
char lcd_status_message[30] = WELCOME_MSG; // worst case is kana with up to 3*LCD_WIDTH+1 char lcd_status_message[30] = WELCOME_MSG;
uint8_t lcd_status_message_level = 0; uint8_t lcd_status_message_level = 0;
static millis_t next_lcd_update_ms; static millis_t next_lcd_update_ms;
#if ENABLED(NEXTION_GFX) #if ENABLED(NEXTION_GFX)
GFX gfx = GFX(200, 190); GFX gfx = GFX(196, 194);
#endif #endif
// Page // Page
...@@ -39,10 +41,10 @@ ...@@ -39,10 +41,10 @@
NexPage Pmove = NexPage(6, 0, "move"); NexPage Pmove = NexPage(6, 0, "move");
// Text // Text
NexText Hotend0 = NexText(1, 2, "t0"); NexText Hotend0 = NexText(1, 1, "t0");
NexText Hotend1 = NexText(1, 4, "t1"); NexText Hotend1 = NexText(1, 4, "t1");
NexText Hotend21 = NexText(1, 5, "h2"); NexText Hotend2 = NexText(1, 5, "t2");
NexText Hotend2 = NexText(1, 6, "t2"); NexText Hotend21 = NexText(1, 6, "h2");
NexText LedStatus = NexText(1, 7, "t4"); NexText LedStatus = NexText(1, 7, "t4");
NexText LedCoord = NexText(1, 8, "t5"); NexText LedCoord = NexText(1, 8, "t5");
NexText set0 = NexText(2, 2, "set0"); NexText set0 = NexText(2, 2, "set0");
...@@ -55,15 +57,15 @@ ...@@ -55,15 +57,15 @@
NexText sdfolder = NexText(4, 23, "sdfolder"); NexText sdfolder = NexText(4, 23, "sdfolder");
// Picture // Picture
NexPicture Menu = NexPicture(1, 9, "p0"); NexPicture Menu = NexPicture(1, 10, "p0");
NexPicture MSD = NexPicture(1, 10, "p1"); NexPicture MSD = NexPicture(1, 11, "p1");
NexPicture MSetup = NexPicture(1, 11, "p2"); NexPicture MSetup = NexPicture(1, 12, "p2");
NexPicture Hend0 = NexPicture(1, 12, "p3"); NexPicture Hend0 = NexPicture(1, 13, "p3");
NexPicture Hend1 = NexPicture(1, 14, "p4"); NexPicture Hend1 = NexPicture(1, 14, "p4");
NexPicture Hend2 = NexPicture(1, 16, "p5"); NexPicture Hend2 = NexPicture(1, 15, "p5");
NexPicture Fanpic = NexPicture(1, 18, "p6"); NexPicture Fanpic = NexPicture(1, 19, "p6");
NexPicture NPlay = NexPicture(1, 24, "p7"); NexPicture NPlay = NexPicture(1, 27, "p7");
NexPicture NStop = NexPicture(1, 25, "p8"); NexPicture NStop = NexPicture(1, 28, "p8");
NexPicture Exit1 = NexPicture(3, 4, "p3"); NexPicture Exit1 = NexPicture(3, 4, "p3");
NexPicture Folder0 = NexPicture(4, 9, "p0"); NexPicture Folder0 = NexPicture(4, 9, "p0");
NexPicture Folder1 = NexPicture(4, 10, "p1"); NexPicture Folder1 = NexPicture(4, 10, "p1");
...@@ -84,29 +86,32 @@ ...@@ -84,29 +86,32 @@
NexPicture ZDown = NexPicture(6, 12, "p11"); NexPicture ZDown = NexPicture(6, 12, "p11");
// Progress Bar // Progress Bar
NexProgressBar sdbar = NexProgressBar(1, 23, "j0"); NexProgressBar sdbar = NexProgressBar(1, 26, "j0");
// Slider // Slider
NexSlider sdlist = NexSlider(4, 1, "h0"); NexSlider sdlist = NexSlider(4, 1, "h0");
// Wafeform // Wafeform
NexWaveform Graph0 = NexWaveform(1, 9, "s0");
NexWaveform Graph1 = NexWaveform(1, 24, "s1");
NexWaveform Graph2 = NexWaveform(1, 25, "s2");
// Touch area // Touch area
NexHotspot hot0 = NexHotspot(1, 13, "hot0"); NexHotspot hot0 = NexHotspot(1, 14, "hot0");
NexHotspot hot1 = NexHotspot(1, 15, "hot1"); NexHotspot hot1 = NexHotspot(1, 16, "hot1");
NexHotspot hot2 = NexHotspot(1, 17, "hot2"); NexHotspot hot2 = NexHotspot(1, 18, "hot2");
NexHotspot m11 = NexHotspot(2, 14, "m11"); NexHotspot m11 = NexHotspot(2, 14, "m11");
NexHotspot tup = NexHotspot(2, 16, "tup"); NexHotspot tup = NexHotspot(2, 16, "tup");
NexHotspot tdown = NexHotspot(2, 17, "tdown"); NexHotspot tdown = NexHotspot(2, 17, "tdown");
// Timer // Timer
NexTimer startimer = NexTimer(0, 1, "tm0"); NexTimer startimer = NexTimer(0, 1, "tm0");
NexTimer fantimer = NexTimer(1, 22, "tm0"); NexTimer fantimer = NexTimer(1, 23, "tm0");
// Variable // Variable
NexVar Hotend = NexVar(1, 19, "he"); NexVar Hotend = NexVar(1, 20, "he");
NexVar Bed = NexVar(1, 20, "bed");
NexVar set1 = NexVar(2, 17, "set1"); NexVar set1 = NexVar(2, 17, "set1");
NexVar Bed = NexVar(1, 21, "bed");
NexVar filename0 = NexVar(4, 19, "va0"); NexVar filename0 = NexVar(4, 19, "va0");
NexVar filename1 = NexVar(4, 20, "va1"); NexVar filename1 = NexVar(4, 20, "va1");
NexVar filename2 = NexVar(4, 21, "va2"); NexVar filename2 = NexVar(4, 21, "va2");
...@@ -160,6 +165,14 @@ ...@@ -160,6 +165,14 @@
NULL NULL
}; };
NexWaveform *graph_list[] =
{
&Graph0,
&Graph1,
&Graph2,
NULL
};
NexText *row_list[] = NexText *row_list[] =
{ {
&sdrow0, &sdrow0,
...@@ -198,10 +211,6 @@ ...@@ -198,10 +211,6 @@
PageInfo = true; PageInfo = true;
#if ENABLED(NEXTION_GFX)
gfx_clear(X_MAX_POS, Y_MAX_POS, Z_MAX_POS);
#endif
#if HAS_TEMP_0 #if HAS_TEMP_0
Hotend.setValue(1); Hotend.setValue(1);
#endif #endif
...@@ -269,6 +278,7 @@ ...@@ -269,6 +278,7 @@
static void setpagesdcard() { static void setpagesdcard() {
PageInfo = false; PageInfo = false;
gfxON = false;
Psdcard.show(); Psdcard.show();
uint16_t fileCnt = card.getnrfilenames(); uint16_t fileCnt = card.getnrfilenames();
...@@ -426,10 +436,12 @@ ...@@ -426,10 +436,12 @@
void setpagePopCallback(void *ptr) { void setpagePopCallback(void *ptr) {
if (ptr == &Menu) { if (ptr == &Menu) {
PageInfo = false; PageInfo = false;
gfxON = false;
Pmenu.show(); Pmenu.show();
} }
else if (ptr == &MSetup) { else if (ptr == &MSetup) {
PageInfo = false; PageInfo = false;
gfxON = false;
Psetup.show(); Psetup.show();
} }
...@@ -549,6 +561,11 @@ ...@@ -549,6 +561,11 @@
hotend_list[h]->setText(buffer); hotend_list[h]->setText(buffer);
hotend_list[h]->setColor(color); hotend_list[h]->setColor(color);
if (!gfxON) {
graph_list[h]->addValue(0, (int)(T1 * MaxWave));
graph_list[h]->addValue(1, (int)(T2 * MaxWave));
}
} }
static void coordtoLCD() { static void coordtoLCD() {
...@@ -661,17 +678,19 @@ ...@@ -661,17 +678,19 @@
#if ENABLED(NEXTION_GFX) #if ENABLED(NEXTION_GFX)
void gfx_clear(float x, float y, float z) { void gfx_clear(float x, float y, float z) {
if (PageInfo) if (PageInfo) {
gfx.clear(x, y, z); gfx.clear(x, y, z);
gfxON = true;
}
} }
void gfx_cursor_to(float x, float y, float z) { void gfx_cursor_to(float x, float y, float z) {
if (PageInfo) if (PageInfo && gfxON)
gfx.cursor_to(x, y, z); gfx.cursor_to(x, y, z);
} }
void gfx_line_to(float x, float y, float z){ void gfx_line_to(float x, float y, float z){
if (PageInfo) if (PageInfo && gfxON)
gfx.line_to(VC_TOOL, x, y, z); gfx.line_to(VC_TOOL, x, y, z);
} }
#endif #endif
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
*/ */
#include "base.h" #include "../base.h"
#if HAS(SERVOS) #if HAS(SERVOS)
#include "servo.h" #include "servo.h"
......
...@@ -472,15 +472,21 @@ ...@@ -472,15 +472,21 @@
#if DISABLED(Z_ENDSTOP_SERVO_NR) #if DISABLED(Z_ENDSTOP_SERVO_NR)
#error DEPENDENCY ERROR: Missing setting Z_ENDSTOP_SERVO_NR #error DEPENDENCY ERROR: Missing setting Z_ENDSTOP_SERVO_NR
#endif #endif
#if ENABLED(X_ENDSTOP_SERVO_NR) && X_ENDSTOP_SERVO_NR > -1
#if DISABLED(X_ENDSTOP_SERVO_ANGLES) #if DISABLED(X_ENDSTOP_SERVO_ANGLES)
#error DEPENDENCY ERROR: Missing setting X_ENDSTOP_SERVO_ANGLES #error DEPENDENCY ERROR: Missing setting X_ENDSTOP_SERVO_ANGLES
#endif #endif
#endif
#if ENABLED(Y_ENDSTOP_SERVO_NR) && Y_ENDSTOP_SERVO_NR > -1
#if DISABLED(Y_ENDSTOP_SERVO_ANGLES) #if DISABLED(Y_ENDSTOP_SERVO_ANGLES)
#error DEPENDENCY ERROR: Missing setting Y_ENDSTOP_SERVO_ANGLES #error DEPENDENCY ERROR: Missing setting Y_ENDSTOP_SERVO_ANGLES
#endif #endif
#endif
#if ENABLED(Z_ENDSTOP_SERVO_NR) && Z_ENDSTOP_SERVO_NR > -1
#if DISABLED(Z_ENDSTOP_SERVO_ANGLES) #if DISABLED(Z_ENDSTOP_SERVO_ANGLES)
#error DEPENDENCY ERROR: Missing setting Z_ENDSTOP_SERVO_ANGLES #error DEPENDENCY ERROR: Missing setting Z_ENDSTOP_SERVO_ANGLES
#endif #endif
#endif
#if DISABLED(SERVO_DEACTIVATION_DELAY) #if DISABLED(SERVO_DEACTIVATION_DELAY)
#error DEPENDENCY ERROR: Missing setting SERVO_DEACTIVATION_DELAY #error DEPENDENCY ERROR: Missing setting SERVO_DEACTIVATION_DELAY
#endif #endif
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#include "stepper.h" #include "stepper.h"
#include "temperature.h" #include "temperature.h"
#include "ultralcd.h" #include "ultralcd.h"
#include "nextion/nextion_lcd.h" #include "module/nextion_lcd.h"
#if ENABLED(SDSUPPORT) #if ENABLED(SDSUPPORT)
#include "cardreader.h" #include "cardreader.h"
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "vector_3.h" #include "vector_3.h"
#endif #endif
#include "ultralcd.h" #include "ultralcd.h"
#include "nextion/nextion_lcd.h" #include "module/nextion_lcd.h"
#include "planner.h" #include "planner.h"
#include "stepper_indirection.h" #include "stepper_indirection.h"
#if MB(ALLIGATOR) #if MB(ALLIGATOR)
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include "ultralcd.h" #include "ultralcd.h"
#if HAS(BUZZER) #if HAS(BUZZER)
#include "buzzer.h" #include "module/buzzer.h"
#endif #endif
int8_t encoderDiff; // updated from interrupt context and added to encoderPosition every LCD update int8_t encoderDiff; // updated from interrupt context and added to encoderPosition every LCD update
......
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
#include "Marlin_main.h" #include "Marlin_main.h"
#if ENABLED(ULTRA_LCD) #if ENABLED(ULTRA_LCD)
#include "buzzer.h" #if HAS(BUZZER)
#include "module/buzzer.h"
#endif
int lcd_strlen(char* s); int lcd_strlen(char* s);
int lcd_strlen_P(const char* s); int lcd_strlen_P(const char* s);
......
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