Apply #pragma once, misc cleanup (#12322)

* Apply #pragma once in headers
* Adjust some thermistors formatting
* Misc cleanup and formatting
This commit is contained in:
Scott Lahteine
2018-11-04 02:25:55 -06:00
committed by GitHub
parent 8696f882a9
commit f5eab912ed
179 changed files with 710 additions and 1343 deletions

View File

@ -19,9 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef CONFIGURATION_STORE_H
#define CONFIGURATION_STORE_H
#pragma once
#include "../inc/MarlinConfig.h"
@ -120,5 +118,3 @@ extern MarlinSettings settings;
#undef PORTINIT_SOLO
#undef PORTINIT_AFTER
#endif // CONFIGURATION_STORE_H

View File

@ -19,14 +19,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
/**
* endstops.h - manages endstops
*/
#ifndef __ENDSTOPS_H__
#define __ENDSTOPS_H__
#include "../inc/MarlinConfig.h"
#include <stdint.h>
@ -173,5 +171,3 @@ class Endstops {
};
extern Endstops endstops;
#endif // __ENDSTOPS_H__

View File

@ -19,6 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
/**
* planner_bezier.h
@ -27,10 +28,8 @@
*
*/
#ifndef PLANNER_BEZIER_H
#define PLANNER_BEZIER_H
#include "../inc/MarlinConfig.h"
#include <stdint.h>
#include "../core/macros.h"
void cubic_b_spline(
const float position[NUM_AXIS], // current position
@ -39,5 +38,3 @@ void cubic_b_spline(
float fr_mm_s,
uint8_t extruder
);
#endif // PLANNER_BEZIER_H

View File

@ -19,9 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef PRINTCOUNTER_H
#define PRINTCOUNTER_H
#pragma once
#include "../libs/stopwatch.h"
#include "../libs/duration_t.h"
@ -193,5 +191,3 @@ class PrintCounter: public Stopwatch {
#else
extern Stopwatch print_job_timer;
#endif
#endif // PRINTCOUNTER_H

View File

@ -19,14 +19,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
/**
* probe.h - Move, deploy, enable, etc.
*/
#ifndef PROBE_H
#define PROBE_H
#include "../inc/MarlinConfig.h"
#if HAS_BED_PROBE
@ -73,5 +71,3 @@
set_bltouch_deployed(false);
}
#endif
#endif // PROBE_H

View File

@ -19,14 +19,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
/**
* module/servo.h
*/
#ifndef _SERVO_H_
#define _SERVO_H_
#include "../inc/MarlinConfig.h"
#include "../HAL/shared/servo.h"
@ -40,5 +38,3 @@ extern void servo_init();
#define DEPLOY_Z_SERVO() MOVE_SERVO(Z_PROBE_SERVO_NR, servo_angles[Z_PROBE_SERVO_NR][0])
#define STOW_Z_SERVO() MOVE_SERVO(Z_PROBE_SERVO_NR, servo_angles[Z_PROBE_SERVO_NR][1])
#endif
#endif // _SERVO_H_

View File

@ -19,9 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef SPEED_LOOKUPTABLE_H
#define SPEED_LOOKUPTABLE_H
#pragma once
#if F_CPU == 16000000
@ -168,5 +166,3 @@
};
#endif
#endif // SPEED_LOOKUPTABLE_H

View File

@ -19,6 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
/**
* stepper.h - stepper motor driver: executes motion plans of planner.c using the stepper motors
@ -40,9 +41,6 @@
* along with Grbl. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef STEPPER_H
#define STEPPER_H
#include "../inc/MarlinConfig.h"
// Disable multiple steps per ISR
@ -559,5 +557,3 @@ class Stepper {
};
extern Stepper stepper;
#endif // STEPPER_H

View File

@ -19,6 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
/**
* stepper_indirection.h - stepper motor driver indirection macros
@ -41,9 +42,6 @@
* along with Marlin. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef STEPPER_INDIRECTION_H
#define STEPPER_INDIRECTION_H
#include "../inc/MarlinConfig.h"
// TMC26X drivers have STEP/DIR on normal pins, but ENABLE via SPI
@ -615,5 +613,3 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset
#define NORM_E_DIR(E) E0_DIR_WRITE(!INVERT_E0_DIR)
#define REV_E_DIR(E) E0_DIR_WRITE( INVERT_E0_DIR)
#endif
#endif // STEPPER_INDIRECTION_H

View File

@ -19,14 +19,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
/**
* temperature.h - temperature controller
*/
#ifndef TEMPERATURE_H
#define TEMPERATURE_H
#include "thermistor/thermistors.h"
#include "../inc/MarlinConfig.h"
@ -660,5 +658,3 @@ class Temperature {
};
extern Temperature thermalManager;
#endif // TEMPERATURE_H

