From 342954b88ce5f95f1a04d1b9a720ffecf71cbfb0 Mon Sep 17 00:00:00 2001
From: Marek Bel <marek.bel@posta.cz>
Date: Wed, 12 Jun 2019 13:31:17 +0200
Subject: [PATCH] Refactor. Make constants producing first layer calibration
 square more clear. Note layer height discrepancy.

---
 Firmware/first_lay_cal.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Firmware/first_lay_cal.cpp b/Firmware/first_lay_cal.cpp
index c539ebda..32eb4370 100644
--- a/Firmware/first_lay_cal.cpp
+++ b/Firmware/first_lay_cal.cpp
@@ -173,7 +173,8 @@ static constexpr float count_e(float layer_heigth, float extrusion_width, float
 
 static const float width = 0.4;
 static const float length = 20 - width;
-static const float extr = count_e(0.2, width, length);
+static const float heigth = 0.2; //!< TODO This is wrong, as current Z height is 0.15 mm
+static const float extr = count_e(heigth, width, length);
 
 void lay1cal_meander(char *cmd_buffer)
 {
@@ -193,7 +194,7 @@ void lay1cal_meander(char *cmd_buffer)
 //! @par i iteration
 void lay1cal_square(char *cmd_buffer, uint8_t i)
 {
-    const float extr_short_segment = count_e(0.2, width, width);
+    const float extr_short_segment = count_e(heigth, width, width);
 
     static const char fmt1[] PROGMEM = "G1 X%d Y%-.2f E%-.3f";
     static const char fmt2[] PROGMEM = "G1 Y%-.2f E%-.3f";