From 6e658a7c045acc80f92c99551d81c850d8c05723 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 8 Jan 2020 20:00:06 -0600 Subject: [PATCH] Code style and comment tweaks --- Marlin/src/HAL/HAL_DUE/HAL_SPI.cpp | 2 +- Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.c | 2 +- Marlin/src/HAL/HAL_ESP32/i2s.cpp | 2 +- Marlin/src/HAL/HAL_ESP32/timers.h | 2 +- Marlin/src/HAL/HAL_LPC1768/u8g/LCD_delay.h | 4 ++-- Marlin/src/MarlinCore.cpp | 2 +- Marlin/src/module/configuration_store.cpp | 2 +- Marlin/src/module/stepper.cpp | 4 ++-- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Marlin/src/HAL/HAL_DUE/HAL_SPI.cpp b/Marlin/src/HAL/HAL_DUE/HAL_SPI.cpp index 35763a5ec..3524ae869 100644 --- a/Marlin/src/HAL/HAL_DUE/HAL_SPI.cpp +++ b/Marlin/src/HAL/HAL_DUE/HAL_SPI.cpp @@ -240,7 +240,7 @@ } // all the others - static uint32_t spiDelayCyclesX4 = (F_CPU) / 1000000; // 4uS => 125khz + static uint32_t spiDelayCyclesX4 = (F_CPU) / 1000000; // 4µs => 125khz static uint8_t spiTransferX(uint8_t b) { // using Mode 0 int bits = 8; diff --git a/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.c b/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.c index 9bac29276..2a10190c7 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.c +++ b/Marlin/src/HAL/HAL_DUE/usb/uotghs_device_due.c @@ -1479,7 +1479,7 @@ static void udd_ctrl_in_sent(void) // The IN data don't must be written in endpoint 0 DPRAM during // a next setup reception in same endpoint 0 DPRAM. // Thereby, an OUT ZLP reception must check before IN data write - // and if no OUT ZLP is recevied the data must be written quickly (800us) + // and if no OUT ZLP is received the data must be written quickly (800µs) // before an eventually ZLP OUT and SETUP reception flags = cpu_irq_save(); if (Is_udd_out_received(0)) { diff --git a/Marlin/src/HAL/HAL_ESP32/i2s.cpp b/Marlin/src/HAL/HAL_ESP32/i2s.cpp index 33a503455..7a94e1594 100644 --- a/Marlin/src/HAL/HAL_ESP32/i2s.cpp +++ b/Marlin/src/HAL/HAL_ESP32/i2s.cpp @@ -177,7 +177,7 @@ int i2s_init() { * * fwclk = fbclk / 32 * - * for fwclk = 250kHz (4uS pulse time) + * for fwclk = 250kHz (4µS pulse time) * N = 10 * M = 20 */ diff --git a/Marlin/src/HAL/HAL_ESP32/timers.h b/Marlin/src/HAL/HAL_ESP32/timers.h index e6e3495be..325ab4098 100644 --- a/Marlin/src/HAL/HAL_ESP32/timers.h +++ b/Marlin/src/HAL/HAL_ESP32/timers.h @@ -47,7 +47,7 @@ typedef uint64_t hal_timer_t; #if ENABLED(I2S_STEPPER_STREAM) #define STEPPER_TIMER_PRESCALE 1 - #define STEPPER_TIMER_RATE 250000 // 250khz, 4us pulses of i2s word clock + #define STEPPER_TIMER_RATE 250000 // 250khz, 4µs pulses of i2s word clock #define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs // wrong would be 0.25 #else #define STEPPER_TIMER_PRESCALE 40 diff --git a/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_delay.h b/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_delay.h index 8806e8747..314e20b43 100644 --- a/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_delay.h +++ b/Marlin/src/HAL/HAL_LPC1768/u8g/LCD_delay.h @@ -26,8 +26,8 @@ * * These are based on the LPC1768 routines. * - * Couldn't just call exact copies because the overhead resulted in the - * one microsecond delay being about 4uS. + * Couldn't just call exact copies because the overhead + * results in a one microsecond delay taking about 4µS. */ #ifdef __cplusplus diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 0609e785a..f58477e81 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -618,7 +618,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) { #if PIN_EXISTS(FET_SAFETY) static millis_t FET_next; if (ELAPSED(ms, FET_next)) { - FET_next = ms + FET_SAFETY_DELAY; // 2uS pulse every FET_SAFETY_DELAY mS + FET_next = ms + FET_SAFETY_DELAY; // 2µs pulse every FET_SAFETY_DELAY mS OUT_WRITE(FET_SAFETY_PIN, !FET_SAFETY_INVERTED); DELAY_US(2); WRITE(FET_SAFETY_PIN, FET_SAFETY_INVERTED); diff --git a/Marlin/src/module/configuration_store.cpp b/Marlin/src/module/configuration_store.cpp index ddea9388b..d38cbbe67 100644 --- a/Marlin/src/module/configuration_store.cpp +++ b/Marlin/src/module/configuration_store.cpp @@ -2352,7 +2352,7 @@ void MarlinSettings::reset() { #endif #if HAS_BED_PROBE - constexpr float dpo[XYZ] = NOZZLE_TO_PROBE_OFFSET; + constexpr float dpo[] = NOZZLE_TO_PROBE_OFFSET; static_assert(COUNT(dpo) == 3, "NOZZLE_TO_PROBE_OFFSET must contain offsets for X, Y, and Z."); #if HAS_PROBE_XY_OFFSET LOOP_XYZ(a) probe_offset[a] = dpo[a]; diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 2bf091ab5..1ba473946 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -1492,7 +1492,7 @@ void Stepper::stepper_pulse_phase_isr() { // Don't step E here - But remember the number of steps to perform motor_direction(E_AXIS) ? --LA_steps : ++LA_steps; #else - step_needed[E_AXIS] = delta_error.e >= 0; + step_needed.e = delta_error.e >= 0; #endif } #elif HAS_E0_STEP @@ -1519,7 +1519,7 @@ void Stepper::stepper_pulse_phase_isr() { #if DISABLED(LIN_ADVANCE) #if ENABLED(MIXING_EXTRUDER) - if (step_needed[E_AXIS]) E_STEP_WRITE(mixer.get_next_stepper(), !INVERT_E_STEP_PIN); + if (step_needed.e) E_STEP_WRITE(mixer.get_next_stepper(), !INVERT_E_STEP_PIN); #elif HAS_E0_STEP PULSE_START(E); #endif