View File

@ -22,17 +22,17 @@
// Pt1000 with 1k0 pullup
const short temptable_1010[][2] PROGMEM = {
PtLine( 0, 1000, 1000)
PtLine( 25, 1000, 1000)
PtLine( 50, 1000, 1000)
PtLine( 75, 1000, 1000)
PtLine(100, 1000, 1000)
PtLine(125, 1000, 1000)
PtLine(150, 1000, 1000)
PtLine(175, 1000, 1000)
PtLine(200, 1000, 1000)
PtLine(225, 1000, 1000)
PtLine(250, 1000, 1000)
PtLine(275, 1000, 1000)
PtLine( 0, 1000, 1000),
PtLine( 25, 1000, 1000),
PtLine( 50, 1000, 1000),
PtLine( 75, 1000, 1000),
PtLine(100, 1000, 1000),
PtLine(125, 1000, 1000),
PtLine(150, 1000, 1000),
PtLine(175, 1000, 1000),
PtLine(200, 1000, 1000),
PtLine(225, 1000, 1000),
PtLine(250, 1000, 1000),
PtLine(275, 1000, 1000),
PtLine(300, 1000, 1000)
};

View File

@ -23,11 +23,11 @@
// Pt1000 with 4k7 pullup
const short temptable_1047[][2] PROGMEM = {
// only a few values are needed as the curve is very flat
PtLine( 0, 1000, 4700)
PtLine( 50, 1000, 4700)
PtLine(100, 1000, 4700)
PtLine(150, 1000, 4700)
PtLine(200, 1000, 4700)
PtLine(250, 1000, 4700)
PtLine( 0, 1000, 4700),
PtLine( 50, 1000, 4700),
PtLine(100, 1000, 4700),
PtLine(150, 1000, 4700),
PtLine(200, 1000, 4700),
PtLine(250, 1000, 4700),
PtLine(300, 1000, 4700)
};

View File

@ -23,11 +23,11 @@
// Pt100 with 1k0 pullup
const short temptable_110[][2] PROGMEM = {
// only a few values are needed as the curve is very flat
PtLine( 0, 100, 1000)
PtLine( 50, 100, 1000)
PtLine(100, 100, 1000)
PtLine(150, 100, 1000)
PtLine(200, 100, 1000)
PtLine(250, 100, 1000)
PtLine( 0, 100, 1000),
PtLine( 50, 100, 1000),
PtLine(100, 100, 1000),
PtLine(150, 100, 1000),
PtLine(200, 100, 1000),
PtLine(250, 100, 1000),
PtLine(300, 100, 1000)
};

View File

@ -23,11 +23,11 @@
// Pt100 with 4k7 pullup
const short temptable_147[][2] PROGMEM = {
// only a few values are needed as the curve is very flat
PtLine( 0, 100, 4700)
PtLine( 50, 100, 4700)
PtLine(100, 100, 4700)
PtLine(150, 100, 4700)
PtLine(200, 100, 4700)
PtLine(250, 100, 4700)
PtLine( 0, 100, 4700),
PtLine( 50, 100, 4700),
PtLine(100, 100, 4700),
PtLine(150, 100, 4700),
PtLine(200, 100, 4700),
PtLine(250, 100, 4700),
PtLine(300, 100, 4700)
};

View File

@ -19,9 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef THERMISTORS_H_
#define THERMISTORS_H_
#pragma once
#include "../../inc/MarlinConfig.h"
@ -36,9 +34,9 @@
// a=3.9083E-3, b=-5.775E-7
#define PtA 3.9083E-3
#define PtB -5.775E-7
#define PtRt(T,R0) ((R0)*(1.0+(PtA)*(T)+(PtB)*(T)*(T)))
#define PtAdVal(T,R0,Rup) (short)(1024/(Rup/PtRt(T,R0)+1))
#define PtLine(T,R0,Rup) { OV(PtAdVal(T,R0,Rup)), T },
#define PtRt(T,R0) ((R0) * (1.0 + (PtA) * (T) + (PtB) * (T) * (T)))
#define PtAdVal(T,R0,Rup) (short)(1024 / (Rup / PtRt(T, R0) + 1))
#define PtLine(T,R0,Rup) { OV(PtAdVal(T, R0, Rup)), T }
#if ANY_THERMISTOR_IS(1) // beta25 = 4092 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "EPCOS"
#include "thermistor_1.h"
@ -276,5 +274,3 @@ static_assert(HEATER_0_TEMPTABLE_LEN < 256 && HEATER_1_TEMPTABLE_LEN < 256 && HE
#define HEATER_CHAMBER_RAW_LO_TEMP 0
#endif
#endif
#endif // THERMISTORS_H_