Prusa MINI Firmware overview
SanityCheck.h File Reference

Go to the source code of this file.

Macros

#define HEXIFY(H)   _CAT(0x,H)
 
#define BOARD_MKS_13   -1000
 
#define BOARD_TRIGORILLA   -1001
 
#define BOARD_RURAMPS4D   -1002
 
#define BOARD_FORMBOT_TREX2   -1003
 
#define BOARD_BIQU_SKR_V1_1   -1004
 
#define BOARD_STM32F1R   -1005
 
#define BOARD_STM32F103R   -1006
 
#define BOARD_ESP32   -1007
 
#define _PLUG_UNUSED_TEST(AXIS, PLUG)   (DISABLED(USE_##PLUG##MIN_PLUG, USE_##PLUG##MAX_PLUG) && !(ENABLED(AXIS##_DUAL_ENDSTOPS) && WITHIN(AXIS##2_USE_ENDSTOP, _##PLUG##MAX_, _##PLUG##MIN_)))
 
#define _AXIS_PLUG_UNUSED_TEST(AXIS)   (_PLUG_UNUSED_TEST(AXIS,X) && _PLUG_UNUSED_TEST(AXIS,Y) && _PLUG_UNUSED_TEST(AXIS,Z))
 
#define _RGB_TEST   (PIN_EXISTS(RGB_LED_R, RGB_LED_G, RGB_LED_B))
 
#define INVALID_TMC_SPI(ST)   (AXIS_HAS_SPI && !PIN_EXISTS(ST##_CS))
 
#define INVALID_TMC_UART(ST)   (AXIS_HAS_UART(ST) && !(defined(ST##_HARDWARE_SERIAL) || (PIN_EXISTS(ST##_SERIAL_RX, ST##_SERIAL_TX))))
 
#define INVALID_TMC_ADDRESS(ST)   static_assert(0 <= ST##_SLAVE_ADDRESS && ST##_SLAVE_ADDRESS <= 3, "TMC2209 slave address must be 0, 1, 2 or 3")
 
#define IN_CHAIN(A)   (A##_CHAIN_POS > 0)
 
#define _ARR_TEST(N, I)   (sanity_arr_##N[_MIN(I,int(COUNT(sanity_arr_##N))-1)] > 0)
 

Variables

constexpr float sanity_arr_1 [] = DEFAULT_AXIS_STEPS_PER_UNIT
 
constexpr float sanity_arr_2 [] = DEFAULT_MAX_FEEDRATE
 
constexpr float sanity_arr_3 [] = DEFAULT_MAX_ACCELERATION
 

Macro Definition Documentation

◆ HEXIFY

#define HEXIFY (   H)    _CAT(0x,H)

Marlin 3D Printer Firmware Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]

Based on Sprinter and grbl. Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. SanityCheck.h

Test configuration values for errors at compile-time. Require gcc 4.7 or newer (first included with Arduino 1.6.8) for C++11 features. We try our best to include sanity checks for all changed configuration directives because users have a tendency to use outdated config files with the bleeding-edge source code, but sometimes this is not enough. This check forces a minimum config file revision. Otherwise Marlin will not build.

◆ BOARD_MKS_13

#define BOARD_MKS_13   -1000

Warnings for old configurations

◆ BOARD_TRIGORILLA

#define BOARD_TRIGORILLA   -1001

◆ BOARD_RURAMPS4D

#define BOARD_RURAMPS4D   -1002

◆ BOARD_FORMBOT_TREX2

#define BOARD_FORMBOT_TREX2   -1003

◆ BOARD_BIQU_SKR_V1_1

#define BOARD_BIQU_SKR_V1_1   -1004

◆ BOARD_STM32F1R

#define BOARD_STM32F1R   -1005

◆ BOARD_STM32F103R

#define BOARD_STM32F103R   -1006

◆ BOARD_ESP32

#define BOARD_ESP32   -1007

◆ _PLUG_UNUSED_TEST

