Apply TERN to compact code (#17619)
This commit is contained in:
@ -211,11 +211,7 @@ void HardFault_HandlerC(unsigned long *sp, unsigned long lr, unsigned long cause
|
||||
|
||||
// Nothing below here is compiled because NVIC_SystemReset loops forever
|
||||
|
||||
for (;;) {
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
watchdog_init();
|
||||
#endif
|
||||
}
|
||||
for (;;) { TERN_(USE_WATCHDOG, watchdog_init()); }
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
|
@ -70,9 +70,7 @@ int16_t PARSED_PIN_INDEX(const char code, const int16_t dval) {
|
||||
void flashFirmware(const int16_t) { NVIC_SystemReset(); }
|
||||
|
||||
void HAL_clear_reset_source(void) {
|
||||
#if ENABLED(USE_WATCHDOG)
|
||||
watchdog_clear_timeout_flag();
|
||||
#endif
|
||||
TERN_(USE_WATCHDOG, watchdog_clear_timeout_flag());
|
||||
}
|
||||
|
||||
uint8_t HAL_get_reset_source(void) {
|
||||
|
@ -44,10 +44,9 @@ public:
|
||||
MarlinSerial(LPC_UART_TypeDef *UARTx) :
|
||||
HardwareSerial<RX_BUFFER_SIZE, TX_BUFFER_SIZE>(UARTx)
|
||||
#if ENABLED(EMERGENCY_PARSER)
|
||||
, emergency_state(EmergencyParser::State::EP_RESET)
|
||||
, emergency_state(EmergencyParser::State::EP_RESET)
|
||||
#endif
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
void end() {}
|
||||
|
||||
|
@ -60,9 +60,7 @@ class libServo: public Servo {
|
||||
if (attach(servo_info[servoIndex].Pin.nbr) >= 0) { // try to reattach
|
||||
write(value);
|
||||
safe_delay(servo_delay[servoIndex]); // delay to allow servo to reach position
|
||||
#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
|
||||
detach();
|
||||
#endif
|
||||
TERN_(DEACTIVATE_SERVOS_AFTER_MOVE, detach());
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user