Skip to content

Commit

Permalink
validate just once
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Apr 23, 2023
1 parent 2c325e5 commit 8530fee
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 20 deletions.
5 changes: 4 additions & 1 deletion Marlin/src/pins/esp32/env_validate.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
#ifndef ENV_VALIDATE_H
#define ENV_VALIDATE_H

#if NOT_TARGET(ARDUINO_ARCH_ESP32)
#error "Oops! Select an ESP32 board in 'Tools > Board.'"
#endif

#endif
11 changes: 4 additions & 7 deletions Marlin/src/pins/gd32f1/env_validate.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
#ifndef ENV_VALIDATE_H
#define ENV_VALIDATE_H

#if NOT_TARGET(__STM32F1__, STM32F1)
#if DISABLED(ALLOW_STM32F4)
#error "Oops! Select an STM32F1 board in 'Tools > Board.'"
#elif NOT_TARGET(STM32F4)
#error "Oops! Select an STM32F4 board in 'Tools > Board.'"
#endif
#error "Oops! Select an STM32F1 board in 'Tools > Board.'"
#endif

#undef ALLOW_STM32F4
#endif
5 changes: 4 additions & 1 deletion Marlin/src/pins/lpc1768/env_validate.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
#ifndef ENV_VALIDATE_H
#define ENV_VALIDATE_H

#if ENABLED(REQUIRE_LPC1769) && NOT_TARGET(MCU_LPC1769)
#error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
Expand All @@ -28,3 +29,5 @@
#endif

#undef REQUIRE_LPC1769

#endif
5 changes: 4 additions & 1 deletion Marlin/src/pins/lpc1769/env_validate.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
#ifndef ENV_VALIDATE_H
#define ENV_VALIDATE_H

#if NOT_TARGET(MCU_LPC1769)
#error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
#endif

#endif
5 changes: 4 additions & 1 deletion Marlin/src/pins/mega/env_validate.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
#ifndef ENV_VALIDATE_H
#define ENV_VALIDATE_H

#if NOT_TARGET(__AVR_ATmega2560__)
#if DISABLED(ALLOW_MEGA1280)
Expand All @@ -30,3 +31,5 @@
#endif

#undef ALLOW_MEGA1280

#endif
5 changes: 4 additions & 1 deletion Marlin/src/pins/rambo/env_validate.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
#ifndef ENV_VALIDATE_H
#define ENV_VALIDATE_H

#if NOT_TARGET(__AVR_ATmega2560__)
#error "Oops! Select 'Arduino Mega 2560 or Rambo' in 'Tools > Board.'"
#endif

#endif
5 changes: 4 additions & 1 deletion Marlin/src/pins/ramps/env_validate.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
#ifndef ENV_VALIDATE_H
#define ENV_VALIDATE_H

#if ENABLED(ALLOW_SAM3X8E)
#if NOT_TARGET(__SAM3X8E__, __AVR_ATmega2560__)
Expand All @@ -33,3 +34,5 @@

#undef ALLOW_SAM3X8E
#undef REQUIRE_MEGA2560

#endif
5 changes: 4 additions & 1 deletion Marlin/src/pins/sam/env_validate.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
#ifndef ENV_VALIDATE_H
#define ENV_VALIDATE_H

#if BOTH(ALLOW_MEGA1280, ALLOW_MEGA2560) && NOT_TARGET(__SAM3X8E__, __AVR_ATmega1280__, __AVR_ATmega2560__)
#error "Oops! Select 'Arduino Due or Mega' in 'Tools > Board.'"
Expand All @@ -31,3 +32,5 @@

#undef ALLOW_MEGA1280
#undef ALLOW_MEGA2560

#endif
5 changes: 4 additions & 1 deletion Marlin/src/pins/sanguino/env_validate.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
#ifndef ENV_VALIDATE_H
#define ENV_VALIDATE_H

#if ENABLED(ALLOW_MEGA644)
#if NOT_TARGET(__AVR_ATmega644__, __AVR_ATmega644P__, __AVR_ATmega1284P__)
Expand All @@ -40,3 +41,5 @@
#undef ALLOW_MEGA644
#undef ALLOW_MEGA644P
#undef REQUIRE_MEGA644P

#endif
5 changes: 4 additions & 1 deletion Marlin/src/pins/stm32f1/env_validate.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
#ifndef ENV_VALIDATE_H
#define ENV_VALIDATE_H

#if NOT_TARGET(__STM32F1__, STM32F1)
#if DISABLED(ALLOW_STM32F4)
Expand All @@ -30,3 +31,5 @@
#endif

#undef ALLOW_STM32F4

#endif
5 changes: 4 additions & 1 deletion Marlin/src/pins/stm32f4/env_validate.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
#ifndef ENV_VALIDATE_H
#define ENV_VALIDATE_H

#if NOT_TARGET(STM32F4) && (DISABLED(ALLOW_STM32DUINO) || NOT_TARGET(STM32F4xx))
#error "Oops! Select an STM32F4 board in 'Tools > Board.'"
#endif

#undef ALLOW_STM32DUINO

#endif
5 changes: 4 additions & 1 deletion Marlin/src/pins/stm32g0/env_validate.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
#ifndef ENV_VALIDATE_H
#define ENV_VALIDATE_H

#if NOT_TARGET(STM32G0xx) || NOT_TARGET(STM32G0B1xx)
#error "Oops! Select an STM32G0 board in 'Tools > Board.'"
#endif

#endif
5 changes: 4 additions & 1 deletion Marlin/src/pins/stm32h7/env_validate.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
#ifndef ENV_VALIDATE_H
#define ENV_VALIDATE_H

#if NOT_TARGET(STM32H7)
#error "Oops! Select an STM32H7 board in 'Tools > Board.'"
#endif

#endif
5 changes: 4 additions & 1 deletion Marlin/src/pins/teensy2/env_validate.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
#ifndef ENV_VALIDATE_H
#define ENV_VALIDATE_H

#if NOT_TARGET(__AVR_AT90USB1286__) && (DISABLED(ALLOW_AT90USB1286P) || NOT_TARGET(__AVR_AT90USB1286P__))
#error "Oops! Select 'Teensy++ 2.0' or 'Printrboard' in 'Tools > Board.'"
#endif

#undef ALLOW_AT90USB1286P

#endif

0 comments on commit 8530fee

Please sign in to comment.