#define _PLUG_UNUSED_TEST (   AXIS,
  PLUG 
)    (DISABLED(USE_##PLUG##MIN_PLUG, USE_##PLUG##MAX_PLUG) && !(ENABLED(AXIS##_DUAL_ENDSTOPS) && WITHIN(AXIS##2_USE_ENDSTOP, _##PLUG##MAX_, _##PLUG##MIN_)))

Marlin release, version and default string Serial Dual / Triple Stepper Drivers Validate that the bed size fits Granular software endstops (Marlin >= 1.1.7) LCD Info Screen Style Progress Bar Custom Boot and Status screens LCD Lightweight Screen Style SD File Sorting I2C Position Encoders Babystepping Filament Runout needs one or more pins and either SD Support or Auto print start detection Advanced Pause Individual axis homing is useless for DELTAS Options only for EXTRUDERS > 1 Sanity checking for the Průša MK2 Multiplexer A Dual Nozzle carriage with switching servo Single Stepper Dual Extruder with switching servo Mixing Extruder requirements Linear Advance 1.5 - Check K value range Special tool-changing options (Magnetic) Parking Extruder requirements Switching Toolhead requirements (Electro)magnetic Switching Toolhead requirements Part-Cooling Fan Multiplexer requirements Limited number of servos Servo deactivation depends on servo endstops, switching nozzle, or switching extruder Required LCD language Bed Heating Options - PID vs Limit Switching Kinematics Allow only one kinematic type to be defined Delta requirements Junction deviation is incompatible with kinematic systems. Probes Allow only one probe option to be defined Require some kind of probe for bed leveling and probe testing Allow only one bed leveling option to be defined Bed Leveling Requirements LCD_BED_LEVELING requirements Homing Make sure Z_SAFE_HOMING point is reachable Make sure DISABLE_[XYZ] compatible with selected homing options Filament Width Sensor ULTIPANEL encoder SAV_3DGLCD display options Allen Key Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis. Dual X Carriage requirements Make sure auto fan pins don't conflict with the fan pin Case Light requirements Required custom thermistor settings Test Heater, Temp Sensor, and Extruder Pins; Sensor Type must also be set. Temperature status LEDs LED Control Menu LED Backlight Timeout Basic multi hotend duplication mode Test Extruder Stepper Pins Endstop Tests

◆ _AXIS_PLUG_UNUSED_TEST

#define _AXIS_PLUG_UNUSED_TEST (   AXIS)    (_PLUG_UNUSED_TEST(AXIS,X) && _PLUG_UNUSED_TEST(AXIS,Y) && _PLUG_UNUSED_TEST(AXIS,Z))

◆ _RGB_TEST

#define _RGB_TEST   (PIN_EXISTS(RGB_LED_R, RGB_LED_G, RGB_LED_B))

emergency-command parser I2C bus G38 Probe Target RGB_LED Requirements

◆ INVALID_TMC_SPI

#define INVALID_TMC_SPI (   ST)    (AXIS_HAS_SPI && !PIN_EXISTS(ST##_CS))

Auto Fan check for PWM pins Make sure only one display is enabled FYSETC Mini 12864 RGB backlighting required Check existing CS pins against enabled TMC SPI drivers.

◆ INVALID_TMC_UART

#define INVALID_TMC_UART (   ST)    (AXIS_HAS_UART(ST) && !(defined(ST##_HARDWARE_SERIAL) || (PIN_EXISTS(ST##_SERIAL_RX, ST##_SERIAL_TX))))

Check existing RX/TX pins against enable TMC UART drivers.

◆ INVALID_TMC_ADDRESS

#define INVALID_TMC_ADDRESS (   ST)    static_assert(0 <= ST##_SLAVE_ADDRESS && ST##_SLAVE_ADDRESS <= 3, "TMC2209 slave address must be 0, 1, 2 or 3")

TMC2209 slave address values

◆ IN_CHAIN

#define IN_CHAIN (   A)    (A##_CHAIN_POS > 0)

TMC2208/2209 software UART and ENDSTOP_INTERRUPTS both use pin change interrupts (PCI) TMC2208/2209 software UART is only supported on AVR, LPC, STM32F1 and STM32F4

◆ _ARR_TEST

#define _ARR_TEST (   N,
 
)    (sanity_arr_##N[_MIN(I,int(COUNT(sanity_arr_##N))-1)] > 0)

Variable Documentation

◆ sanity_arr_1

constexpr float sanity_arr_1[] = DEFAULT_AXIS_STEPS_PER_UNIT
constexpr

Digipot requirement Check per-axis initializers for errors

◆ sanity_arr_2

constexpr float sanity_arr_2[] = DEFAULT_MAX_FEEDRATE
constexpr

◆ sanity_arr_3

constexpr float sanity_arr_3[] = DEFAULT_MAX_ACCELERATION
constexpr