From 43144096735b7f40cb596830621cba746f4bc55f Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Tue, 2 Jul 2024 02:13:47 -0400 Subject: [PATCH 1/8] update src/feature --- Marlin/src/feature/ammeter.cpp | 8 +- Marlin/src/feature/ammeter.h | 4 + Marlin/src/feature/babystep.cpp | 10 +- Marlin/src/feature/babystep.h | 10 +- Marlin/src/feature/backlash.cpp | 6 +- Marlin/src/feature/backlash.h | 4 + Marlin/src/feature/baricuda.cpp | 4 + Marlin/src/feature/baricuda.h | 4 + Marlin/src/feature/binary_stream.cpp | 4 + Marlin/src/feature/binary_stream.h | 40 ++-- Marlin/src/feature/bltouch.cpp | 12 +- Marlin/src/feature/bltouch.h | 8 +- Marlin/src/feature/cancel_object.cpp | 4 + Marlin/src/feature/cancel_object.h | 4 + Marlin/src/feature/caselight.cpp | 4 + Marlin/src/feature/caselight.h | 6 +- Marlin/src/feature/closedloop.cpp | 4 + Marlin/src/feature/closedloop.h | 4 + Marlin/src/feature/controllerfan.cpp | 8 +- Marlin/src/feature/controllerfan.h | 12 +- Marlin/src/feature/cooler.cpp | 4 + Marlin/src/feature/cooler.h | 10 +- Marlin/src/feature/direct_stepping.cpp | 4 + Marlin/src/feature/direct_stepping.h | 10 +- Marlin/src/feature/e_parser.h | 2 +- Marlin/src/feature/easythreed_ui.cpp | 112 +++++----- Marlin/src/feature/easythreed_ui.h | 4 + Marlin/src/feature/encoder_i2c.cpp | 214 ++++++++++--------- Marlin/src/feature/encoder_i2c.h | 88 ++++---- Marlin/src/feature/ethernet.cpp | 4 + Marlin/src/feature/ethernet.h | 4 + Marlin/src/feature/fancheck.cpp | 2 +- Marlin/src/feature/fancheck.h | 4 + Marlin/src/feature/filwidth.cpp | 8 +- Marlin/src/feature/filwidth.h | 24 ++- Marlin/src/feature/fwretract.cpp | 28 +-- Marlin/src/feature/fwretract.h | 2 +- Marlin/src/feature/host_actions.cpp | 4 + Marlin/src/feature/hotend_idle.cpp | 1 + Marlin/src/feature/hotend_idle.h | 4 + Marlin/src/feature/joystick.cpp | 6 +- Marlin/src/feature/max7219.cpp | 67 +++--- Marlin/src/feature/max7219.h | 1 + Marlin/src/feature/meatpack.cpp | 1 + Marlin/src/feature/meatpack.h | 4 +- Marlin/src/feature/mixing.cpp | 4 + Marlin/src/feature/mixing.h | 20 +- Marlin/src/feature/pause.cpp | 24 +-- Marlin/src/feature/pause.h | 54 ++--- Marlin/src/feature/power.cpp | 20 +- Marlin/src/feature/power.h | 1 + Marlin/src/feature/power_monitor.cpp | 4 + Marlin/src/feature/powerloss.cpp | 46 ++-- Marlin/src/feature/probe_temp_comp.cpp | 13 +- Marlin/src/feature/probe_temp_comp.h | 26 ++- Marlin/src/feature/repeat.cpp | 14 +- Marlin/src/feature/repeat.h | 8 +- Marlin/src/feature/runout.cpp | 18 +- Marlin/src/feature/runout.h | 38 ++-- Marlin/src/feature/solenoid.cpp | 8 +- Marlin/src/feature/solenoid.h | 4 + Marlin/src/feature/spindle_laser.cpp | 34 +-- Marlin/src/feature/stepper_driver_safety.cpp | 5 + Marlin/src/feature/stepper_driver_safety.h | 4 + Marlin/src/feature/tmc_util.cpp | 4 + Marlin/src/feature/tmc_util.h | 4 + Marlin/src/feature/tramming.cpp | 4 + Marlin/src/feature/tramming.h | 4 + Marlin/src/feature/twibus.cpp | 4 + Marlin/src/feature/twibus.h | 4 + Marlin/src/feature/x_twist.cpp | 5 + Marlin/src/feature/x_twist.h | 4 + Marlin/src/module/scara.h | 4 +- 73 files changed, 687 insertions(+), 467 deletions(-) diff --git a/Marlin/src/feature/ammeter.cpp b/Marlin/src/feature/ammeter.cpp index 71b84f1121a0..bf3f27ffa0d7 100644 --- a/Marlin/src/feature/ammeter.cpp +++ b/Marlin/src/feature/ammeter.cpp @@ -20,6 +20,10 @@ * */ +/** + * feature/ammeter.cpp + */ + #include "../inc/MarlinConfig.h" #if ENABLED(I2C_AMMETER) @@ -27,7 +31,7 @@ #include "ammeter.h" #ifndef I2C_AMMETER_IMAX - #define I2C_AMMETER_IMAX 0.500 // Calibration range 500 Milliamps + #define I2C_AMMETER_IMAX 0.500 // Calibration range 500 Milliamps #endif INA226 ina; @@ -46,7 +50,7 @@ void Ammeter::init() { float Ammeter::read() { scale = 1; current = ina.readShuntCurrent(); - if (current <= 0.0001f) current = 0; // Clean up least-significant-bit amplification errors + if (current <= 0.0001f) current = 0; // Clean-up least-significant-bit amplification errors if (current < 0.1f) scale = 1000; return current * scale; } diff --git a/Marlin/src/feature/ammeter.h b/Marlin/src/feature/ammeter.h index 86f09bb9a197..124058e6de0b 100644 --- a/Marlin/src/feature/ammeter.h +++ b/Marlin/src/feature/ammeter.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * feature/ammeter.h + */ + #include "../inc/MarlinConfigPre.h" #include diff --git a/Marlin/src/feature/babystep.cpp b/Marlin/src/feature/babystep.cpp index c6717268a64f..a089b507d529 100644 --- a/Marlin/src/feature/babystep.cpp +++ b/Marlin/src/feature/babystep.cpp @@ -20,14 +20,18 @@ * */ +/** + * feature/babystep.cpp + */ + #include "../inc/MarlinConfig.h" #if ENABLED(BABYSTEPPING) #include "babystep.h" #include "../MarlinCore.h" -#include "../module/motion.h" // for axes_should_home(), BABYSTEP_ALLOWED -#include "../module/planner.h" // for axis_steps_per_mm[] +#include "../module/motion.h" // For axes_should_home(), BABYSTEP_ALLOWED +#include "../module/planner.h" // For axis_steps_per_mm[] #include "../module/stepper.h" #if ENABLED(BABYSTEP_ALWAYS_AVAILABLE) @@ -47,7 +51,7 @@ int16_t Babystep::accum; #endif void Babystep::step_axis(const AxisEnum axis) { - const int16_t curTodo = steps[BS_AXIS_IND(axis)]; // get rid of volatile for performance + const int16_t curTodo = steps[BS_AXIS_IND(axis)]; // Get rid of volatile for performance if (curTodo) { stepper.do_babystep((AxisEnum)axis, curTodo > 0); if (curTodo > 0) steps[BS_AXIS_IND(axis)]--; else steps[BS_AXIS_IND(axis)]++; diff --git a/Marlin/src/feature/babystep.h b/Marlin/src/feature/babystep.h index 38a19a3b1473..2a2fc1da2739 100644 --- a/Marlin/src/feature/babystep.h +++ b/Marlin/src/feature/babystep.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * feature/babystep.h + */ + #include "../inc/MarlinConfigPre.h" #define BABYSTEPS_PER_SEC 1000UL @@ -45,14 +49,14 @@ class Babystep { public: static volatile int16_t steps[BS_AXIS_IND(Z_AXIS) + 1]; - static int16_t accum; // Total babysteps in current edit + static int16_t accum; // Total babysteps in current edit #if ALL(EP_BABYSTEPPING, EMERGENCY_PARSER) static int16_t ep_babysteps; #endif #if ENABLED(BABYSTEP_DISPLAY_TOTAL) - static int16_t axis_total[BS_TOTAL_IND(Z_AXIS) + 1]; // Total babysteps since G28 + static int16_t axis_total[BS_TOTAL_IND(Z_AXIS) + 1]; // Total babysteps since G28 static void reset_total(const AxisEnum axis) { if (TERN1(BABYSTEP_XY, axis == Z_AXIS)) axis_total[BS_TOTAL_IND(axis)] = 0; @@ -85,10 +89,8 @@ class Babystep { return steps[BS_AXIS_IND(X_AXIS)] || steps[BS_AXIS_IND(Y_AXIS)] || steps[BS_AXIS_IND(Z_AXIS)]; } - // // Called by the Temperature or Stepper ISR to // apply accumulated babysteps to the axes. - // static void task() { for (uint8_t i = 0; i <= BS_AXIS_IND(Z_AXIS); ++i) step_axis(BS_AXIS(i)); } diff --git a/Marlin/src/feature/backlash.cpp b/Marlin/src/feature/backlash.cpp index 07fa7725a06c..df7440873d8f 100644 --- a/Marlin/src/feature/backlash.cpp +++ b/Marlin/src/feature/backlash.cpp @@ -20,6 +20,10 @@ * */ +/** + * feature/backlash.cpp + */ + #include "../inc/MarlinConfigPre.h" #if ENABLED(BACKLASH_COMPENSATION) @@ -189,7 +193,7 @@ class Backlash::StepAdjuster { LOOP_NUM_AXES(axis) applied_steps[axis] = backlash.get_applied_steps((AxisEnum)axis); } ~StepAdjuster() { - // after backlash compensation parameter changes, ensure applied step count does not change + // After backlash compensation parameter changes, ensure applied step count does not change LOOP_NUM_AXES(axis) residual_error[axis] += backlash.get_applied_steps((AxisEnum)axis) - applied_steps[axis]; } }; diff --git a/Marlin/src/feature/backlash.h b/Marlin/src/feature/backlash.h index 593e51b9d0fe..86d35ba077c7 100644 --- a/Marlin/src/feature/backlash.h +++ b/Marlin/src/feature/backlash.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * feature/backlash.h + */ + #include "../inc/MarlinConfigPre.h" #include "../module/planner.h" diff --git a/Marlin/src/feature/baricuda.cpp b/Marlin/src/feature/baricuda.cpp index 596891707e92..078f69f5cb6e 100644 --- a/Marlin/src/feature/baricuda.cpp +++ b/Marlin/src/feature/baricuda.cpp @@ -20,6 +20,10 @@ * */ +/** + * feature/baricuda.cpp + */ + #include "../inc/MarlinConfigPre.h" #if ENABLED(BARICUDA) diff --git a/Marlin/src/feature/baricuda.h b/Marlin/src/feature/baricuda.h index f28d07d6427f..893e6fb78466 100644 --- a/Marlin/src/feature/baricuda.h +++ b/Marlin/src/feature/baricuda.h @@ -21,5 +21,9 @@ */ #pragma once +/** + * feature/baricuda.h + */ + extern uint8_t baricuda_valve_pressure, baricuda_e_to_p_pressure; diff --git a/Marlin/src/feature/binary_stream.cpp b/Marlin/src/feature/binary_stream.cpp index 81e110339bda..7cd37cdba95d 100644 --- a/Marlin/src/feature/binary_stream.cpp +++ b/Marlin/src/feature/binary_stream.cpp @@ -20,6 +20,10 @@ * */ +/** + * feature/binary_stream.cpp + */ + #include "../inc/MarlinConfigPre.h" #if ENABLED(BINARY_FILE_TRANSFER) diff --git a/Marlin/src/feature/binary_stream.h b/Marlin/src/feature/binary_stream.h index a9cd12b85e9a..d831e1d335c2 100644 --- a/Marlin/src/feature/binary_stream.h +++ b/Marlin/src/feature/binary_stream.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * feature/binary_stream.h + */ + #include "../inc/MarlinConfig.h" #define BINARY_STREAM_COMPRESSION @@ -211,12 +215,12 @@ class BinaryStream { union Header { static constexpr uint16_t HEADER_TOKEN = 0xB5AD; struct [[gnu::packed]] { - uint16_t token; // packet start token - uint8_t sync; // stream sync, resend id and packet loss detection + uint16_t token; // Packet start token + uint8_t sync; // Stream sync, resend id and packet loss detection uint8_t meta; // 4 bit protocol, // 4 bit packet type - uint16_t size; // data length - uint16_t checksum; // header checksum + uint16_t size; // Data length + uint16_t checksum; // Header checksum }; uint8_t protocol() { return (meta >> 4) & 0xF; } uint8_t type() { return meta & 0xF; } @@ -226,7 +230,7 @@ class BinaryStream { union Footer { struct [[gnu::packed]] { - uint16_t checksum; // full packet checksum + uint16_t checksum; // Full packet checksum }; void reset() { checksum = 0; } uint8_t data[1]; @@ -256,13 +260,13 @@ class BinaryStream { buffer_next_index = 0; } - // fletchers 16 checksum + // Fletchers 16 checksum uint32_t checksum(uint32_t cs, uint8_t value) { uint16_t cs_low = (((cs & 0xFF) + value) % 255); return ((((cs >> 8) + cs_low) % 255) << 8) | cs_low; } - // read the next byte from the data stream keeping track of + // Read the next byte from the data stream keeping track of // whether the stream times out from data starvation // takes the data variable by reference in order to return status bool stream_read(uint8_t& data) { @@ -297,14 +301,14 @@ class BinaryStream { packet.reset(); stream_state = StreamState::PACKET_WAIT; case StreamState::PACKET_WAIT: - if (!stream_read(data)) { idle(); return; } // no active packet so don't wait + if (!stream_read(data)) { idle(); return; } // No active packet so don't wait packet.header.data[1] = data; if (packet.header.token == packet.header.HEADER_TOKEN) { packet.bytes_received = 2; stream_state = StreamState::PACKET_HEADER; } else { - // stream corruption drop data + // Stream corruption drop data packet.header.data[0] = data; } break; @@ -314,7 +318,7 @@ class BinaryStream { packet.header.data[packet.bytes_received++] = data; packet.checksum = checksum(packet.checksum, data); - // header checksum calculation can't contain the checksum + // Header checksum calculation can't contain the checksum if (packet.bytes_received == sizeof(Packet::header) - 2) packet.header_checksum = packet.checksum; @@ -331,17 +335,17 @@ class BinaryStream { packet.bytes_received = 0; if (packet.header.size) { stream_state = StreamState::PACKET_DATA; - packet.buffer = static_cast(&buffer[0]); // multipacket buffering not implemented, always allocate whole buffer to packet + packet.buffer = static_cast(&buffer[0]); // Multipacket buffering not implemented, always allocate whole buffer to packet } else stream_state = StreamState::PACKET_PROCESS; } - else if (packet.header.sync == sync - 1) { // ok response must have been lost - SERIAL_ECHOLNPGM("ok", packet.header.sync); // transmit valid packet received and drop the payload + else if (packet.header.sync == sync - 1) { // OK response must have been lost + SERIAL_ECHOLNPGM("ok", packet.header.sync); // Transmit valid packet received and drop the payload stream_state = StreamState::PACKET_RESET; } else if (packet_retries) { - stream_state = StreamState::PACKET_RESET; // could be packets already buffered on flow controlled connections, drop them without ack + stream_state = StreamState::PACKET_RESET; // Could be packets already buffered on flow controlled connections, drop them without ack } else { SERIAL_ECHO_MSG("Datastream packet out of order"); @@ -393,7 +397,7 @@ class BinaryStream { packet_retries = 0; bytes_received += packet.header.size; - SERIAL_ECHOLNPGM("ok", packet.header.sync); // transmit valid packet received + SERIAL_ECHOLNPGM("ok", packet.header.sync); // Transmit valid packet received dispatch(); stream_state = StreamState::PACKET_RESET; break; @@ -413,7 +417,7 @@ class BinaryStream { break; case StreamState::PACKET_ERROR: SERIAL_ECHOLNPGM("fe", packet.header.sync); - reset(); // reset everything, resync required + reset(); // Reset everything, resync required stream_state = StreamState::PACKET_RESET; break; } @@ -426,7 +430,7 @@ class BinaryStream { switch (static_cast(packet.header.protocol())) { case Protocol::CONTROL: switch (static_cast(packet.header.type())) { - case ProtocolControl::CLOSE: // revert back to ASCII mode + case ProtocolControl::CLOSE: // Revert back to ASCII mode card.flag.binary_mode = false; break; default: @@ -434,7 +438,7 @@ class BinaryStream { } break; case Protocol::FILE_TRANSFER: - SDFileTransferProtocol::process(packet.header.type(), packet.buffer, packet.header.size); // send user data to be processed + SDFileTransferProtocol::process(packet.header.type(), packet.buffer, packet.header.size); // Send user data to be processed break; default: SERIAL_ECHO_MSG("Unsupported Binary Protocol"); diff --git a/Marlin/src/feature/bltouch.cpp b/Marlin/src/feature/bltouch.cpp index 02f76c139243..9e89c10f1b63 100644 --- a/Marlin/src/feature/bltouch.cpp +++ b/Marlin/src/feature/bltouch.cpp @@ -20,6 +20,10 @@ * */ +/** + * feature/bltouch.cpp + */ + #include "../inc/MarlinConfig.h" #if ENABLED(BLTOUCH) @@ -28,9 +32,9 @@ BLTouch bltouch; -bool BLTouch::od_5v_mode; // Initialized by settings.load, 0 = Open Drain; 1 = 5V Drain +bool BLTouch::od_5v_mode; // Initialized by settings.load, 0 = Open Drain; 1 = 5V Drain #if HAS_BLTOUCH_HS_MODE - bool BLTouch::high_speed_mode; // Initialized by settings.load, 0 = Low Speed; 1 = High Speed + bool BLTouch::high_speed_mode; // Initialized by settings.load, 0 = Low Speed; 1 = High Speed #else constexpr bool BLTouch::high_speed_mode; #endif @@ -152,7 +156,7 @@ bool BLTouch::stow_proc() { // an ALARM condition though. // But one more STOW will catch that // Last attempt to STOW - if (_stow_query_alarm()) { // so if there is now STILL an ALARM condition: + if (_stow_query_alarm()) { // So if there is now STILL an ALARM condition: if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("BLTouch Stow Failed"); probe.probe_error_stop(); // Something is wrong, needs action, but not too bad, allow restart return true; // Tell our caller we goofed in case he cares to know @@ -161,7 +165,7 @@ bool BLTouch::stow_proc() { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("bltouch.stow_proc() end"); - return false; // report success to caller + return false; // Report success to caller } bool BLTouch::status_proc() { diff --git a/Marlin/src/feature/bltouch.h b/Marlin/src/feature/bltouch.h index 0f9f2e68ba31..a08f328d6d78 100644 --- a/Marlin/src/feature/bltouch.h +++ b/Marlin/src/feature/bltouch.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * feature/bltouch.h + */ + #include "../inc/MarlinConfigPre.h" // BLTouch commands are sent as servo angles @@ -68,10 +72,10 @@ class BLTouch { public: static void init(const bool set_voltage=false); - static bool od_5v_mode; // Initialized by settings.load, 0 = Open Drain; 1 = 5V Drain + static bool od_5v_mode; // Initialized by settings.load, 0 = Open Drain; 1 = 5V Drain #if HAS_BLTOUCH_HS_MODE - static bool high_speed_mode; // Initialized by settings.load, 0 = Low Speed; 1 = High Speed + static bool high_speed_mode; // Initialized by settings.load, 0 = Low Speed; 1 = High Speed #else static constexpr bool high_speed_mode = false; #endif diff --git a/Marlin/src/feature/cancel_object.cpp b/Marlin/src/feature/cancel_object.cpp index 0040f6ed9df8..39a686dbb62f 100644 --- a/Marlin/src/feature/cancel_object.cpp +++ b/Marlin/src/feature/cancel_object.cpp @@ -20,6 +20,10 @@ * */ +/** + * feature/cancel_object.cpp + */ + #include "../inc/MarlinConfig.h" #if ENABLED(CANCEL_OBJECTS) diff --git a/Marlin/src/feature/cancel_object.h b/Marlin/src/feature/cancel_object.h index 62548a371937..946de6a8923b 100644 --- a/Marlin/src/feature/cancel_object.h +++ b/Marlin/src/feature/cancel_object.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * feature/cancel_object.h + */ + #include class CancelObject { diff --git a/Marlin/src/feature/caselight.cpp b/Marlin/src/feature/caselight.cpp index eb580a6d6269..8858494799fd 100644 --- a/Marlin/src/feature/caselight.cpp +++ b/Marlin/src/feature/caselight.cpp @@ -20,6 +20,10 @@ * */ +/** + * feature/caselight.cpp + */ + #include "../inc/MarlinConfig.h" #if ENABLED(CASE_LIGHT_ENABLE) diff --git a/Marlin/src/feature/caselight.h b/Marlin/src/feature/caselight.h index d88b3d67bf83..61329e9c6428 100644 --- a/Marlin/src/feature/caselight.h +++ b/Marlin/src/feature/caselight.h @@ -21,10 +21,14 @@ */ #pragma once +/** + * feature/caselight.h + */ + #include "../inc/MarlinConfig.h" #if CASE_LIGHT_IS_COLOR_LED - #include "leds/leds.h" // for LEDColor + #include "leds/leds.h" // For LEDColor #endif class CaseLight { diff --git a/Marlin/src/feature/closedloop.cpp b/Marlin/src/feature/closedloop.cpp index 1b9f711a6bbd..b28a1e7f78d7 100644 --- a/Marlin/src/feature/closedloop.cpp +++ b/Marlin/src/feature/closedloop.cpp @@ -20,6 +20,10 @@ * */ +/** + * feature/closedloop.cpp + */ + #include "../inc/MarlinConfig.h" #if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) diff --git a/Marlin/src/feature/closedloop.h b/Marlin/src/feature/closedloop.h index e03400c35c7b..d6f43f2d1d42 100644 --- a/Marlin/src/feature/closedloop.h +++ b/Marlin/src/feature/closedloop.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * feature/closedloop.h + */ + class ClosedLoop { public: static void init(); diff --git a/Marlin/src/feature/controllerfan.cpp b/Marlin/src/feature/controllerfan.cpp index acbae459e716..88e97c1836d6 100644 --- a/Marlin/src/feature/controllerfan.cpp +++ b/Marlin/src/feature/controllerfan.cpp @@ -20,6 +20,10 @@ * */ +/** + * feature/controllerfan.cpp + */ + #include "../inc/MarlinConfig.h" #if ENABLED(USE_CONTROLLER_FAN) @@ -55,8 +59,8 @@ void ControllerFan::set_fan_speed(const uint8_t s) { } void ControllerFan::update() { - static millis_t lastComponentOn = 0, // Last time a stepper, heater, etc. was turned on - nextFanCheck = 0; // Last time the state was checked + static millis_t lastComponentOn = 0, // Last time a stepper, heater, etc. was turned on + nextFanCheck = 0; // Last time the state was checked const millis_t ms = millis(); if (ELAPSED(ms, nextFanCheck)) { nextFanCheck = ms + 2500UL; // Not a time critical function, so only check every 2.5s diff --git a/Marlin/src/feature/controllerfan.h b/Marlin/src/feature/controllerfan.h index 68502afa6667..cb0dcd017965 100644 --- a/Marlin/src/feature/controllerfan.h +++ b/Marlin/src/feature/controllerfan.h @@ -21,13 +21,17 @@ */ #pragma once +/** + * feature/controllerfan.h + */ + #include "../inc/MarlinConfigPre.h" typedef struct { - uint8_t active_speed, // 0-255 (fullspeed); Speed with enabled stepper motors - idle_speed; // 0-255 (fullspeed); Speed after idle period with all motors are disabled - uint16_t duration; // Duration in seconds for the fan to run after all motors are disabled - bool auto_mode; // Default true + uint8_t active_speed, // 0-255 (fullspeed); Speed with enabled stepper motors + idle_speed; // 0-255 (fullspeed); Speed after idle period with all motors are disabled + uint16_t duration; // Duration in seconds for the fan to run after all motors are disabled + bool auto_mode; // Default true } controllerFan_settings_t; #ifndef CONTROLLERFAN_SPEED_ACTIVE diff --git a/Marlin/src/feature/cooler.cpp b/Marlin/src/feature/cooler.cpp index 6c45e992262e..f61ee631d9a5 100644 --- a/Marlin/src/feature/cooler.cpp +++ b/Marlin/src/feature/cooler.cpp @@ -20,6 +20,10 @@ * */ +/** + * feature/cooler.cpp + */ + #include "../inc/MarlinConfig.h" #if ANY(HAS_COOLER, LASER_COOLANT_FLOW_METER) diff --git a/Marlin/src/feature/cooler.h b/Marlin/src/feature/cooler.h index 9891514e23c9..59f3b0128435 100644 --- a/Marlin/src/feature/cooler.h +++ b/Marlin/src/feature/cooler.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * feature/cooler.h + */ + #include "../inc/MarlinConfigPre.h" #ifndef FLOWMETER_PPL @@ -94,9 +98,9 @@ class Cooler { } #if ENABLED(FLOWMETER_SAFETY) - static bool flowfault; // Flag that the cooler is in a fault state - static bool flowsafety_enabled; // Flag to disable the cutter if flow rate is too low - static void flowsafety_toggle() { flowsafety_enabled = !flowsafety_enabled; } + static bool flowfault; // Flag that the cooler is in a fault state + static bool flowsafety_enabled; // Flag to disable the cutter if flow rate is too low + static void flowsafety_toggle() { flowsafety_enabled = !flowsafety_enabled; } static bool check_flow_too_low() { const bool too_low = flowsafety_enabled && flowrate < (FLOWMETER_MIN_LITERS_PER_MINUTE); flowfault = too_low; diff --git a/Marlin/src/feature/direct_stepping.cpp b/Marlin/src/feature/direct_stepping.cpp index 13cf71e07695..71667a33ebaa 100644 --- a/Marlin/src/feature/direct_stepping.cpp +++ b/Marlin/src/feature/direct_stepping.cpp @@ -20,6 +20,10 @@ * */ +/** + * feature/direct_stepping.cpp + */ + #include "../inc/MarlinConfigPre.h" #if ENABLED(DIRECT_STEPPING) diff --git a/Marlin/src/feature/direct_stepping.h b/Marlin/src/feature/direct_stepping.h index b8a803f8115b..ae4350264dbc 100644 --- a/Marlin/src/feature/direct_stepping.h +++ b/Marlin/src/feature/direct_stepping.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * feature/direct_stepping.h + */ + #include "../inc/MarlinConfig.h" namespace DirectStepping { @@ -56,7 +60,7 @@ namespace DirectStepping { static bool maybe_store_rxd_char(uint8_t c); static void write_responses(); - // common methods for page managers + // Common methods for page managers static void init(); static uint8_t *get_page(const page_idx_t page_idx); static void free_page(const page_idx_t page_idx); @@ -108,7 +112,7 @@ namespace DirectStepping { template using SP_4x1_512 = config_t; - // configured types + // Configured types typedef STEPPER_PAGE_FORMAT Config; template class PAGE_MANAGER; @@ -123,7 +127,7 @@ namespace DirectStepping { typedef typename DirectStepping::Config::page_idx_t page_idx_t; -// TODO: use config +// TODO: Use config typedef DirectStepping::page_step_state_t page_step_state_t; extern const uint8_t segment_table[DirectStepping::Config::NUM_SEGMENTS][DirectStepping::Config::SEGMENT_STEPS]; diff --git a/Marlin/src/feature/e_parser.h b/Marlin/src/feature/e_parser.h index 8dacb0581c12..a6b3ab0c885a 100644 --- a/Marlin/src/feature/e_parser.h +++ b/Marlin/src/feature/e_parser.h @@ -58,7 +58,7 @@ class EmergencyParser { EP_ctrl, EP_K, EP_KI, EP_KIL, EP_KILL, #endif - EP_IGNORE // to '\n' + EP_IGNORE // To '\n' }; static bool killed_by_M112; diff --git a/Marlin/src/feature/easythreed_ui.cpp b/Marlin/src/feature/easythreed_ui.cpp index 39248bfc7d78..c60c3e950d36 100644 --- a/Marlin/src/feature/easythreed_ui.cpp +++ b/Marlin/src/feature/easythreed_ui.cpp @@ -20,6 +20,10 @@ * */ +/** + * feature/easythread_ui.cpp + */ + #include "../inc/MarlinConfigPre.h" #if ENABLED(EASYTHREED_UI) @@ -65,7 +69,7 @@ enum LEDInterval : uint16_t { LED_BLINK_7 = 50 }; -uint16_t blink_interval_ms = LED_ON; // Status LED on Start button +uint16_t blink_interval_ms = LED_ON; // Status LED on Start button void EasythreedUI::blinkLED() { static millis_t prev_blink_interval_ms = 0, blink_start_ms = 0; @@ -107,37 +111,37 @@ void EasythreedUI::loadButton() { break; case FS_PRESS: - if (ELAPSED(millis(), filament_time + BTN_DEBOUNCE_MS)) { // After a short debounce delay... - if (!READ(BTN_RETRACT) || !READ(BTN_FEED)) { // ...if switch still toggled... - thermalManager.setTargetHotend(EXTRUDE_MINTEMP + 10, 0); // Start heating up - blink_interval_ms = LED_BLINK_7; // Set the LED to blink fast + if (ELAPSED(millis(), filament_time + BTN_DEBOUNCE_MS)) { // After a short debounce delay... + if (!READ(BTN_RETRACT) || !READ(BTN_FEED)) { // ...if switch still toggled... + thermalManager.setTargetHotend(EXTRUDE_MINTEMP + 10, 0); // Start heating up + blink_interval_ms = LED_BLINK_7; // Set the LED to blink fast filament_status++; } else - filament_status = FS_IDLE; // Switch not toggled long enough + filament_status = FS_IDLE; // Switch not toggled long enough } break; case FS_CHECK: - if (READ(BTN_RETRACT) && READ(BTN_FEED)) { // Switch in center position (stop) - blink_interval_ms = LED_ON; // LED on steady + if (READ(BTN_RETRACT) && READ(BTN_FEED)) { // Switch in center position (stop) + blink_interval_ms = LED_ON; // LED on steady filament_status = FS_IDLE; thermalManager.disable_all_heaters(); } - else if (thermalManager.hotEnoughToExtrude(0)) { // Is the hotend hot enough to move material? - filament_status++; // Proceed to feed / retract. - blink_interval_ms = LED_BLINK_5; // Blink ~3 times per second + else if (thermalManager.hotEnoughToExtrude(0)) { // Is the hotend hot enough to move material? + filament_status++; // Proceed to feed / retract. + blink_interval_ms = LED_BLINK_5; // Blink ~3 times per second } break; case FS_PROCEED: { // Feed or Retract just once. Hard abort all moves and return to idle on swicth release. static bool flag = false; - if (READ(BTN_RETRACT) && READ(BTN_FEED)) { // Switch in center position (stop) - flag = false; // Restore flag to false - filament_status = FS_IDLE; // Go back to idle state - quickstop_stepper(); // Hard-stop all the steppers ... now! - thermalManager.disable_all_heaters(); // And disable all the heaters + if (READ(BTN_RETRACT) && READ(BTN_FEED)) { // Switch in center position (stop) + flag = false; // Restore flag to false + filament_status = FS_IDLE; // Go back to idle state + quickstop_stepper(); // Hard-stop all the steppers ... now! + thermalManager.disable_all_heaters(); // And disable all the heaters blink_interval_ms = LED_ON; } else if (!flag) { @@ -168,64 +172,64 @@ void EasythreedUI::printButton() { switch (key_status) { case KS_IDLE: - if (!READ(BTN_PRINT)) { // Print/Pause/Resume button pressed? - key_time = ms; // Save start time - key_status++; // Go to debounce test + if (!READ(BTN_PRINT)) { // Print/Pause/Resume button pressed? + key_time = ms; // Save start time + key_status++; // Go to debounce test } break; case KS_PRESS: - if (ELAPSED(ms, key_time + BTN_DEBOUNCE_MS)) // Wait for debounce interval to expire - key_status = READ(BTN_PRINT) ? KS_IDLE : KS_PROCEED; // Proceed if still pressed + if (ELAPSED(ms, key_time + BTN_DEBOUNCE_MS)) // Wait for debounce interval to expire + key_status = READ(BTN_PRINT) ? KS_IDLE : KS_PROCEED; // Proceed if still pressed break; case KS_PROCEED: - if (!READ(BTN_PRINT)) break; // Wait for the button to be released - key_status = KS_IDLE; // Ready for the next press - if (PENDING(ms, key_time + 1200 - BTN_DEBOUNCE_MS)) { // Register a press < 1.2 seconds + if (!READ(BTN_PRINT)) break; // Wait for the button to be released + key_status = KS_IDLE; // Ready for the next press + if (PENDING(ms, key_time + 1200 - BTN_DEBOUNCE_MS)) { // Register a press < 1.2 seconds switch (print_key_flag) { - case PF_START: { // The "Print" button starts an SD card print - if (printingIsActive()) break; // Already printing? (find another line that checks for 'is planner doing anything else right now?') - blink_interval_ms = LED_BLINK_2; // Blink the indicator LED at 1 second intervals - print_key_flag = PF_PAUSE; // The "Print" button now pauses the print - card.mount(); // Force SD card to mount - now! - if (!card.isMounted) { // Failed to mount? - blink_interval_ms = LED_OFF; // Turn off LED + case PF_START: { // The "Print" button starts an SD card print + if (printingIsActive()) break; // Already printing? (find another line that checks for 'is planner doing anything else right now?') + blink_interval_ms = LED_BLINK_2; // Blink the indicator LED at 1 second intervals + print_key_flag = PF_PAUSE; // The "Print" button now pauses the print + card.mount(); // Force SD card to mount - now! + if (!card.isMounted) { // Failed to mount? + blink_interval_ms = LED_OFF; // Turn off LED print_key_flag = PF_START; - return; // Bail out + return; // Bail out } - card.ls(); // List all files to serial output - const int16_t filecnt = card.get_num_items(); // Count printable files in cwd - if (filecnt == 0) return; // None are printable? - card.selectFileByIndex(filecnt); // Select the last file according to current sort options - card.openAndPrintFile(card.filename); // Start printing it + card.ls(); // List all files to serial output + const int16_t filecnt = card.get_num_items(); // Count printable files in cwd + if (filecnt == 0) return; // None are printable? + card.selectFileByIndex(filecnt); // Select the last file according to current sort options + card.openAndPrintFile(card.filename); // Start printing it } break; - case PF_PAUSE: { // Pause printing (not currently firing) + case PF_PAUSE: { // Pause printing (not currently firing) if (!printingIsActive()) break; - blink_interval_ms = LED_ON; // Set indicator to steady ON - queue.inject(F("M25")); // Queue Pause - print_key_flag = PF_RESUME; // The "Print" button now resumes the print + blink_interval_ms = LED_ON; // Set indicator to steady ON + queue.inject(F("M25")); // Queue Pause + print_key_flag = PF_RESUME; // The "Print" button now resumes the print } break; - case PF_RESUME: { // Resume printing + case PF_RESUME: { // Resume printing if (printingIsActive()) break; - blink_interval_ms = LED_BLINK_2; // Blink the indicator LED at 1 second intervals - queue.inject(F("M24")); // Queue resume - print_key_flag = PF_PAUSE; // The "Print" button now pauses the print + blink_interval_ms = LED_BLINK_2; // Blink the indicator LED at 1 second intervals + queue.inject(F("M24")); // Queue resume + print_key_flag = PF_PAUSE; // The "Print" button now pauses the print } break; } } - else { // Register a longer press - if (print_key_flag == PF_START && !printingIsActive()) { // While not printing, this moves Z up 10mm + else { // Register a longer press + if (print_key_flag == PF_START && !printingIsActive()) { // While not printing, this moves Z up 10mm blink_interval_ms = LED_ON; - queue.inject(F("G91\nG0 Z10 F600\nG90")); // Raise Z soon after returning to main loop + queue.inject(F("G91\nG0 Z10 F600\nG90")); // Raise Z soon after returning to main loop } - else { // While printing, cancel print - card.abortFilePrintSoon(); // There is a delay while the current steps play out - blink_interval_ms = LED_OFF; // Turn off LED + else { // While printing, cancel print + card.abortFilePrintSoon(); // There is a delay while the current steps play out + blink_interval_ms = LED_OFF; // Turn off LED } - planner.synchronize(); // Wait for commands already in the planner to finish - TERN_(HAS_STEPPER_RESET, disableStepperDrivers()); // Disable all steppers - now! - print_key_flag = PF_START; // The "Print" button now starts a new print + planner.synchronize(); // Wait for commands already in the planner to finish + TERN_(HAS_STEPPER_RESET, disableStepperDrivers()); // Disable all steppers - now! + print_key_flag = PF_START; // The "Print" button now starts a new print } break; } diff --git a/Marlin/src/feature/easythreed_ui.h b/Marlin/src/feature/easythreed_ui.h index af9ad2d090b1..15010f47206a 100644 --- a/Marlin/src/feature/easythreed_ui.h +++ b/Marlin/src/feature/easythreed_ui.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * feature/easythread_ui.h + */ + class EasythreedUI { public: static void init(); diff --git a/Marlin/src/feature/encoder_i2c.cpp b/Marlin/src/feature/encoder_i2c.cpp index 135178456b73..8755647c6ed2 100644 --- a/Marlin/src/feature/encoder_i2c.cpp +++ b/Marlin/src/feature/encoder_i2c.cpp @@ -20,12 +20,15 @@ * */ -//todo: add support for multiple encoders on a single axis -//todo: add z axis auto-leveling -//todo: consolidate some of the related M codes? -//todo: add endstop-replacement mode? -//todo: try faster I2C speed; tweak TWI_FREQ (400000L, or faster?); or just TWBR = ((CPU_FREQ / 400000L) - 16) / 2; -//todo: consider Marlin-optimized Wire library; i.e. MarlinWire, like MarlinSerial +/** + * feature/encoder_i2c.cpp + * TODO: add support for multiple encoders on a single axis + * TODO: add z axis auto-leveling + * TODO: consolidate some of the related M codes? + * TODO: add endstop-replacement mode? + * TODO: try faster I2C speed; tweak TWI_FREQ (400000L, or faster?); or just TWBR = ((CPU_FREQ / 400000L) - 16) / 2; + * TODO: consider Marlin-optimized Wire library; i.e. MarlinWire, like MarlinSerial + */ #include "../inc/MarlinConfig.h" @@ -139,17 +142,17 @@ void I2CPositionEncoder::update() { if (i) diffSum += ABS(err[i-1] - err[i]); } - const int32_t error = int32_t(sum / (I2CPE_ERR_ARRAY_SIZE + 1)); //calculate average for error + const int32_t error = int32_t(sum / (I2CPE_ERR_ARRAY_SIZE + 1)); // Calculate average for error #else const int32_t error = get_axis_error_steps(false); #endif - //SERIAL_ECHOLNPGM("Axis error steps: ", error); + // SERIAL_ECHOLNPGM("Axis error steps: ", error); #ifdef I2CPE_ERR_THRESH_ABORT if (ABS(error) > I2CPE_ERR_THRESH_ABORT * planner.settings.axis_steps_per_mm[encoderAxis]) { - //kill(F("Significant Error")); + // kill(F("Significant Error")); SERIAL_ECHOLNPGM("Axis error over threshold, aborting!", error); safe_delay(5000); } @@ -201,7 +204,7 @@ void I2CPositionEncoder::update() { void I2CPositionEncoder::set_homed() { if (active) { - reset(); // Reset module's offset to zero (so current position is homed / zero) + reset(); // Reset module's offset to zero (so current position is homed / zero) delay(10); zeroOffset = get_raw_count(); @@ -266,18 +269,18 @@ int32_t I2CPositionEncoder::get_axis_error_steps(const bool report) { float stepperTicksPerUnit; int32_t encoderTicks = position, encoderCountInStepperTicksScaled; - //int32_t stepperTicks = stepper.position(encoderAxis); + // int32_t stepperTicks = stepper.position(encoderAxis); - // With a rotary encoder we're concerned with ticks/rev; whereas with a linear we're concerned with ticks/mm + // With a rotary encoder we're concerned with ticks/rev; whereas with a linear we're concerned with ticks/(mm) stepperTicksPerUnit = (type == I2CPE_ENC_TYPE_ROTARY) ? stepperTicks : planner.settings.axis_steps_per_mm[encoderAxis]; - //convert both 'ticks' into same units / base + // Convert both 'ticks' into same units / base encoderCountInStepperTicksScaled = LROUND((stepperTicksPerUnit * encoderTicks) / encoderTicksPerUnit); const int32_t target = stepper.position(encoderAxis); int32_t error = encoderCountInStepperTicksScaled - target; - //suppress discontinuities (might be caused by bad I2C readings...?) + // Suppress discontinuities (might be caused by bad I2C readings...?) const bool suppressOutput = (ABS(error - errorPrev) > 100); errorPrev = error; @@ -302,7 +305,7 @@ int32_t I2CPositionEncoder::get_raw_count() { encoderCount.val = 0x00; if (Wire.requestFrom(I2C_ADDRESS(i2cAddress), uint8_t(3)) != 3) { - //houston, we have a problem... + // Houston, we have a problem... H = I2CPE_MAG_SIG_NF; return 0; } @@ -310,11 +313,11 @@ int32_t I2CPositionEncoder::get_raw_count() { while (Wire.available()) encoderCount.bval[index++] = (uint8_t)Wire.read(); - //extract the magnetic strength + // Extract the magnetic strength H = (B00000011 & (encoderCount.bval[2] >> 6)); - //extract sign bit; sign = (encoderCount.bval[2] & B00100000); - //set all upper bits to the sign value to overwrite H + // Extract sign bit: sign = (encoderCount.bval[2] & B00100000); + // Set all upper bits to the sign value to overwrite H encoderCount.val = (encoderCount.bval[2] & B00100000) ? (encoderCount.val | 0xFFC00000) : (encoderCount.val & 0x003FFFFF); if (invert) encoderCount.val *= -1; @@ -348,14 +351,14 @@ bool I2CPositionEncoder::test_axis() { planner.synchronize(); #endif - // if the module isn't currently trusted, wait until it is (or until it should be if things are working) + // If the module isn't currently trusted, wait until it is (or until it should be if things are working) if (!trusted) { int32_t startWaitingTime = millis(); while (!trusted && millis() - startWaitingTime < I2CPE_TIME_TRUSTED) safe_delay(500); } - if (trusted) { // if trusted, commence test + if (trusted) { // If trusted, commence test TERN_(HAS_EXTRUDERS, endCoord.e = planner.get_axis_position_mm(E_AXIS)); planner.buffer_line(endCoord, fr_mm_s, 0); planner.synchronize(); @@ -408,13 +411,13 @@ void I2CPositionEncoder::calibrate_steps_mm(const uint8_t iter) { delay(250); startCount = get_position(); - //do_blocking_move_to(endCoord); + // do_blocking_move_to(endCoord); TERN_(HAS_EXTRUDERS, endCoord.e = planner.get_axis_position_mm(E_AXIS)); planner.buffer_line(endCoord, fr_mm_s, 0); planner.synchronize(); - //Read encoder distance + // Read encoder distance delay(250); stopCount = get_position(); @@ -704,7 +707,7 @@ void I2CPositionEncodersMgr::change_module_address(const uint8_t oldaddr, const SERIAL_ECHOLNPGM("Address change successful!"); // Now, if this module is configured, find which encoder instance it's supposed to correspond to - // and enable it (it will likely have failed initialization on power-up, before the address change). + // and enable it (it will likely have failed initialization on power-up, before the address change) const int8_t idx = idx_from_addr(newaddr); if (idx >= 0 && !encoders[idx].get_active()) { SERIAL_CHAR(AXIS_CHAR(encoders[idx).get_axis()]); @@ -754,7 +757,7 @@ int8_t I2CPositionEncodersMgr::parse() { } I2CPE_addr = parser.value_byte(); - if (!WITHIN(I2CPE_addr, 30, 200)) { // reserve the first 30 and last 55 + if (!WITHIN(I2CPE_addr, 30, 200)) { // Reserve the first 30 and last 55 SERIAL_ECHOLNPGM("?Address out of range. [30-200]"); return I2CPE_PARSE_ERR; } @@ -789,18 +792,18 @@ int8_t I2CPositionEncodersMgr::parse() { } /** - * M860: Report the position(s) of position encoder module(s). + * M860: Report the position(s) of position encoder module(s) * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1] - * O Include homed zero-offset in returned position. - * U Units in mm or raw step count. + * A Module I2C address. [30, 200] + * I Module index. [0, I2CPE_ENCODER_CNT - 1] + * O Include homed zero-offset in returned position + * U Units in (mm) or raw step count * * If A or I not specified: - * X Report on X axis encoder, if present. - * Y Report on Y axis encoder, if present. - * Z Report on Z axis encoder, if present. - * E Report on E axis encoder, if present. + * X Report on X axis encoder, if present + * Y Report on Y axis encoder, if present + * Z Report on Z axis encoder, if present + * E Report on E axis encoder, if present */ void I2CPositionEncodersMgr::M860() { if (parse()) return; @@ -820,16 +823,16 @@ void I2CPositionEncodersMgr::M860() { } /** - * M861: Report the status of position encoder modules. + * M861: Report the status of position encoder modules * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1] + * A Module I2C address. [30, 200] + * I Module index. [0, I2CPE_ENCODER_CNT - 1] * * If A or I not specified: - * X Report on X axis encoder, if present. - * Y Report on Y axis encoder, if present. - * Z Report on Z axis encoder, if present. - * E Report on E axis encoder, if present. + * X Report on X axis encoder, if present + * Y Report on Y axis encoder, if present + * Z Report on Z axis encoder, if present + * E Report on E axis encoder, if present */ void I2CPositionEncodersMgr::M861() { if (parse()) return; @@ -847,17 +850,17 @@ void I2CPositionEncodersMgr::M861() { } /** - * M862: Perform an axis continuity test for position encoder - * modules. + * M862: Perform an axis continuity test for position encoder + * modules * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1] + * A Module I2C address. [30, 200] + * I Module index. [0, I2CPE_ENCODER_CNT - 1] * * If A or I not specified: - * X Report on X axis encoder, if present. - * Y Report on Y axis encoder, if present. - * Z Report on Z axis encoder, if present. - * E Report on E axis encoder, if present. + * X Report on X axis encoder, if present + * Y Report on Y axis encoder, if present + * Z Report on Z axis encoder, if present + * E Report on E axis encoder, if present */ void I2CPositionEncodersMgr::M862() { if (parse()) return; @@ -875,18 +878,18 @@ void I2CPositionEncodersMgr::M862() { } /** - * M863: Perform steps-per-mm calibration for - * position encoder modules. + * M863: Perform steps-per-mm calibration for + * position encoder modules * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1] - * P Number of rePeats/iterations. + * A Module I2C address. [30, 200] + * I Module index. [0, I2CPE_ENCODER_CNT - 1] + * P Number of rePeats/iterations * * If A or I not specified: - * X Report on X axis encoder, if present. - * Y Report on Y axis encoder, if present. - * Z Report on Z axis encoder, if present. - * E Report on E axis encoder, if present. + * X Report on X axis encoder, if present + * Y Report on Y axis encoder, if present + * Z Report on Z axis encoder, if present + * E Report on E axis encoder, if present */ void I2CPositionEncodersMgr::M863() { if (parse()) return; @@ -906,17 +909,17 @@ void I2CPositionEncodersMgr::M863() { } /** - * M864: Change position encoder module I2C address. + * M864: Change position encoder module I2C address * - * A Module current/old I2C address. If not present, - * assumes default address (030). [30, 200]. - * S Module new I2C address. [30, 200]. + * A Module current/old I2C address. If not present, + * assumes default address (030). [30, 200] + * S Module new I2C address. [30, 200] * * If S is not specified: - * X Use I2CPE_PRESET_ADDR_X (030). - * Y Use I2CPE_PRESET_ADDR_Y (031). - * Z Use I2CPE_PRESET_ADDR_Z (032). - * E Use I2CPE_PRESET_ADDR_E (033). + * X Use I2CPE_PRESET_ADDR_X (030) + * Y Use I2CPE_PRESET_ADDR_Y (031) + * Z Use I2CPE_PRESET_ADDR_Z (032) + * E Use I2CPE_PRESET_ADDR_E (033) */ void I2CPositionEncodersMgr::M864() { uint8_t newAddress; @@ -955,16 +958,16 @@ void I2CPositionEncodersMgr::M864() { } /** - * M865: Check position encoder module firmware version. + * M865: Check position encoder module firmware version * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1]. + * A Module I2C address. [30, 200] + * I Module index. [0, I2CPE_ENCODER_CNT - 1] * * If A or I not specified: - * X Check X axis encoder, if present. - * Y Check Y axis encoder, if present. - * Z Check Z axis encoder, if present. - * E Check E axis encoder, if present. + * X Check X axis encoder, if present + * Y Check Y axis encoder, if present + * Z Check Z axis encoder, if present + * E Check E axis encoder, if present */ void I2CPositionEncodersMgr::M865() { if (parse()) return; @@ -982,18 +985,17 @@ void I2CPositionEncodersMgr::M865() { } /** - * M866: Report or reset position encoder module error - * count. + * M866: Report or reset position encoder module error count * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1]. - * R Reset error counter. + * A Module I2C address. [30, 200] + * I Module index. [0, I2CPE_ENCODER_CNT - 1] + * R Reset error counter * * If A or I not specified: - * X Act on X axis encoder, if present. - * Y Act on Y axis encoder, if present. - * Z Act on Z axis encoder, if present. - * E Act on E axis encoder, if present. + * X Act on X axis encoder, if present + * Y Act on Y axis encoder, if present + * Z Act on Z axis encoder, if present + * E Act on E axis encoder, if present */ void I2CPositionEncodersMgr::M866() { if (parse()) return; @@ -1020,18 +1022,18 @@ void I2CPositionEncodersMgr::M866() { } /** - * M867: Enable/disable or toggle error correction for position encoder modules. + * M867: Enable/disable or toggle error correction for position encoder modules * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1]. - * S<1|0> Enable/disable error correction. 1 enables, 0 disables. If not - * supplied, toggle. + * A Module I2C address. [30, 200] + * I Module index. [0, I2CPE_ENCODER_CNT - 1] + * S<1|0> Enable/disable error correction. 1 enables, 0 disables. If not + * supplied, toggle * * If A or I not specified: - * X Act on X axis encoder, if present. - * Y Act on Y axis encoder, if present. - * Z Act on Z axis encoder, if present. - * E Act on E axis encoder, if present. + * X Act on X axis encoder, if present + * Y Act on Y axis encoder, if present + * Z Act on Z axis encoder, if present + * E Act on E axis encoder, if present */ void I2CPositionEncodersMgr::M867() { if (parse()) return; @@ -1056,18 +1058,18 @@ void I2CPositionEncodersMgr::M867() { } /** - * M868: Report or set position encoder module error correction - * threshold. + * M868: Report or set position encoder module error correction + * threshold * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1]. - * T New error correction threshold. + * A Module I2C address. [30, 200] + * I Module index. [0, I2CPE_ENCODER_CNT - 1] + * T New error correction threshold * * If A not specified: - * X Act on X axis encoder, if present. - * Y Act on Y axis encoder, if present. - * Z Act on Z axis encoder, if present. - * E Act on E axis encoder, if present. + * X Act on X axis encoder, if present + * Y Act on Y axis encoder, if present + * Z Act on Z axis encoder, if present + * E Act on E axis encoder, if present */ void I2CPositionEncodersMgr::M868() { if (parse()) return; @@ -1094,16 +1096,16 @@ void I2CPositionEncodersMgr::M868() { } /** - * M869: Report position encoder module error. + * M869: Report position encoder module error * - * A Module I2C address. [30, 200]. - * I Module index. [0, I2CPE_ENCODER_CNT - 1]. + * A Module I2C address. [30, 200] + * I Module index. [0, I2CPE_ENCODER_CNT - 1] * * If A not specified: - * X Act on X axis encoder, if present. - * Y Act on Y axis encoder, if present. - * Z Act on Z axis encoder, if present. - * E Act on E axis encoder, if present. + * X Act on X axis encoder, if present + * Y Act on Y axis encoder, if present + * Z Act on Z axis encoder, if present + * E Act on E axis encoder, if present */ void I2CPositionEncodersMgr::M869() { if (parse()) return; diff --git a/Marlin/src/feature/encoder_i2c.h b/Marlin/src/feature/encoder_i2c.h index 861a8e52d4d6..c13c9e83e3cc 100644 --- a/Marlin/src/feature/encoder_i2c.h +++ b/Marlin/src/feature/encoder_i2c.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * feature/encoder_i2c.h + */ + #include "../inc/MarlinConfig.h" #include "../module/planner.h" @@ -29,73 +33,73 @@ //=========== Advanced / Less-Common Encoder Configuration Settings ========== -#define I2CPE_EC_THRESH_PROPORTIONAL // if enabled adjusts the error correction threshold - // proportional to the current speed of the axis allows - // for very small error margin at low speeds without - // stuttering due to reading latency at high speeds +#define I2CPE_EC_THRESH_PROPORTIONAL // If enabled, adjusts the error correction threshold + // proportional to the current speed of the axis. Allows + // for very small error margin at low speeds without + // stuttering due to reading latency at high speeds -#define I2CPE_DEBUG // enable encoder-related debug serial echos +#define I2CPE_DEBUG // Enable encoder-related debug serial echos -#define I2CPE_REBOOT_TIME 5000 // time we wait for an encoder module to reboot - // after changing address. +#define I2CPE_REBOOT_TIME 5000 // Time we wait for an encoder module to reboot + // after changing address. -#define I2CPE_MAG_SIG_GOOD 0 -#define I2CPE_MAG_SIG_MID 1 -#define I2CPE_MAG_SIG_BAD 2 -#define I2CPE_MAG_SIG_NF 255 +#define I2CPE_MAG_SIG_GOOD 0 +#define I2CPE_MAG_SIG_MID 1 +#define I2CPE_MAG_SIG_BAD 2 +#define I2CPE_MAG_SIG_NF 255 -#define I2CPE_REQ_REPORT 0 -#define I2CPE_RESET_COUNT 1 -#define I2CPE_SET_ADDR 2 -#define I2CPE_SET_REPORT_MODE 3 -#define I2CPE_CLEAR_EEPROM 4 +#define I2CPE_REQ_REPORT 0 +#define I2CPE_RESET_COUNT 1 +#define I2CPE_SET_ADDR 2 +#define I2CPE_SET_REPORT_MODE 3 +#define I2CPE_CLEAR_EEPROM 4 -#define I2CPE_LED_PAR_MODE 10 -#define I2CPE_LED_PAR_BRT 11 -#define I2CPE_LED_PAR_RATE 14 +#define I2CPE_LED_PAR_MODE 10 +#define I2CPE_LED_PAR_BRT 11 +#define I2CPE_LED_PAR_RATE 14 -#define I2CPE_REPORT_DISTANCE 0 -#define I2CPE_REPORT_STRENGTH 1 -#define I2CPE_REPORT_VERSION 2 +#define I2CPE_REPORT_DISTANCE 0 +#define I2CPE_REPORT_STRENGTH 1 +#define I2CPE_REPORT_VERSION 2 // Default I2C addresses -#define I2CPE_PRESET_ADDR_X 30 -#define I2CPE_PRESET_ADDR_Y 31 -#define I2CPE_PRESET_ADDR_Z 32 -#define I2CPE_PRESET_ADDR_E 33 +#define I2CPE_PRESET_ADDR_X 30 +#define I2CPE_PRESET_ADDR_Y 31 +#define I2CPE_PRESET_ADDR_Z 32 +#define I2CPE_PRESET_ADDR_E 33 -#define I2CPE_DEF_AXIS X_AXIS -#define I2CPE_DEF_ADDR I2CPE_PRESET_ADDR_X +#define I2CPE_DEF_AXIS X_AXIS +#define I2CPE_DEF_ADDR I2CPE_PRESET_ADDR_X // Error event counter; tracks how many times there is an error exceeding a certain threshold -#define I2CPE_ERR_CNT_THRESH 3.00 +#define I2CPE_ERR_CNT_THRESH 3.00 #define I2CPE_ERR_CNT_DEBOUNCE_MS 2000 #if ENABLED(I2CPE_ERR_ROLLING_AVERAGE) - #define I2CPE_ERR_ARRAY_SIZE 32 - #define I2CPE_ERR_PRST_ARRAY_SIZE 10 + #define I2CPE_ERR_ARRAY_SIZE 32 + #define I2CPE_ERR_PRST_ARRAY_SIZE 10 #endif // Error Correction Methods -#define I2CPE_ECM_NONE 0 -#define I2CPE_ECM_MICROSTEP 1 -#define I2CPE_ECM_PLANNER 2 -#define I2CPE_ECM_STALLDETECT 3 +#define I2CPE_ECM_NONE 0 +#define I2CPE_ECM_MICROSTEP 1 +#define I2CPE_ECM_PLANNER 2 +#define I2CPE_ECM_STALLDETECT 3 // Encoder types -#define I2CPE_ENC_TYPE_ROTARY 0 -#define I2CPE_ENC_TYPE_LINEAR 1 +#define I2CPE_ENC_TYPE_ROTARY 0 +#define I2CPE_ENC_TYPE_LINEAR 1 // Parser -#define I2CPE_PARSE_ERR 1 -#define I2CPE_PARSE_OK 0 +#define I2CPE_PARSE_ERR 1 +#define I2CPE_PARSE_OK 0 #define LOOP_PE(VAR) for (uint8_t VAR = 0; VAR < I2CPE_ENCODER_CNT; ++VAR) #define CHECK_IDX() do{ if (!WITHIN(idx, 0, I2CPE_ENCODER_CNT - 1)) return; }while(0) typedef union { volatile int32_t val = 0; - uint8_t bval[4]; + uint8_t bval[4]; } i2cLong; class I2CPositionEncoder { @@ -105,7 +109,7 @@ class I2CPositionEncoder { uint8_t i2cAddress = I2CPE_DEF_ADDR, ecMethod = I2CPE_DEF_EC_METHOD, type = I2CPE_DEF_TYPE, - H = I2CPE_MAG_SIG_NF; // Magnetic field strength + H = I2CPE_MAG_SIG_NF; // Magnetic field strength int encoderTicksPerUnit = I2CPE_DEF_ENC_TICKS_UNIT, stepperTicks = I2CPE_DEF_TICKS_REV, @@ -219,7 +223,7 @@ class I2CPositionEncodersMgr { static void init(); - // consider only updating one endoder per call / tick if encoders become too time intensive + // Consider only updating one endoder per call / tick if encoders become too time intensive static void update() { LOOP_PE(i) encoders[i].update(); } static void homed(const AxisEnum axis) { diff --git a/Marlin/src/feature/ethernet.cpp b/Marlin/src/feature/ethernet.cpp index c5bfa932cb5b..391870d861ba 100644 --- a/Marlin/src/feature/ethernet.cpp +++ b/Marlin/src/feature/ethernet.cpp @@ -20,6 +20,10 @@ * */ +/** + * feature/ethernet.cpp + */ + #include "../inc/MarlinConfigPre.h" #if HAS_ETHERNET diff --git a/Marlin/src/feature/ethernet.h b/Marlin/src/feature/ethernet.h index 70a58efce7e3..72b136be850f 100644 --- a/Marlin/src/feature/ethernet.h +++ b/Marlin/src/feature/ethernet.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * feature/ethernet.h + */ + #ifdef __IMXRT1062__ #include #endif diff --git a/Marlin/src/feature/fancheck.cpp b/Marlin/src/feature/fancheck.cpp index 844191e7e442..205f5923c97d 100644 --- a/Marlin/src/feature/fancheck.cpp +++ b/Marlin/src/feature/fancheck.cpp @@ -21,7 +21,7 @@ */ /** - * fancheck.cpp - fan tachometer check + * feature/fancheck.cpp - fan tachometer check */ #include "../inc/MarlinConfig.h" diff --git a/Marlin/src/feature/fancheck.h b/Marlin/src/feature/fancheck.h index b13a34fb19eb..b281b6361cfc 100644 --- a/Marlin/src/feature/fancheck.h +++ b/Marlin/src/feature/fancheck.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * feature/fancheck.h - fan tachometer check + */ + #include "../inc/MarlinConfig.h" #if HAS_FANCHECK diff --git a/Marlin/src/feature/filwidth.cpp b/Marlin/src/feature/filwidth.cpp index 3befd7752a6e..b0c09a3eb22e 100644 --- a/Marlin/src/feature/filwidth.cpp +++ b/Marlin/src/feature/filwidth.cpp @@ -20,6 +20,10 @@ * */ +/** + * feature/filwidth.cpp + */ + #include "../inc/MarlinConfig.h" #if ENABLED(FILAMENT_WIDTH_SENSOR) @@ -28,9 +32,9 @@ FilamentWidthSensor filwidth; -bool FilamentWidthSensor::enabled; // = false; // (M405-M406) Filament Width Sensor ON/OFF. +bool FilamentWidthSensor::enabled; // = false; // (M405-M406) Filament Width Sensor ON/OFF. uint32_t FilamentWidthSensor::accum; // = 0 // ADC accumulator -uint16_t FilamentWidthSensor::raw; // = 0 // Measured filament diameter - one extruder only +uint16_t FilamentWidthSensor::raw; // = 0 // Measured filament diameter - one extruder only float FilamentWidthSensor::nominal_mm = DEFAULT_NOMINAL_FILAMENT_DIA, // (M104) Nominal filament width FilamentWidthSensor::measured_mm = DEFAULT_MEASURED_FILAMENT_DIA, // Measured filament diameter FilamentWidthSensor::e_count = 0, diff --git a/Marlin/src/feature/filwidth.h b/Marlin/src/feature/filwidth.h index ab50fe0af3f9..a13b580d435e 100644 --- a/Marlin/src/feature/filwidth.h +++ b/Marlin/src/feature/filwidth.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * feature/filwidth.h + */ + #include "../inc/MarlinConfig.h" #include "../module/planner.h" #include "../module/thermistor/thermistors.h" @@ -28,15 +32,15 @@ class FilamentWidthSensor { public: static constexpr int MMD_CM = MAX_MEASUREMENT_DELAY + 1, MMD_MM = MMD_CM * 10; - static bool enabled; // (M405-M406) Filament Width Sensor ON/OFF. - static uint32_t accum; // ADC accumulator - static uint16_t raw; // Measured filament diameter - one extruder only - static float nominal_mm, // (M104) Nominal filament width - measured_mm, // Measured filament diameter + static bool enabled; // (M405-M406) Filament Width Sensor ON/OFF + static uint32_t accum; // ADC accumulator + static uint16_t raw; // Measured filament diameter - one extruder only + static float nominal_mm, // (M104) Nominal filament width + measured_mm, // Measured filament diameter e_count, delay_dist; - static uint8_t meas_delay_cm; // Distance delay setting - static int8_t ratios[MMD_CM], // Ring buffer to delay measurement. (Extruder factor minus 100) - index_r, index_w; // Indexes into ring buffer + static uint8_t meas_delay_cm; // Distance delay setting + static int8_t ratios[MMD_CM], // Ring buffer to delay measurement. (Extruder factor minus 100) + index_r, index_w; // Indexes into ring buffer FilamentWidthSensor() { init(); } static void init(); @@ -49,11 +53,11 @@ class FilamentWidthSensor { /** * Convert Filament Width (mm) to an extrusion ratio - * and reduce to an 8 bit value. + * and reduce to an 8 bit value * * A nominal width of 1.75 and measured width of 1.73 * gives (100 * 1.75 / 1.73) for a ratio of 101 and - * a return value of 1. + * a return value of 1 */ static int8_t sample_to_size_ratio() { return ABS(nominal_mm - measured_mm) <= FILWIDTH_ERROR_MARGIN diff --git a/Marlin/src/feature/fwretract.cpp b/Marlin/src/feature/fwretract.cpp index fff2a1ed3952..e46ebda543e1 100644 --- a/Marlin/src/feature/fwretract.cpp +++ b/Marlin/src/feature/fwretract.cpp @@ -21,7 +21,7 @@ */ /** - * fwretract.cpp - Implement firmware-based retraction + * feature/fwretract.cpp - Implement firmware-based retraction */ #include "../inc/MarlinConfig.h" @@ -44,20 +44,20 @@ FWRetract fwretract; // Single instance - this calls the constructor // private: #if HAS_MULTI_EXTRUDER - Flags FWRetract::retracted_swap; // Which extruders are swap-retracted + Flags FWRetract::retracted_swap; // Which extruders are swap-retracted #endif // public: -fwretract_settings_t FWRetract::settings; // M207 S F Z W, M208 S F W R +fwretract_settings_t FWRetract::settings; // M207 S F Z W, M208 S F W R #if ENABLED(FWRETRACT_AUTORETRACT) - bool FWRetract::autoretract_enabled; // M209 S - Autoretract switch + bool FWRetract::autoretract_enabled; // M209 S - Autoretract switch #endif -Flags FWRetract::retracted; // Which extruders are currently retracted +Flags FWRetract::retracted; // Which extruders are currently retracted -float FWRetract::current_retract[EXTRUDERS], // Retract value used by planner +float FWRetract::current_retract[EXTRUDERS], // Retract value used by planner FWRetract::current_hop; void FWRetract::reset() { @@ -87,7 +87,7 @@ void FWRetract::reset() { * * To simplify the logic, doubled retract/recover moves are ignored. * - * Note: Auto-retract will apply the set Z hop in addition to any Z hop + * NOTE: Auto-retract will apply the set Z hop in addition to any Z hop * included in the G-code. Use M207 Z0 to to prevent double hop. */ void FWRetract::retract(const bool retracting E_OPTARG(bool swapping/*=false*/)) { @@ -141,8 +141,8 @@ void FWRetract::retract(const bool retracting E_OPTARG(bool swapping/*=false*/)) ); // Is a Z hop set, and has the hop not yet been done? - if (!current_hop && settings.retract_zraise > 0.01f) { // Apply hop only once - current_hop += settings.retract_zraise; // Add to the hop total (again, only once) + if (!current_hop && settings.retract_zraise > 0.01f) { // Apply hop only once + current_hop += settings.retract_zraise; // Add to the hop total (again, only once) // Raise up, set_current_to_destination. Maximum Z feedrate prepare_internal_move_to_destination(fr_max_z); } @@ -157,8 +157,8 @@ void FWRetract::retract(const bool retracting E_OPTARG(bool swapping/*=false*/)) const float extra_recover = swapping ? settings.swap_retract_recover_extra : settings.retract_recover_extra; if (extra_recover) { - current_position.e -= extra_recover; // Adjust the current E position by the extra amount to recover - sync_plan_position_e(); // Sync the planner position so the extra amount is recovered + current_position.e -= extra_recover; // Adjust the current E position by the extra amount to recover + sync_plan_position_e(); // Sync the planner position so the extra amount is recovered } current_retract[active_extruder] = 0; @@ -169,9 +169,9 @@ void FWRetract::retract(const bool retracting E_OPTARG(bool swapping/*=false*/)) ); } - TERN_(RETRACT_SYNC_MIXING, mixer.T(old_mixing_tool)); // Restore original mixing tool + TERN_(RETRACT_SYNC_MIXING, mixer.T(old_mixing_tool)); // Restore original mixing tool - retracted.set(active_extruder, retracting); // Active extruder now retracted / recovered + retracted.set(active_extruder, retracting); // Active extruder now retracted / recovered // If swap retract/recover update the retracted_swap flag too #if HAS_MULTI_EXTRUDER @@ -252,7 +252,7 @@ void FWRetract::M208_report() { /** * M209: Enable automatic retract (M209 S1) * For slicers that don't support G10/11, reversed extrude-only - * moves will be classified as retraction. + * moves will be classified as retraction */ void FWRetract::M209() { if (!parser.seen('S')) return M209_report(); diff --git a/Marlin/src/feature/fwretract.h b/Marlin/src/feature/fwretract.h index db2a62c8d410..59c7053fd1ba 100644 --- a/Marlin/src/feature/fwretract.h +++ b/Marlin/src/feature/fwretract.h @@ -22,7 +22,7 @@ #pragma once /** - * fwretract.h - Define firmware-based retraction interface + * feature/fwretract.h - Define firmware-based retraction interface */ #include "../inc/MarlinConfigPre.h" diff --git a/Marlin/src/feature/host_actions.cpp b/Marlin/src/feature/host_actions.cpp index 538aa92e91e7..5d2887e36358 100644 --- a/Marlin/src/feature/host_actions.cpp +++ b/Marlin/src/feature/host_actions.cpp @@ -20,6 +20,10 @@ * */ +/** + * feature/host_actions.cpp + */ + #include "../inc/MarlinConfig.h" #if ENABLED(HOST_ACTION_COMMANDS) diff --git a/Marlin/src/feature/hotend_idle.cpp b/Marlin/src/feature/hotend_idle.cpp index 050898e3b53b..06958f07e7b4 100644 --- a/Marlin/src/feature/hotend_idle.cpp +++ b/Marlin/src/feature/hotend_idle.cpp @@ -21,6 +21,7 @@ */ /** + * feature/hotend_idle.cpp * Hotend Idle Timeout * Prevent filament in the nozzle from charring and causing a critical jam. */ diff --git a/Marlin/src/feature/hotend_idle.h b/Marlin/src/feature/hotend_idle.h index d215e27bc564..9e8cb25291c5 100644 --- a/Marlin/src/feature/hotend_idle.h +++ b/Marlin/src/feature/hotend_idle.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * feature/hotend_idle.h + */ + #include "../inc/MarlinConfig.h" typedef struct { diff --git a/Marlin/src/feature/joystick.cpp b/Marlin/src/feature/joystick.cpp index acab5d7437a2..19c3e1e8ddac 100644 --- a/Marlin/src/feature/joystick.cpp +++ b/Marlin/src/feature/joystick.cpp @@ -30,7 +30,7 @@ #include "joystick.h" -#include "../inc/MarlinConfig.h" // for pins +#include "../inc/MarlinConfig.h" // For pins #include "../module/planner.h" Joystick joystick; @@ -93,7 +93,7 @@ Joystick joystick; auto _normalize_joy = [](float &axis_jog, const raw_adc_t raw, const raw_adc_t (&joy_limits)[4]) { if (WITHIN(raw, joy_limits[0], joy_limits[3])) { - // within limits, check deadzone + // Within limits, check deadzone if (raw > joy_limits[2]) axis_jog = (raw - joy_limits[2]) / float(joy_limits[3] - joy_limits[2]); else if (raw < joy_limits[1]) @@ -156,7 +156,7 @@ Joystick joystick; #endif // Other non-joystick poll-based jogging could be implemented here - // with "jogging" encapsulated as a more general class. + // with "jogging" encapsulated as a more general class TERN_(EXTENSIBLE_UI, ExtUI::_joystick_update(norm_jog)); diff --git a/Marlin/src/feature/max7219.cpp b/Marlin/src/feature/max7219.cpp index 64960f1dfe73..cf7fa0b1b6fd 100644 --- a/Marlin/src/feature/max7219.cpp +++ b/Marlin/src/feature/max7219.cpp @@ -21,6 +21,7 @@ */ /** + * feature/max7219.cpp * This module is off by default, but can be enabled to facilitate the display of * extra debug information during code development. * @@ -95,7 +96,7 @@ Max7219 max7219; uint8_t Max7219::led_line[MAX7219_LINES]; // = { 0 }; -uint8_t Max7219::suspended; // = 0; +uint8_t Max7219::suspended; // = 0; #define LINE_REG(Q) (max7219_reg_digit0 + ((Q) & 0x7)) @@ -145,7 +146,7 @@ uint8_t Max7219::suspended; // = 0; #define BIT_7219(X,Y) TEST(led_line[LED_IND(X,Y)], LED_BIT(X,Y)) #ifdef CPU_32_BIT - #define SIG_DELAY() DELAY_US(1) // Approximate a 1µs delay on 32-bit ARM + #define SIG_DELAY() DELAY_US(1) // Approximate a 1µs delay on 32-bit ARM #undef CRITICAL_SECTION_START #undef CRITICAL_SECTION_END #define CRITICAL_SECTION_START() NOOP @@ -167,10 +168,10 @@ void Max7219::error(FSTR_P const func, const int32_t v1, const int32_t v2/*=-1*/ /** * Flip the lowest n_bytes of the supplied bits: - * flipped(x, 1) flips the low 8 bits of x. - * flipped(x, 2) flips the low 16 bits of x. - * flipped(x, 3) flips the low 24 bits of x. - * flipped(x, 4) flips the low 32 bits of x. + * flipped(x, 1) flips the low 8 bits of x + * flipped(x, 2) flips the low 16 bits of x + * flipped(x, 3) flips the low 24 bits of x + * flipped(x, 4) flips the low 32 bits of x */ inline uint32_t flipped(const uint32_t bits, const uint8_t n_bytes) { uint32_t mask = 1, outbits = 0; @@ -201,11 +202,11 @@ void Max7219::putbyte(uint8_t data) { CRITICAL_SECTION_START(); for (uint8_t i = 8; i--;) { SIG_DELAY(); - WRITE(MAX7219_CLK_PIN, LOW); // tick + WRITE(MAX7219_CLK_PIN, LOW); // Tick SIG_DELAY(); - WRITE(MAX7219_DIN_PIN, (data & 0x80) ? HIGH : LOW); // send 1 or 0 based on data bit + WRITE(MAX7219_DIN_PIN, (data & 0x80) ? HIGH : LOW); // Send 1 or 0 based on data bit SIG_DELAY(); - WRITE(MAX7219_CLK_PIN, HIGH); // tock + WRITE(MAX7219_CLK_PIN, HIGH); // Tock SIG_DELAY(); data <<= 1; } @@ -214,7 +215,7 @@ void Max7219::putbyte(uint8_t data) { void Max7219::pulse_load() { SIG_DELAY(); - WRITE(MAX7219_LOAD_PIN, LOW); // tell the chip to load the data + WRITE(MAX7219_LOAD_PIN, LOW); // Tell the chip to load the data SIG_DELAY(); WRITE(MAX7219_LOAD_PIN, HIGH); SIG_DELAY(); @@ -224,9 +225,9 @@ void Max7219::send(const uint8_t reg, const uint8_t data) { SIG_DELAY(); CRITICAL_SECTION_START(); SIG_DELAY(); - putbyte(reg); // specify register + putbyte(reg); // Specify register SIG_DELAY(); - putbyte(data); // put data + putbyte(data); // Put data CRITICAL_SECTION_END(); } @@ -275,7 +276,7 @@ void Max7219::set(const uint8_t line, const uint8_t bits) { max7219_reg_digit0 + start + size, minus ? led_minus : blank ? 0x00 : led_numeral[value % 10] | (dec ? led_decimal : 0x00) ); - pulse_load(); // tell the chips to load the clocked out data + pulse_load(); // Tell the chips to load the clocked out data value /= 10; if (!value && !leadzero) blank = true; dec = false; @@ -368,9 +369,9 @@ void Max7219::clear_column(const uint8_t col) { } /** - * Plot the low order bits of val to the specified row of the matrix. + * Plot the low order bits of val to the specified row of the matrix * With 4 Max7219 units in the chain, it's possible to set 32 bits at - * once with a single call to the function (if rotated 90° or 270°). + * once with a single call to the function (if rotated 90° or 270°) */ void Max7219::set_row(const uint8_t row, const uint32_t val) { if (row >= MAX7219_Y_LEDS) return error(F("set_row"), row); @@ -383,9 +384,9 @@ void Max7219::set_row(const uint8_t row, const uint32_t val) { } /** - * Plot the low order bits of val to the specified column of the matrix. + * Plot the low order bits of val to the specified column of the matrix * With 4 Max7219 units in the chain, it's possible to set 32 bits at - * once with a single call to the function (if rotated 0° or 180°). + * once with a single call to the function (if rotated 0° or 180°) */ void Max7219::set_column(const uint8_t col, const uint32_t val) { if (col >= MAX7219_X_LEDS) return error(F("set_column"), col); @@ -419,7 +420,7 @@ void Max7219::set_rows_32bits(const uint8_t y, uint32_t val) { if (y > MAX7219_Y_LEDS - 2) return error(F("set_rows_32bits"), y, val); set_row(y + 1, val); val >>= 16; set_row(y + 0, val); - #else // at least 24 bits on each row. In the 3 matrix case, just display the low 24 bits + #else // At least 24 bits on each row. In the 3 matrix case, just display the low 24 bits if (y > MAX7219_Y_LEDS - 1) return error(F("set_rows_32bits"), y, val); set_row(y, val); #endif @@ -447,7 +448,7 @@ void Max7219::set_columns_32bits(const uint8_t x, uint32_t val) { if (x > MAX7219_X_LEDS - 2) return error(F("set_rows_32bits"), x, val); set_column(x + 1, val); val >>= 16; set_column(x + 0, val); - #else // at least 24 bits on each row. In the 3 matrix case, just display the low 24 bits + #else // At least 24 bits on each row. In the 3 matrix case, just display the low 24 bits if (x > MAX7219_X_LEDS - 1) return error(F("set_rows_32bits"), x, val); set_column(x, val); #endif @@ -598,18 +599,18 @@ void Max7219::init() { /** * This code demonstrates some simple debugging using a single 8x8 LED Matrix. If your feature could * benefit from matrix display, add its code here. Very little processing is required, so the 7219 is - * ideal for debugging when realtime feedback is important but serial output can't be used. + * ideal for debugging when realtime feedback is important but serial output can't be used */ // Apply changes to update a marker void Max7219::mark16(const uint8_t pos, const uint8_t v1, const uint8_t v2, uint8_t * const rcm/*=nullptr*/) { - #if MAX7219_X_LEDS > 8 // At least 16 LEDs on the X-Axis. Use single line. + #if MAX7219_X_LEDS > 8 // At least 16 LEDs on the X-Axis. Use single line led_off(v1 & 0xF, pos, rcm); led_on(v2 & 0xF, pos, rcm); - #elif MAX7219_Y_LEDS > 8 // At least 16 LEDs on the Y-Axis. Use a single column. + #elif MAX7219_Y_LEDS > 8 // At least 16 LEDs on the Y-Axis. Use a single column led_off(pos, v1 & 0xF, rcm); led_on(pos, v2 & 0xF, rcm); - #else // Single 8x8 LED matrix. Use two lines to get 16 LEDs. + #else // Single 8x8 LED matrix. Use two lines to get 16 LEDs led_off(v1 & 0x7, pos + (v1 >= 8), rcm); led_on(v2 & 0x7, pos + (v2 >= 8), rcm); #endif @@ -618,17 +619,17 @@ void Max7219::mark16(const uint8_t pos, const uint8_t v1, const uint8_t v2, uint // Apply changes to update a tail-to-head range void Max7219::range16(const uint8_t y, const uint8_t ot, const uint8_t nt, const uint8_t oh, const uint8_t nh, uint8_t * const rcm/*=nullptr*/) { - #if MAX7219_X_LEDS > 8 // At least 16 LEDs on the X-Axis. Use single line. + #if MAX7219_X_LEDS > 8 // At least 16 LEDs on the X-Axis. Use single line if (ot != nt) for (uint8_t n = ot & 0xF; n != (nt & 0xF) && n != (nh & 0xF); n = (n + 1) & 0xF) led_off(n & 0xF, y, rcm); if (oh != nh) for (uint8_t n = (oh + 1) & 0xF; n != ((nh + 1) & 0xF); n = (n + 1) & 0xF) led_on(n & 0xF, y, rcm); - #elif MAX7219_Y_LEDS > 8 // At least 16 LEDs on the Y-Axis. Use a single column. + #elif MAX7219_Y_LEDS > 8 // At least 16 LEDs on the Y-Axis. Use a single column if (ot != nt) for (uint8_t n = ot & 0xF; n != (nt & 0xF) && n != (nh & 0xF); n = (n + 1) & 0xF) led_off(y, n & 0xF, rcm); if (oh != nh) for (uint8_t n = (oh + 1) & 0xF; n != ((nh + 1) & 0xF); n = (n + 1) & 0xF) led_on(y, n & 0xF, rcm); - #else // Single 8x8 LED matrix. Use two lines to get 16 LEDs. + #else // Single 8x8 LED matrix. Use two lines to get 16 LEDs. if (ot != nt) for (uint8_t n = ot & 0xF; n != (nt & 0xF) && n != (nh & 0xF); n = (n + 1) & 0xF) led_off(n & 0x7, y + (n >= 8), rcm); if (oh != nh) for (uint8_t n = (oh + 1) & 0xF; n != ((nh + 1) & 0xF); n = (n + 1) & 0xF) @@ -641,9 +642,9 @@ void Max7219::quantity(const uint8_t pos, const uint8_t ov, const uint8_t nv, ui for (uint8_t i = _MIN(nv, ov); i < _MAX(nv, ov); i++) led_set( #if MAX7219_X_LEDS >= MAX7219_Y_LEDS - i, pos // Single matrix or multiple matrices in Landscape + i, pos // Single matrix or multiple matrices in Landscape #else - pos, i // Multiple matrices in Portrait + pos, i // Multiple matrices in Portrait #endif , nv >= ov , rcm @@ -653,11 +654,11 @@ void Max7219::quantity(const uint8_t pos, const uint8_t ov, const uint8_t nv, ui void Max7219::quantity16(const uint8_t pos, const uint8_t ov, const uint8_t nv, uint8_t * const rcm/*=nullptr*/) { for (uint8_t i = _MIN(nv, ov); i < _MAX(nv, ov); i++) led_set( - #if MAX7219_X_LEDS > 8 // At least 16 LEDs on the X-Axis. Use single line. + #if MAX7219_X_LEDS > 8 // At least 16 LEDs on the X-Axis. Use single line i, pos - #elif MAX7219_Y_LEDS > 8 // At least 16 LEDs on the Y-Axis. Use a single column. + #elif MAX7219_Y_LEDS > 8 // At least 16 LEDs on the Y-Axis. Use a single column pos, i - #else // Single 8x8 LED matrix. Use two lines to get 16 LEDs. + #else // Single 8x8 LED matrix. Use two lines to get 16 LEDs i >> 1, pos + (i & 1) #endif , nv >= ov @@ -693,7 +694,7 @@ void Max7219::idle_tasks() { // Some Max7219 units are vulnerable to electrical noise, especially // with long wires next to high current wires. If the display becomes - // corrupted, this will fix it within a couple seconds. + // corrupted, this will fix it within a couple seconds if (do_blink && ++refresh_cnt >= refresh_limit) { refresh_cnt = 0; register_setup(); @@ -782,7 +783,7 @@ void Max7219::idle_tasks() { } #endif - // batch line updates + // Batch line updates suspended--; if (!suspended) for (uint8_t i = 0; i < 8; ++i) if (row_change_mask & _BV(i)) diff --git a/Marlin/src/feature/max7219.h b/Marlin/src/feature/max7219.h index a6b110fdf4c9..95da3e367b60 100644 --- a/Marlin/src/feature/max7219.h +++ b/Marlin/src/feature/max7219.h @@ -22,6 +22,7 @@ #pragma once /** + * feature/max7219.h * This module is off by default, but can be enabled to facilitate the display of * extra debug information during code development. * diff --git a/Marlin/src/feature/meatpack.cpp b/Marlin/src/feature/meatpack.cpp index fe3dabe8da53..b453677b0e35 100644 --- a/Marlin/src/feature/meatpack.cpp +++ b/Marlin/src/feature/meatpack.cpp @@ -21,6 +21,7 @@ */ /** + * feature/meatpack.cpp * MeatPack G-code Compression * * Algorithm & Implementation: Scott Mudge - mail@scottmudge.com diff --git a/Marlin/src/feature/meatpack.h b/Marlin/src/feature/meatpack.h index 0de1f792c139..c3fc8b3c7422 100644 --- a/Marlin/src/feature/meatpack.h +++ b/Marlin/src/feature/meatpack.h @@ -20,7 +20,10 @@ * */ +#pragma once + /** + * feature/meatpack.h * MeatPack G-code Compression * * Algorithm & Implementation: Scott Mudge - mail@scottmudge.com @@ -46,7 +49,6 @@ * ware like OctoPrint would also suffer this same micro-stuttering and poor print quality issue. * */ -#pragma once #include #include "../core/serial_hook.h" diff --git a/Marlin/src/feature/mixing.cpp b/Marlin/src/feature/mixing.cpp index 4021393f18e6..b392754fe876 100644 --- a/Marlin/src/feature/mixing.cpp +++ b/Marlin/src/feature/mixing.cpp @@ -20,6 +20,10 @@ * */ +/** + * feature/mixing.cpp + */ + #include "../inc/MarlinConfig.h" #if ENABLED(MIXING_EXTRUDER) diff --git a/Marlin/src/feature/mixing.h b/Marlin/src/feature/mixing.h index c0f45e364ab4..ee1827f93042 100644 --- a/Marlin/src/feature/mixing.h +++ b/Marlin/src/feature/mixing.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * feature/mixing.h + */ + #include "../inc/MarlinConfig.h" //#define MIXER_NORMALIZER_DEBUG @@ -62,14 +66,14 @@ static_assert(NR_MIXING_VIRTUAL_TOOLS <= MAX_VTOOLS, "MIXING_VIRTUAL_TOOLS must #if ENABLED(GRADIENT_MIX) typedef struct { - bool enabled; // This gradient is enabled - mixer_comp_t color[MIXING_STEPPERS]; // The current gradient color - float start_z, end_z; // Region for gradient - int8_t start_vtool, end_vtool; // Start and end virtual tools - mixer_perc_t start_mix[MIXING_STEPPERS], // Start and end mixes from those tools + bool enabled; // This gradient is enabled + mixer_comp_t color[MIXING_STEPPERS]; // The current gradient color + float start_z, end_z; // Region for gradient + int8_t start_vtool, end_vtool; // Start and end virtual tools + mixer_perc_t start_mix[MIXING_STEPPERS], // Start and end mixes from those tools end_mix[MIXING_STEPPERS]; #if ENABLED(GRADIENT_VTOOL) - int8_t vtool_index; // Use this virtual tool number as index + int8_t vtool_index; // Use this virtual tool number as index #endif } gradient_t; @@ -82,7 +86,7 @@ static_assert(NR_MIXING_VIRTUAL_TOOLS <= MAX_VTOOLS, "MIXING_VIRTUAL_TOOLS must class Mixer { public: - static float collector[MIXING_STEPPERS]; // M163 components, also editable from LCD + static float collector[MIXING_STEPPERS]; // M163 components, also editable from LCD static void init(); // Populate colors at boot time @@ -120,7 +124,7 @@ class Mixer { #if ANY(HAS_DUAL_MIXING, GRADIENT_MIX) - static mixer_perc_t mix[MIXING_STEPPERS]; // Scratch array for the Mix in proportion to 100 + static mixer_perc_t mix[MIXING_STEPPERS]; // Scratch array for the Mix in proportion to 100 static void copy_mix_to_color(mixer_comp_t (&tcolor)[MIXING_STEPPERS]) { // Scale each component to the largest one in terms of COLOR_A_MASK diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index 74a4f236c0a9..ba3a25c83a40 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -24,7 +24,7 @@ * feature/pause.cpp - Pause feature support functions * This may be combined with related G-codes if features are consolidated. * - * Note: Calls to ui.pause_show_message are passed to either ExtUI or MarlinUI. + * NOTE: Calls to ui.pause_show_message are passed to either ExtUI or MarlinUI. */ #include "../inc/MarlinConfigPre.h" @@ -201,7 +201,7 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load first_impatient_beep(max_beep_count); KEEPALIVE_STATE(PAUSED_FOR_USER); - wait_for_user = true; // LCD click or M108 will clear this + wait_for_user = true; // LCD click or M108 will clear this TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENTLOAD))); @@ -255,7 +255,7 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load #endif } - #if ENABLED(DUAL_X_CARRIAGE) // Tie the two extruders movement back together. + #if ENABLED(DUAL_X_CARRIAGE) // Tie the two extruders movement back together set_duplication_enabled(saved_ext_dup_mode, saved_ext); #endif @@ -312,7 +312,7 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load /** * Disabling E steppers for manual filament change should be fine * as long as users don't spin the E motor ridiculously fast and - * send current back to their board, potentially frying it. + * send current back to their board, potentially frying it */ inline void disable_active_extruder() { #if HAS_EXTRUDERS @@ -404,7 +404,7 @@ bool pause_print(const_float_t retract, const xyz_pos_t &park_point, const bool DEBUG_SECTION(pp, "pause_print", true); DEBUG_ECHOLNPGM("... park.x:", park_point.x, " y:", park_point.y, " z:", park_point.z, " unloadlen:", unload_length, " showlcd:", show_lcd DXC_SAY); - if (did_pause_print) return false; // already paused + if (did_pause_print) return false; // Already paused #if ENABLED(HOST_ACTION_COMMANDS) #ifdef ACTION_ON_PAUSED @@ -454,13 +454,13 @@ bool pause_print(const_float_t retract, const xyz_pos_t &park_point, const bool DEBUG_ECHOLNPGM("... retract:", retract); #if ENABLED(AUTO_BED_LEVELING_UBL) - const bool leveling_was_enabled = planner.leveling_active; // save leveling state - set_bed_leveling_enabled(false); // turn off leveling + const bool leveling_was_enabled = planner.leveling_active; // Save leveling state + set_bed_leveling_enabled(false); // Turn off leveling #endif unscaled_e_move(retract, PAUSE_PARK_RETRACT_FEEDRATE); - TERN_(AUTO_BED_LEVELING_UBL, set_bed_leveling_enabled(leveling_was_enabled)); // restore leveling + TERN_(AUTO_BED_LEVELING_UBL, set_bed_leveling_enabled(leveling_was_enabled)); // Restore leveling } // If axes don't need to home then the nozzle can park @@ -532,7 +532,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep KEEPALIVE_STATE(PAUSED_FOR_USER); TERN_(HOST_PROMPT_SUPPORT, hostui.continue_prompt(GET_TEXT_F(MSG_NOZZLE_PARKED))); TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_NOZZLE_PARKED))); - wait_for_user = true; // LCD click or M108 will clear this + wait_for_user = true; // LCD click or M108 will clear this while (wait_for_user) { impatient_beep(max_beep_count); @@ -663,14 +663,14 @@ void resume_print(const_float_t slow_load_length/*=0*/, const_float_t fast_load_ } #if ENABLED(AUTO_BED_LEVELING_UBL) - const bool leveling_was_enabled = planner.leveling_active; // save leveling state - set_bed_leveling_enabled(false); // turn off leveling + const bool leveling_was_enabled = planner.leveling_active; // Save leveling state + set_bed_leveling_enabled(false); // Turn off leveling #endif // Unretract unscaled_e_move(PAUSE_PARK_RETRACT_LENGTH, feedRate_t(PAUSE_PARK_RETRACT_FEEDRATE)); - TERN_(AUTO_BED_LEVELING_UBL, set_bed_leveling_enabled(leveling_was_enabled)); // restore leveling + TERN_(AUTO_BED_LEVELING_UBL, set_bed_leveling_enabled(leveling_was_enabled)); // Restore leveling // Intelligent resuming #if ENABLED(FWRETRACT) diff --git a/Marlin/src/feature/pause.h b/Marlin/src/feature/pause.h index 4d968406c272..6bdb7a6d66f1 100644 --- a/Marlin/src/feature/pause.h +++ b/Marlin/src/feature/pause.h @@ -23,7 +23,7 @@ /** * feature/pause.h - Pause feature support functions - * This may be combined with related G-codes if features are consolidated. + * This may be combined with related G-codes if features are consolidated */ #include "../inc/MarlinConfigPre.h" @@ -91,45 +91,45 @@ extern uint8_t did_pause_print; // Pause the print. If unload_length is set, do a Filament Unload bool pause_print( - const_float_t retract, // (mm) Retraction length - const xyz_pos_t &park_point, // Parking XY Position and Z Raise - const bool show_lcd=false, // Set LCD status messages? - const_float_t unload_length=0 // (mm) Filament Change Unload Length - 0 to skip - DXC_PARAMS // Dual-X-Carriage extruder index + const_float_t retract, // (mm) Retraction length + const xyz_pos_t &park_point, // Parking XY Position and Z Raise + const bool show_lcd=false, // Set LCD status messages? + const_float_t unload_length=0 // (mm) Filament Change Unload Length - 0 to skip + DXC_PARAMS // Dual-X-Carriage extruder index ); void wait_for_confirmation( - const bool is_reload=false, // Reload Filament? (otherwise Resume Print) - const int8_t max_beep_count=0 // Beep alert for attention - DXC_PARAMS // Dual-X-Carriage extruder index + const bool is_reload=false, // Reload Filament? (otherwise Resume Print) + const int8_t max_beep_count=0 // Beep alert for attention + DXC_PARAMS // Dual-X-Carriage extruder index ); void resume_print( - const_float_t slow_load_length=0, // (mm) Slow Load Length for finishing move - const_float_t fast_load_length=0, // (mm) Fast Load Length for initial move - const_float_t purge_length=ADVANCED_PAUSE_PURGE_LENGTH, // (mm) Purge length - const int8_t max_beep_count=0, // Beep alert for attention - const celsius_t targetTemp=0 // (°C) A target temperature for the hotend - DXC_PARAMS // Dual-X-Carriage extruder index + const_float_t slow_load_length=0, // (mm) Slow Load Length for finishing move + const_float_t fast_load_length=0, // (mm) Fast Load Length for initial move + const_float_t purge_length=ADVANCED_PAUSE_PURGE_LENGTH, // (mm) Purge length + const int8_t max_beep_count=0, // Beep alert for attention + const celsius_t targetTemp=0 // (°C) A target temperature for the hotend + DXC_PARAMS // Dual-X-Carriage extruder index ); bool load_filament( - const_float_t slow_load_length=0, // (mm) Slow Load Length for finishing move - const_float_t fast_load_length=0, // (mm) Fast Load Length for initial move - const_float_t purge_length=0, // (mm) Purge length - const int8_t max_beep_count=0, // Beep alert for attention - const bool show_lcd=false, // Set LCD status messages? - const bool pause_for_user=false, // Pause for user before returning? - const PauseMode mode=PAUSE_MODE_PAUSE_PRINT // Pause Mode to apply - DXC_PARAMS // Dual-X-Carriage extruder index + const_float_t slow_load_length=0, // (mm) Slow Load Length for finishing move + const_float_t fast_load_length=0, // (mm) Fast Load Length for initial move + const_float_t purge_length=0, // (mm) Purge length + const int8_t max_beep_count=0, // Beep alert for attention + const bool show_lcd=false, // Set LCD status messages? + const bool pause_for_user=false, // Pause for user before returning? + const PauseMode mode=PAUSE_MODE_PAUSE_PRINT // Pause Mode to apply + DXC_PARAMS // Dual-X-Carriage extruder index ); bool unload_filament( - const_float_t unload_length, // (mm) Filament Unload Length - 0 to skip - const bool show_lcd=false, // Set LCD status messages? - const PauseMode mode=PAUSE_MODE_PAUSE_PRINT // Pause Mode to apply + const_float_t unload_length, // (mm) Filament Unload Length - 0 to skip + const bool show_lcd=false, // Set LCD status messages? + const PauseMode mode=PAUSE_MODE_PAUSE_PRINT // Pause Mode to apply #if ALL(FILAMENT_UNLOAD_ALL_EXTRUDERS, MIXING_EXTRUDER) - , const_float_t mix_multiplier=1.0f // Extrusion multiplier (for a Mixing Extruder) + , const_float_t mix_multiplier=1.0f // Extrusion multiplier (for a Mixing Extruder) #endif ); diff --git a/Marlin/src/feature/power.cpp b/Marlin/src/feature/power.cpp index 20eb63a6f160..351264a9019f 100644 --- a/Marlin/src/feature/power.cpp +++ b/Marlin/src/feature/power.cpp @@ -73,13 +73,13 @@ bool Power::psu_on; * */ void Power::init() { - psu_on = ENABLED(PSU_DEFAULT_OFF); // Set opposite state to get full power_off/on + psu_on = ENABLED(PSU_DEFAULT_OFF); // Set opposite state to get full power_off/on TERN(PSU_DEFAULT_OFF, power_off(), power_on()); } /** - * Power on if the power is currently off. - * Restores stepper drivers and processes any PSU_POWERUP_GCODE. + * Power on if the power is currently off + * Restores stepper drivers and processes any PSU_POWERUP_GCODE * */ void Power::power_on() { @@ -115,8 +115,8 @@ void Power::power_on() { } /** - * Power off if the power is currently on. - * Processes any PSU_POWEROFF_GCODE and makes a PS_OFF_SOUND if enabled. + * Power off if the power is currently on + * Processes any PSU_POWEROFF_GCODE and makes a PS_OFF_SOUND if enabled */ void Power::power_off() { TERN_(HAS_SUICIDE, suicide()); @@ -199,9 +199,9 @@ void Power::power_off() { #endif /** - * Check all conditions that would signal power needing to be on. + * Check all conditions that would signal power needing to be on * - * @returns bool if power is needed + * @returns bool - If power is needed */ bool Power::is_power_needed() { @@ -242,9 +242,9 @@ void Power::power_off() { } /** - * Check if we should power off automatically (POWER_TIMEOUT elapsed, !is_power_needed). + * Check if we should power off automatically (POWER_TIMEOUT elapsed, !is_power_needed) * - * @param pause pause the 'timer' + * @param pause - Pause the 'timer' */ void Power::check(const bool pause) { static millis_t nextPowerCheck = 0; @@ -269,7 +269,7 @@ void Power::power_off() { #if POWER_OFF_DELAY > 0 /** - * Power off with a delay. Power off is triggered by check() after the delay. + * Power off with a delay. Power off is triggered by check() after the delay */ void Power::power_off_soon() { lastPowerOn = millis() - SEC_TO_MS(POWER_TIMEOUT) + SEC_TO_MS(POWER_OFF_DELAY); diff --git a/Marlin/src/feature/power.h b/Marlin/src/feature/power.h index 16f9dbcef54f..69f5d66e020a 100644 --- a/Marlin/src/feature/power.h +++ b/Marlin/src/feature/power.h @@ -24,6 +24,7 @@ /** * power.h - power control */ + #if PIN_EXISTS(PS_ON_EDM) || (PIN_EXISTS(PS_ON1_EDM) && ENABLED(PSU_OFF_REDUNDANT)) #define PSU_TRACK_STATE_MS 1 #endif diff --git a/Marlin/src/feature/power_monitor.cpp b/Marlin/src/feature/power_monitor.cpp index e3c3e58fc412..360837b9389a 100644 --- a/Marlin/src/feature/power_monitor.cpp +++ b/Marlin/src/feature/power_monitor.cpp @@ -20,6 +20,10 @@ * */ +/** + * feature/power_monitor.cpp + */ + #include "../inc/MarlinConfigPre.h" #if HAS_POWER_MONITOR diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp index cd5fc13ddab3..b9d609e40628 100644 --- a/Marlin/src/feature/powerloss.cpp +++ b/Marlin/src/feature/powerloss.cpp @@ -76,7 +76,7 @@ uint32_t PrintJobRecovery::cmd_sdpos, // = 0 PrintJobRecovery recovery; #if DISABLED(BACKUP_POWER_SUPPLY) - #undef POWER_LOSS_RETRACT_LEN // No retract at outage without backup power + #undef POWER_LOSS_RETRACT_LEN // No retract at outage without backup power #endif #ifndef POWER_LOSS_RETRACT_LEN #define POWER_LOSS_RETRACT_LEN 0 @@ -161,7 +161,7 @@ void PrintJobRecovery::load() { * Set info fields that won't change */ void PrintJobRecovery::prepare() { - card.getAbsFilenameInCWD(info.sd_filename); // SD filename + card.getAbsFilenameInCWD(info.sd_filename); // SD filename cmd_sdpos = 0; } @@ -178,13 +178,13 @@ void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=POW #endif #ifndef POWER_LOSS_MIN_Z_CHANGE - #define POWER_LOSS_MIN_Z_CHANGE 0.05 // Vase-mode-friendly out of the box + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // Vase-mode-friendly out of the box #endif // Did Z change since the last call? if (force - #if DISABLED(SAVE_EACH_CMD_MODE) // Always save state when enabled - #if SAVE_INFO_INTERVAL_MS > 0 // Save if interval is elapsed + #if DISABLED(SAVE_EACH_CMD_MODE) // Always save state when enabled + #if SAVE_INFO_INTERVAL_MS > 0 // Save if interval is elapsed || ELAPSED(ms, next_save_ms) #endif // Save if Z is above the last-saved position by some minimum height @@ -197,7 +197,7 @@ void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=POW #endif // Set Head and Foot to matching non-zero values - if (!++info.valid_head) ++info.valid_head; // non-zero in sequence + if (!++info.valid_head) ++info.valid_head; // Non-zero in sequence //if (!IS_SD_PRINTING()) info.valid_head = 0; info.valid_foot = info.valid_head; @@ -209,7 +209,7 @@ void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=POW COPY(info.flow_percentage, planner.flow_percentage); info.zraise = zraise; - info.flag.raised = raised; // Was Z raised before power-off? + info.flag.raised = raised; // Was Z raised before power-off? TERN_(GCODE_REPEAT_MARKERS, info.stored_repeat = repeat); TERN_(HAS_HOME_OFFSET, info.home_offset = home_offset); @@ -268,7 +268,7 @@ void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=POW void PrintJobRecovery::retract_and_lift(const_float_t zraise) { #if POWER_LOSS_RETRACT_LEN || POWER_LOSS_ZRAISE - gcode.set_relative_mode(true); // Use relative coordinates + gcode.set_relative_mode(true); // Use relative coordinates #if POWER_LOSS_RETRACT_LEN // Retract filament now @@ -320,7 +320,7 @@ void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=POW #endif // Save the current position, distance that Z was (or should be) raised, - // and a flag whether the raise was already done here. + // and a flag whether the raise was already done here if (IS_SD_PRINTING()) save(true, zraise, ENABLED(BACKUP_POWER_SUPPLY)); // Tell the LCD about the outage, even though it is about to die @@ -418,10 +418,10 @@ void PrintJobRecovery::resume() { const float z_print = resume_pos.z, z_raised = z_print + info.zraise; - // - // Home the axes that can safely be homed, and - // establish the current position as best we can. - // + /** + * Home the axes that can safely be homed, and + * establish the current position as best we can + */ PROCESS_SUBCOMMANDS_NOW(F("G92.9E0")); // Reset E to 0 @@ -431,8 +431,8 @@ void PrintJobRecovery::resume() { // If Z homing goes to max then just move back to the "raised" position PROCESS_SUBCOMMANDS_NOW(TS( - F( "G28R0\n" // Home all axes (no raise) - "G1F1200Z") // Move Z down to (raised) height + F( "G28R0\n" // Home all axes (no raise) + "G1F1200Z") // Move Z down to (raised) height , p_float_t(z_now, 3) )); @@ -449,7 +449,7 @@ void PrintJobRecovery::resume() { PROCESS_SUBCOMMANDS_NOW(TS(F("G92.9Z"), p_float_t(z_now, 3))); #endif - // Does Z need to be raised now? It should be raised before homing XY. + // Does Z need to be raised now? It should be raised before homing XY if (z_raised > z_now) { z_now = z_raised; PROCESS_SUBCOMMANDS_NOW(TS(F("G1F600Z"), p_float_t(z_now, 3))); @@ -461,7 +461,7 @@ void PrintJobRecovery::resume() { #endif #if HOMING_Z_DOWN - // Move to a safe XY position and home Z while avoiding the print. + // Move to a safe XY position and home Z while avoiding the print const xy_pos_t p = xy_pos_t(POWER_LOSS_ZHOME_POS) TERN_(HOMING_Z_WITH_PROBE, - probe.offset_xy); PROCESS_SUBCOMMANDS_NOW(TS(F("G1F1000X"), p_float_t(p.x, 3), 'Y', p_float_t(p.y, 3), F("\nG28HZ"))); #endif @@ -470,19 +470,19 @@ void PrintJobRecovery::resume() { set_all_homed(); #if HAS_LEVELING - // Restore Z fade and possibly re-enable bed leveling compensation. - // Leveling may already be enabled due to the ENABLE_LEVELING_AFTER_G28 option. - // TODO: Add a G28 parameter to leave leveling disabled. + // Restore Z fade and possibly re-enable bed leveling compensation + // Leveling may already be enabled due to the ENABLE_LEVELING_AFTER_G28 option + // TODO: Add a G28 parameter to leave leveling disabled PROCESS_SUBCOMMANDS_NOW(TS(F("M420S"), '0' + (char)info.flag.leveling, 'Z', p_float_t(info.fade, 1))); #if !HOMING_Z_DOWN - // The physical Z was adjusted at power-off so undo the M420S1 correction to Z with G92.9. + // The physical Z was adjusted at power-off so undo the M420S1 correction to Z with G92.9 PROCESS_SUBCOMMANDS_NOW(TS(F("G92.9Z"), p_float_t(z_now, 1))); #endif #endif #if ENABLED(POWER_LOSS_RECOVER_ZHOME) - // Z was homed down to the bed, so move up to the raised height. + // Z was homed down to the bed, so move up to the raised height z_now = z_raised; PROCESS_SUBCOMMANDS_NOW(TS(F("G1F600Z"), p_float_t(z_now, 3))); #endif @@ -666,7 +666,7 @@ void PrintJobRecovery::resume() { #endif #if HAS_LEVELING - DEBUG_ECHOLNPGM("leveling: ", info.flag.leveling ? "ON" : "OFF", " fade: ", info.fade); + DEBUG_ECHOLNPGM("leveling: ", info.flag.leveling ? "ON" : "OFF", " fade: ", info.fade); #endif #if ENABLED(FWRETRACT) diff --git a/Marlin/src/feature/probe_temp_comp.cpp b/Marlin/src/feature/probe_temp_comp.cpp index f640a9fd2f71..b956f0f19643 100644 --- a/Marlin/src/feature/probe_temp_comp.cpp +++ b/Marlin/src/feature/probe_temp_comp.cpp @@ -20,11 +20,15 @@ * */ +/** + * feature/probe_temp_comp.cpp + */ + #include "../inc/MarlinConfigPre.h" #if HAS_PTC -//#define DEBUG_PTC // Print extra debug output with 'M871' +//#define DEBUG_PTC // Print extra debug output with 'M871' #include "probe_temp_comp.h" #include @@ -61,7 +65,7 @@ int16_t *ProbeTempComp::sensor_z_offsets[TSI_COUNT] = { constexpr temp_calib_t ProbeTempComp::cali_info[TSI_COUNT]; -uint8_t ProbeTempComp::calib_idx; // = 0 +uint8_t ProbeTempComp::calib_idx; // = 0 float ProbeTempComp::init_measurement; // = 0.0 bool ProbeTempComp::enabled = true; @@ -191,8 +195,7 @@ void ProbeTempComp::compensate_measurement(const TempSensorID tsi, const celsius return p1.y + (p2.y - p1.y) / (p2.x - p1.x) * (x - p1.x); }; - // offset in µm - float offset = 0.0f; + float offset = 0.0f; // (µm) #if PTC_LINEAR_EXTRAPOLATION if (temp < start_temp) @@ -211,7 +214,7 @@ void ProbeTempComp::compensate_measurement(const TempSensorID tsi, const celsius offset = linear_interp(temp, tpoint(idx), tpoint(idx + 1)); } - // convert offset to mm and apply it + // Convert offset to (mm) and apply it meas_z -= offset / 1000.0f; } diff --git a/Marlin/src/feature/probe_temp_comp.h b/Marlin/src/feature/probe_temp_comp.h index 42348db68473..b73bf5d8768e 100644 --- a/Marlin/src/feature/probe_temp_comp.h +++ b/Marlin/src/feature/probe_temp_comp.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * feature/probe_temp_comp.h + */ + #include "../inc/MarlinConfig.h" enum TempSensorID : uint8_t { @@ -37,15 +41,15 @@ enum TempSensorID : uint8_t { }; typedef struct { - uint8_t measurements; // Max. number of measurements to be stored (35 - 80°C) - celsius_t temp_resolution, // Resolution in °C between measurements - start_temp; // Base measurement; z-offset == 0 + uint8_t measurements; // Max. number of measurements to be stored (35 - 80°C) + celsius_t temp_resolution, // Resolution in °C between measurements + start_temp; // Base measurement; z-offset == 0 } temp_calib_t; /** * Probe temperature compensation implementation. * Z-probes like the P.I.N.D.A V2 allow for compensation of - * measurement errors/shifts due to changed temperature. + * measurement errors/shifts due to changed temperature */ class ProbeTempComp { @@ -53,10 +57,10 @@ class ProbeTempComp { static constexpr temp_calib_t cali_info[TSI_COUNT] = { #if ENABLED(PTC_PROBE) - { PTC_PROBE_COUNT, PTC_PROBE_RES, PTC_PROBE_START }, // Probe + { PTC_PROBE_COUNT, PTC_PROBE_RES, PTC_PROBE_START }, // Probe #endif #if ENABLED(PTC_BED) - { PTC_BED_COUNT, PTC_BED_RES, PTC_BED_START }, // Bed + { PTC_BED_COUNT, PTC_BED_RES, PTC_BED_START }, // Bed #endif #if ENABLED(PTC_HOTEND) { PTC_HOTEND_COUNT, PTC_HOTEND_RES, PTC_HOTEND_START }, // Extruder @@ -65,13 +69,13 @@ class ProbeTempComp { static int16_t *sensor_z_offsets[TSI_COUNT]; #if ENABLED(PTC_PROBE) - static int16_t z_offsets_probe[PTC_PROBE_COUNT]; // (µm) + static int16_t z_offsets_probe[PTC_PROBE_COUNT]; // (µm) #endif #if ENABLED(PTC_BED) - static int16_t z_offsets_bed[PTC_BED_COUNT]; // (µm) + static int16_t z_offsets_bed[PTC_BED_COUNT]; // (µm) #endif #if ENABLED(PTC_HOTEND) - static int16_t z_offsets_hotend[PTC_HOTEND_COUNT]; // (µm) + static int16_t z_offsets_hotend[PTC_HOTEND_COUNT]; // (µm) #endif static void reset_index() { calib_idx = 0; }; @@ -100,13 +104,13 @@ class ProbeTempComp { /** * Base value. Temperature compensation values will be deltas - * to this value, set at first probe. + * to this value, set at first probe */ static float init_measurement; /** * Fit a linear function in measured temperature offsets - * to allow generating values of higher temperatures. + * to allow generating values of higher temperatures */ static bool linear_regression(const TempSensorID tsi, float &k, float &d); diff --git a/Marlin/src/feature/repeat.cpp b/Marlin/src/feature/repeat.cpp index 4484dab95b39..30b259480ac4 100644 --- a/Marlin/src/feature/repeat.cpp +++ b/Marlin/src/feature/repeat.cpp @@ -20,6 +20,10 @@ * */ +/** + * feature/repeat.cpp + */ + #include "../inc/MarlinConfig.h" #if ENABLED(GCODE_REPEAT_MARKERS) @@ -50,17 +54,17 @@ void Repeat::add_marker(const uint32_t sdpos, const uint16_t count) { void Repeat::loop() { if (!index) // No marker? - SERIAL_ECHO_MSG("!No marker set."); // Inform the user. + SERIAL_ECHO_MSG("!No marker set."); // Inform the user else { const uint8_t ind = index - 1; // Active marker's index if (!marker[ind].counter) { // Did its counter run out? DEBUG_ECHOLNPGM("Pass Marker ", index); - index--; // Carry on. Previous marker on the next 'M808'. + index--; // Carry on. Previous marker on the next 'M808' } else { - card.setIndex(marker[ind].sdpos); // Loop back to the marker. - if (marker[ind].counter > 0) // Ignore a negative (or zero) counter. - --marker[ind].counter; // Decrement the counter. If zero this 'M808' will be skipped next time. + card.setIndex(marker[ind].sdpos); // Loop back to the marker + if (marker[ind].counter > 0) // Ignore a negative (or zero) counter + --marker[ind].counter; // Decrement the counter. If zero this 'M808' will be skipped next time DEBUG_ECHOLNPGM("Goto Marker ", index, " at ", marker[ind].sdpos, " (", marker[ind].counter, ")"); } } diff --git a/Marlin/src/feature/repeat.h b/Marlin/src/feature/repeat.h index ce309f6470c1..effd594b7dd2 100644 --- a/Marlin/src/feature/repeat.h +++ b/Marlin/src/feature/repeat.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * feature/repeat.h + */ + #include "../inc/MarlinConfigPre.h" #include "../gcode/parser.h" @@ -29,8 +33,8 @@ #define MAX_REPEAT_NESTING 10 typedef struct { - uint32_t sdpos; // The repeat file position - int16_t counter; // The counter for looping + uint32_t sdpos; // The repeat file position + int16_t counter; // The counter for looping } repeat_marker_t; class Repeat { diff --git a/Marlin/src/feature/runout.cpp b/Marlin/src/feature/runout.cpp index 2bcb47e99a83..883e55a2cb24 100644 --- a/Marlin/src/feature/runout.cpp +++ b/Marlin/src/feature/runout.cpp @@ -33,10 +33,10 @@ FilamentMonitor runout; bool FilamentMonitorBase::enabled = true, - FilamentMonitorBase::filament_ran_out; // = false + FilamentMonitorBase::filament_ran_out; // = false #if ENABLED(HOST_ACTION_COMMANDS) - bool FilamentMonitorBase::host_handling; // = false + bool FilamentMonitorBase::host_handling; // = false #endif #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) @@ -55,9 +55,9 @@ bool FilamentMonitorBase::enabled = true, int8_t RunoutResponseDebounced::runout_count[NUM_RUNOUT_SENSORS]; // = 0 #endif -// -// Filament Runout event handler -// +/** + * Filament Runout event handler + */ #include "../MarlinCore.h" #include "../feature/pause.h" #include "../gcode/queue.h" @@ -72,12 +72,12 @@ bool FilamentMonitorBase::enabled = true, void event_filament_runout(const uint8_t extruder) { - if (did_pause_print) return; // Action already in progress. Purge triggered repeated runout. + if (did_pause_print) return; // Action already in progress. Purge triggered repeated runout #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) if (migration.in_progress) { DEBUG_ECHOLNPGM("Migration Already In Progress"); - return; // Action already in progress. Purge triggered repeated runout. + return; // Action already in progress. Purge triggered repeated runout } if (migration.automode) { DEBUG_ECHOLNPGM("Migration Starting"); @@ -91,9 +91,9 @@ void event_filament_runout(const uint8_t extruder) { const char tool = '0' + TERN0(MULTI_FILAMENT_SENSOR, extruder); #endif - //action:out_of_filament + // action:out_of_filament #if ENABLED(HOST_PROMPT_SUPPORT) - hostui.prompt_do(PROMPT_FILAMENT_RUNOUT, F("FilamentRunout T"), tool); //action:out_of_filament + hostui.prompt_do(PROMPT_FILAMENT_RUNOUT, F("FilamentRunout T"), tool); // action:out_of_filament #endif const bool run_runout_script = !runout.host_handling; diff --git a/Marlin/src/feature/runout.h b/Marlin/src/feature/runout.h index c95c39f27387..201580835aa9 100644 --- a/Marlin/src/feature/runout.h +++ b/Marlin/src/feature/runout.h @@ -318,28 +318,28 @@ class FilamentSensorBase { } }; - #endif // HAS_FILAMENT_SWITCH +#endif // HAS_FILAMENT_SWITCH - /** - * This is a simple endstop switch in the path of the filament. - * It can detect filament runout, but not stripouts or jams. - */ - class FilamentSensor : public FilamentSensorBase { - private: - TERN_(HAS_FILAMENT_MOTION, static FilamentSensorEncoder encoder_sensor); - TERN_(HAS_FILAMENT_SWITCH, static FilamentSensorSwitch switch_sensor); +/** + * This is a simple endstop switch in the path of the filament. + * It can detect filament runout, but not stripouts or jams. + */ +class FilamentSensor : public FilamentSensorBase { + private: + TERN_(HAS_FILAMENT_MOTION, static FilamentSensorEncoder encoder_sensor); + TERN_(HAS_FILAMENT_SWITCH, static FilamentSensorSwitch switch_sensor); - public: - static void block_completed(const block_t * const b) { - TERN_(HAS_FILAMENT_MOTION, encoder_sensor.block_completed(b)); - TERN_(HAS_FILAMENT_SWITCH, switch_sensor.block_completed(b)); - } + public: + static void block_completed(const block_t * const b) { + TERN_(HAS_FILAMENT_MOTION, encoder_sensor.block_completed(b)); + TERN_(HAS_FILAMENT_SWITCH, switch_sensor.block_completed(b)); + } - static void run() { - TERN_(HAS_FILAMENT_MOTION, encoder_sensor.run()); - TERN_(HAS_FILAMENT_SWITCH, switch_sensor.run()); - } - }; + static void run() { + TERN_(HAS_FILAMENT_MOTION, encoder_sensor.run()); + TERN_(HAS_FILAMENT_SWITCH, switch_sensor.run()); + } +}; /********************************* RESPONSE TYPE *********************************/ diff --git a/Marlin/src/feature/solenoid.cpp b/Marlin/src/feature/solenoid.cpp index cc4522e30a62..00f31ef19a26 100644 --- a/Marlin/src/feature/solenoid.cpp +++ b/Marlin/src/feature/solenoid.cpp @@ -20,14 +20,18 @@ * */ +/** + * feature/solenoid.cpp + */ + #include "../inc/MarlinConfig.h" #if ANY(EXT_SOLENOID, MANUAL_SOLENOID_CONTROL) #include "solenoid.h" -#include "../module/motion.h" // for active_extruder -#include "../module/tool_change.h" // for parking_extruder_set_parked +#include "../module/motion.h" // For active_extruder +#include "../module/tool_change.h" // For parking_extruder_set_parked // Used primarily with MANUAL_SOLENOID_CONTROL static void set_solenoid(const uint8_t num, const uint8_t state) { diff --git a/Marlin/src/feature/solenoid.h b/Marlin/src/feature/solenoid.h index 3131aeb868d4..68eab4b46190 100644 --- a/Marlin/src/feature/solenoid.h +++ b/Marlin/src/feature/solenoid.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * feature/solenoid.h + */ + void disable_all_solenoids(); void enable_solenoid(const uint8_t num); void disable_solenoid(const uint8_t num); diff --git a/Marlin/src/feature/spindle_laser.cpp b/Marlin/src/feature/spindle_laser.cpp index c0635c72206f..8323e98209f8 100644 --- a/Marlin/src/feature/spindle_laser.cpp +++ b/Marlin/src/feature/spindle_laser.cpp @@ -39,25 +39,25 @@ #endif SpindleLaser cutter; -bool SpindleLaser::enable_state; // Virtual enable state, controls enable pin if present and or apply power if > 0 -uint8_t SpindleLaser::power, // Actual power output 0-255 ocr or "0 = off" > 0 = "on" - SpindleLaser::last_power_applied; // = 0 // Basic power state tracking +bool SpindleLaser::enable_state; // Virtual enable state, controls enable pin if present and or apply power if > 0 +uint8_t SpindleLaser::power, // Actual power output 0-255 ocr or "0 = off" > 0 = "on" + SpindleLaser::last_power_applied; // = 0 // Basic power state tracking #if ENABLED(LASER_FEATURE) - cutter_test_pulse_t SpindleLaser::testPulse = 50; // (ms) Test fire pulse default duration - uint8_t SpindleLaser::last_block_power; // = 0 // Track power changes for dynamic inline power + cutter_test_pulse_t SpindleLaser::testPulse = 50; // (ms) Test fire pulse default duration + uint8_t SpindleLaser::last_block_power; // = 0 // Track power changes for dynamic inline power feedRate_t SpindleLaser::feedrate_mm_m = 1500, - SpindleLaser::last_feedrate_mm_m; // = 0 // (mm/min) Track feedrate changes for dynamic power + SpindleLaser::last_feedrate_mm_m; // = 0 // (mm/min) Track feedrate changes for dynamic power #endif -bool SpindleLaser::isReadyForUI = false; // Ready to apply power setting from the UI to OCR -CutterMode SpindleLaser::cutter_mode = CUTTER_MODE_STANDARD; // Default is standard mode +bool SpindleLaser::isReadyForUI = false; // Ready to apply power setting from the UI to OCR +CutterMode SpindleLaser::cutter_mode = CUTTER_MODE_STANDARD; // Default is standard mode constexpr cutter_cpower_t SpindleLaser::power_floor; -cutter_power_t SpindleLaser::menuPower = 0, // Power value via LCD menu in PWM, PERCENT, or RPM based on configured format set by CUTTER_POWER_UNIT. - SpindleLaser::unitPower = 0; // Unit power is in PWM, PERCENT, or RPM based on CUTTER_POWER_UNIT. +cutter_power_t SpindleLaser::menuPower = 0, // Power value via LCD menu in PWM, PERCENT, or RPM based on configured format set by CUTTER_POWER_UNIT. + SpindleLaser::unitPower = 0; // Unit power is in PWM, PERCENT, or RPM based on CUTTER_POWER_UNIT. -cutter_frequency_t SpindleLaser::frequency; // PWM frequency setting; range: 2K - 50K +cutter_frequency_t SpindleLaser::frequency; // PWM frequency setting; range: 2K - 50K #define SPINDLE_LASER_PWM_OFF TERN(SPINDLE_LASER_PWM_INVERT, 255, 0) @@ -68,10 +68,10 @@ void SpindleLaser::init() { #if ENABLED(SPINDLE_SERVO) servo[SPINDLE_SERVO_NR].move(SPINDLE_SERVO_MIN); #elif PIN_EXISTS(SPINDLE_LASER_ENA) - OUT_WRITE(SPINDLE_LASER_ENA_PIN, !SPINDLE_LASER_ACTIVE_STATE); // Init spindle to off + OUT_WRITE(SPINDLE_LASER_ENA_PIN, !SPINDLE_LASER_ACTIVE_STATE); // Init spindle to off #endif #if ENABLED(SPINDLE_CHANGE_DIR) - OUT_WRITE(SPINDLE_DIR_PIN, SPINDLE_INVERT_DIR); // Init rotation to clockwise (M3) + OUT_WRITE(SPINDLE_DIR_PIN, SPINDLE_INVERT_DIR); // Init rotation to clockwise (M3) #endif #if ENABLED(HAL_CAN_SET_PWM_FREQ) && SPINDLE_LASER_FREQUENCY frequency = SPINDLE_LASER_FREQUENCY; @@ -82,12 +82,12 @@ void SpindleLaser::init() { hal.set_pwm_duty(pin_t(SPINDLE_LASER_PWM_PIN), SPINDLE_LASER_PWM_OFF); // Set to lowest speed #endif #if ENABLED(AIR_EVACUATION) - OUT_WRITE(AIR_EVACUATION_PIN, !AIR_EVACUATION_ACTIVE); // Init Vacuum/Blower OFF + OUT_WRITE(AIR_EVACUATION_PIN, !AIR_EVACUATION_ACTIVE); // Init Vacuum/Blower OFF #endif #if ENABLED(AIR_ASSIST) - OUT_WRITE(AIR_ASSIST_PIN, !AIR_ASSIST_ACTIVE); // Init Air Assist OFF + OUT_WRITE(AIR_ASSIST_PIN, !AIR_ASSIST_ACTIVE); // Init Air Assist OFF #endif - TERN_(I2C_AMMETER, ammeter.init()); // Init I2C Ammeter + TERN_(I2C_AMMETER, ammeter.init()); // Init I2C Ammeter } #if ENABLED(SPINDLE_LASER_USE_PWM) @@ -126,7 +126,7 @@ void SpindleLaser::init() { * @param opwr Power value. Range 0 to MAX. */ void SpindleLaser::apply_power(const uint8_t opwr) { - if (enabled() || opwr == 0) { // 0 check allows us to disable where no ENA pin exists + if (enabled() || opwr == 0) { // 0 check allows us to disable where no ENA pin exists // Test and set the last power used to improve performance if (opwr == last_power_applied) return; last_power_applied = opwr; diff --git a/Marlin/src/feature/stepper_driver_safety.cpp b/Marlin/src/feature/stepper_driver_safety.cpp index 3ddc05ea1ec2..7191207cba2b 100644 --- a/Marlin/src/feature/stepper_driver_safety.cpp +++ b/Marlin/src/feature/stepper_driver_safety.cpp @@ -19,6 +19,11 @@ * along with this program. If not, see . * */ + +/** + * feature/stepper_driver_safety.cpp + */ + #include "../inc/MarlinConfig.h" #include "../lcd/marlinui.h" diff --git a/Marlin/src/feature/stepper_driver_safety.h b/Marlin/src/feature/stepper_driver_safety.h index ac3d8b64f9f4..e49295457a99 100644 --- a/Marlin/src/feature/stepper_driver_safety.h +++ b/Marlin/src/feature/stepper_driver_safety.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * feature/stepper_driver_safety.h + */ + #include "../inc/MarlinConfigPre.h" void stepper_driver_backward_check(); diff --git a/Marlin/src/feature/tmc_util.cpp b/Marlin/src/feature/tmc_util.cpp index 421f9b0c22e1..aa6a8b31d66d 100644 --- a/Marlin/src/feature/tmc_util.cpp +++ b/Marlin/src/feature/tmc_util.cpp @@ -20,6 +20,10 @@ * */ +/** + * feature/tmc_util.cpp + */ + #include "../inc/MarlinConfig.h" #if HAS_TRINAMIC_CONFIG diff --git a/Marlin/src/feature/tmc_util.h b/Marlin/src/feature/tmc_util.h index 7ed070c9b8ca..8ef4457f1dd4 100644 --- a/Marlin/src/feature/tmc_util.h +++ b/Marlin/src/feature/tmc_util.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * feature/tmc_util.h + */ + #include "../inc/MarlinConfig.h" #include "../lcd/marlinui.h" diff --git a/Marlin/src/feature/tramming.cpp b/Marlin/src/feature/tramming.cpp index 3721c5eb811a..b2f6622f3066 100644 --- a/Marlin/src/feature/tramming.cpp +++ b/Marlin/src/feature/tramming.cpp @@ -20,6 +20,10 @@ * */ +/** + * feature/tramming.cpp + */ + #include "../inc/MarlinConfigPre.h" #if ENABLED(ASSISTED_TRAMMING) diff --git a/Marlin/src/feature/tramming.h b/Marlin/src/feature/tramming.h index c8f20f001081..eea5065d3389 100644 --- a/Marlin/src/feature/tramming.h +++ b/Marlin/src/feature/tramming.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * feature/tramming.h + */ + #include "../inc/MarlinConfig.h" #include "../module/probe.h" diff --git a/Marlin/src/feature/twibus.cpp b/Marlin/src/feature/twibus.cpp index 5cfe9f9421bc..eab01936095c 100644 --- a/Marlin/src/feature/twibus.cpp +++ b/Marlin/src/feature/twibus.cpp @@ -20,6 +20,10 @@ * */ +/** + * feature/twibus.cpp + */ + #include "../inc/MarlinConfig.h" #if ENABLED(EXPERIMENTAL_I2CBUS) diff --git a/Marlin/src/feature/twibus.h b/Marlin/src/feature/twibus.h index de23abbed53c..0a6b471acf45 100644 --- a/Marlin/src/feature/twibus.h +++ b/Marlin/src/feature/twibus.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * feature/twibus.h + */ + #include "../core/macros.h" #include diff --git a/Marlin/src/feature/x_twist.cpp b/Marlin/src/feature/x_twist.cpp index b8f7e52ab6d5..3ddf682913e4 100644 --- a/Marlin/src/feature/x_twist.cpp +++ b/Marlin/src/feature/x_twist.cpp @@ -19,6 +19,11 @@ * along with this program. If not, see . * */ + +/** + * feature/x_twist.cpp + */ + #include "../inc/MarlinConfig.h" #if ENABLED(X_AXIS_TWIST_COMPENSATION) diff --git a/Marlin/src/feature/x_twist.h b/Marlin/src/feature/x_twist.h index 6a2ff279013a..9d8650b3f577 100644 --- a/Marlin/src/feature/x_twist.h +++ b/Marlin/src/feature/x_twist.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * feature/x_twist.h + */ + #include "../inc/MarlinConfigPre.h" typedef float xatc_array_t[XATC_MAX_POINTS]; diff --git a/Marlin/src/module/scara.h b/Marlin/src/module/scara.h index c574b2f81809..3dbc8fe527bc 100644 --- a/Marlin/src/module/scara.h +++ b/Marlin/src/module/scara.h @@ -31,7 +31,7 @@ extern float segments_per_second; #if ENABLED(AXEL_TPARA) - float constexpr L1 = TPARA_LINKAGE_1, L2 = TPARA_LINKAGE_2, // Float constants for Robot arm calculations + float constexpr L1 = TPARA_LINKAGE_1, L2 = TPARA_LINKAGE_2, // Float constants for Robot arm calculations L1_2 = FLOAT_SQ(L1), L1_2_2 = 2.0 * L1_2, L2_2 = FLOAT_SQ(L2); @@ -40,7 +40,7 @@ extern float segments_per_second; #else - float constexpr L1 = SCARA_LINKAGE_1, L2 = SCARA_LINKAGE_2, // Float constants for SCARA calculations + float constexpr L1 = SCARA_LINKAGE_1, L2 = SCARA_LINKAGE_2, // Float constants for SCARA calculations L1_2 = FLOAT_SQ(L1), L1_2_2 = 2.0 * L1_2, L2_2 = FLOAT_SQ(L2); From bd1d5e48ee950fca00eb51790e985c61eb234ef9 Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Tue, 2 Jul 2024 02:40:39 -0400 Subject: [PATCH 2/8] forgot these two --- Marlin/src/feature/host_actions.h | 4 ++++ Marlin/src/feature/power_monitor.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Marlin/src/feature/host_actions.h b/Marlin/src/feature/host_actions.h index c030ebad01fc..57dfc45deba9 100644 --- a/Marlin/src/feature/host_actions.h +++ b/Marlin/src/feature/host_actions.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * feature/host_actions.h + */ + #include "../inc/MarlinConfigPre.h" #include "../HAL/shared/Marduino.h" diff --git a/Marlin/src/feature/power_monitor.h b/Marlin/src/feature/power_monitor.h index d57ef6fa67e1..160b0503ec95 100644 --- a/Marlin/src/feature/power_monitor.h +++ b/Marlin/src/feature/power_monitor.h @@ -21,6 +21,10 @@ */ #pragma once +/** + * feature/power_monitor.h + */ + #include "../inc/MarlinConfig.h" #define PM_SAMPLE_RANGE HAL_ADC_RANGE From 968b02c370e4ee61ecbf4ed9ccd4a96c3b69ec5c Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Tue, 2 Jul 2024 02:55:05 -0400 Subject: [PATCH 3/8] Update module files --- Marlin/src/module/delta.cpp | 2 +- Marlin/src/module/delta.h | 2 +- Marlin/src/module/endstops.cpp | 2 +- Marlin/src/module/endstops.h | 2 +- Marlin/src/module/motion.cpp | 2 +- Marlin/src/module/motion.h | 2 +- Marlin/src/module/planner.cpp | 2 +- Marlin/src/module/planner.h | 2 +- Marlin/src/module/planner_bezier.cpp | 2 +- Marlin/src/module/planner_bezier.h | 2 +- Marlin/src/module/polar.cpp | 1 + Marlin/src/module/polar.h | 2 +- Marlin/src/module/polargraph.cpp | 2 +- Marlin/src/module/polargraph.h | 2 +- Marlin/src/module/scara.cpp | 2 +- Marlin/src/module/scara.h | 2 +- Marlin/src/module/settings.cpp | 2 +- Marlin/src/module/settings.h | 6 +++--- Marlin/src/module/stepper.cpp | 2 +- Marlin/src/module/stepper.h | 2 +- Marlin/src/module/stepper/cycles.h | 2 +- Marlin/src/module/stepper/indirection.cpp | 2 +- Marlin/src/module/stepper/indirection.h | 2 +- Marlin/src/module/stepper/trinamic.cpp | 2 +- Marlin/src/module/stepper/trinamic.h | 2 +- Marlin/src/module/temperature.cpp | 2 +- Marlin/src/module/temperature.h | 2 +- 27 files changed, 29 insertions(+), 28 deletions(-) diff --git a/Marlin/src/module/delta.cpp b/Marlin/src/module/delta.cpp index cfa134860b86..1b5d14c9f5eb 100644 --- a/Marlin/src/module/delta.cpp +++ b/Marlin/src/module/delta.cpp @@ -21,7 +21,7 @@ */ /** - * delta.cpp + * module/delta.cpp */ #include "../inc/MarlinConfig.h" diff --git a/Marlin/src/module/delta.h b/Marlin/src/module/delta.h index 041094fd7fcb..c78391f76967 100644 --- a/Marlin/src/module/delta.h +++ b/Marlin/src/module/delta.h @@ -22,7 +22,7 @@ #pragma once /** - * delta.h - Delta-specific functions + * module/delta.h - Delta-specific functions */ #include "../core/types.h" diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index e7786749b5fc..a82d165a64cd 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -21,7 +21,7 @@ */ /** - * endstops.cpp - A singleton object to manage endstops + * module/endstops.cpp - A singleton object to manage endstops */ #include "endstops.h" diff --git a/Marlin/src/module/endstops.h b/Marlin/src/module/endstops.h index 7a6da5eefa8a..dfe65a251c18 100644 --- a/Marlin/src/module/endstops.h +++ b/Marlin/src/module/endstops.h @@ -22,7 +22,7 @@ #pragma once /** - * endstops.h - manages endstops + * module/endstops.h - manages endstops */ #include "../inc/MarlinConfig.h" diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 473d54cc382b..4803d17d7ce8 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -21,7 +21,7 @@ */ /** - * motion.cpp + * module/motion.cpp */ #include "motion.h" diff --git a/Marlin/src/module/motion.h b/Marlin/src/module/motion.h index f9748871f5c8..dfd06000dcd0 100644 --- a/Marlin/src/module/motion.h +++ b/Marlin/src/module/motion.h @@ -22,7 +22,7 @@ #pragma once /** - * motion.h + * module/motion.h * * High-level motion commands to feed the planner * Some of these methods may migrate to the planner class. diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index b4546e0235bf..88eef173d8b9 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -21,7 +21,7 @@ */ /** - * planner.cpp + * module/planner.cpp * * Buffer movement commands and manage the acceleration profile plan * diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index 1053a27688d3..a4e22d2533ca 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -22,7 +22,7 @@ #pragma once /** - * planner.h + * module/planner.h * * Buffer movement commands and manage the acceleration profile plan * diff --git a/Marlin/src/module/planner_bezier.cpp b/Marlin/src/module/planner_bezier.cpp index a3f98435d04a..adc6943695dd 100644 --- a/Marlin/src/module/planner_bezier.cpp +++ b/Marlin/src/module/planner_bezier.cpp @@ -21,7 +21,7 @@ */ /** - * planner_bezier.cpp + * module/planner_bezier.cpp * * Compute and buffer movement commands for bezier curves */ diff --git a/Marlin/src/module/planner_bezier.h b/Marlin/src/module/planner_bezier.h index eb48cf5e1a86..2d1bb9d70ddb 100644 --- a/Marlin/src/module/planner_bezier.h +++ b/Marlin/src/module/planner_bezier.h @@ -22,7 +22,7 @@ #pragma once /** - * planner_bezier.h + * module/planner_bezier.h * * Compute and buffer movement commands for Bézier curves */ diff --git a/Marlin/src/module/polar.cpp b/Marlin/src/module/polar.cpp index 4fbd33cccf53..ecdfda70c538 100644 --- a/Marlin/src/module/polar.cpp +++ b/Marlin/src/module/polar.cpp @@ -21,6 +21,7 @@ */ /** + * module/polar.cpp - POLAR-specific functions * POLAR Kinematics * developed by Kadir ilkimen for PolarBear CNC and babyBear * https://github.com/kadirilkimen/Polar-Bear-Cnc-Machine diff --git a/Marlin/src/module/polar.h b/Marlin/src/module/polar.h index 79fbd4194d53..44ddb12d4c0b 100644 --- a/Marlin/src/module/polar.h +++ b/Marlin/src/module/polar.h @@ -22,7 +22,7 @@ #pragma once /** - * polar.h - POLAR-specific functions + * module/polar.h - POLAR-specific functions */ #include "../core/types.h" diff --git a/Marlin/src/module/polargraph.cpp b/Marlin/src/module/polargraph.cpp index ef6a4c0db463..ae58b25c815d 100644 --- a/Marlin/src/module/polargraph.cpp +++ b/Marlin/src/module/polargraph.cpp @@ -21,7 +21,7 @@ */ /** - * polargraph.cpp + * module/polargraph.cpp */ #include "../inc/MarlinConfig.h" diff --git a/Marlin/src/module/polargraph.h b/Marlin/src/module/polargraph.h index f4904ebfe21c..ca51c4277273 100644 --- a/Marlin/src/module/polargraph.h +++ b/Marlin/src/module/polargraph.h @@ -22,7 +22,7 @@ #pragma once /** - * polargraph.h - Polargraph-specific functions + * module/polargraph.h - Polargraph-specific functions */ #include "../core/types.h" diff --git a/Marlin/src/module/scara.cpp b/Marlin/src/module/scara.cpp index 0f00ab564338..d2ac255a537f 100644 --- a/Marlin/src/module/scara.cpp +++ b/Marlin/src/module/scara.cpp @@ -21,7 +21,7 @@ */ /** - * scara.cpp + * module/scara.cpp */ #include "../inc/MarlinConfig.h" diff --git a/Marlin/src/module/scara.h b/Marlin/src/module/scara.h index 3dbc8fe527bc..9eed7e08088c 100644 --- a/Marlin/src/module/scara.h +++ b/Marlin/src/module/scara.h @@ -22,7 +22,7 @@ #pragma once /** - * scara.h - SCARA-specific functions + * module/scara.h - SCARA-specific functions */ #include "../core/macros.h" diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index d4467b76877d..1668795cacc4 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -21,7 +21,7 @@ */ /** - * settings.cpp + * module/settings.cpp * * Settings and EEPROM storage * diff --git a/Marlin/src/module/settings.h b/Marlin/src/module/settings.h index f181e4014dae..d8e6b4fb4f83 100644 --- a/Marlin/src/module/settings.h +++ b/Marlin/src/module/settings.h @@ -21,9 +21,9 @@ */ #pragma once -// -// settings.cpp - Settings and EEPROM storage -// +/** + * module/settings.cpp - Settings and EEPROM storage + */ #include "../inc/MarlinConfig.h" diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index f5a9f6d0a8ae..f0a8ce84477d 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -21,7 +21,7 @@ */ /** - * stepper.cpp - A singleton object to execute motion plans using stepper motors + * module/stepper.cpp - A singleton object to execute motion plans using stepper motors * Marlin Firmware * * Derived from Grbl diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index 3586c23e7060..343f883ddf0b 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -22,7 +22,7 @@ #pragma once /** - * stepper.h - stepper motor driver: executes motion plans of planner.c using the stepper motors + * module/stepper.h - stepper motor driver: executes motion plans of planner.c using the stepper motors * Derived from Grbl * * Copyright (c) 2009-2011 Simen Svale Skogsrud diff --git a/Marlin/src/module/stepper/cycles.h b/Marlin/src/module/stepper/cycles.h index b01d199cd8cd..fbffef6821dc 100644 --- a/Marlin/src/module/stepper/cycles.h +++ b/Marlin/src/module/stepper/cycles.h @@ -22,7 +22,7 @@ #pragma once /** - * cycles.h - Cycle counting for the Stepper ISR + * module/stepper/cycles.h - Cycle counting for the Stepper ISR * * Estimate the amount of time the Stepper ISR will take to execute. * diff --git a/Marlin/src/module/stepper/indirection.cpp b/Marlin/src/module/stepper/indirection.cpp index fec77c12377d..0a2d15fce658 100644 --- a/Marlin/src/module/stepper/indirection.cpp +++ b/Marlin/src/module/stepper/indirection.cpp @@ -21,7 +21,7 @@ */ /** - * stepper/indirection.cpp + * module/stepper/indirection.cpp * * Stepper motor driver indirection to allow some stepper functions to * be done via SPI/I2c instead of direct pin manipulation. diff --git a/Marlin/src/module/stepper/indirection.h b/Marlin/src/module/stepper/indirection.h index 1ffeb8b907aa..a52075c26f47 100644 --- a/Marlin/src/module/stepper/indirection.h +++ b/Marlin/src/module/stepper/indirection.h @@ -22,7 +22,7 @@ #pragma once /** - * stepper/indirection.h - Stepper Indirection Macros + * module/stepper/indirection.h - Stepper Indirection Macros * * Each axis in a machine may have between 1 and 4 stepper motors. * Currently X and Y allow for 1 or 2 steppers. Z can have up to 4. diff --git a/Marlin/src/module/stepper/trinamic.cpp b/Marlin/src/module/stepper/trinamic.cpp index ce99d87f0996..a45c532dbbe1 100644 --- a/Marlin/src/module/stepper/trinamic.cpp +++ b/Marlin/src/module/stepper/trinamic.cpp @@ -21,7 +21,7 @@ */ /** - * stepper/trinamic.cpp + * module/stepper/trinamic.cpp * Stepper driver indirection for Trinamic */ diff --git a/Marlin/src/module/stepper/trinamic.h b/Marlin/src/module/stepper/trinamic.h index 3ae784be9718..1d881610e257 100644 --- a/Marlin/src/module/stepper/trinamic.h +++ b/Marlin/src/module/stepper/trinamic.h @@ -22,7 +22,7 @@ #pragma once /** - * stepper/trinamic.h + * module/stepper/trinamic.h * Stepper driver indirection for Trinamic */ diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 16b43f62f098..a72ffb37eff6 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -21,7 +21,7 @@ */ /** - * temperature.cpp - temperature control + * module/temperature.cpp - temperature control */ // Useful when debugging thermocouples diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index 15cfeac91118..10ecb7b54362 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -22,7 +22,7 @@ #pragma once /** - * temperature.h - temperature controller + * module/temperature.h - temperature controller */ #include "thermistor/thermistors.h" From d193ac7fbad89c565084e40b0754c50ae5ca8614 Mon Sep 17 00:00:00 2001 From: Andrew <18502096+classicrocker883@users.noreply.github.com> Date: Wed, 10 Jul 2024 10:31:33 -0400 Subject: [PATCH 4/8] Update delta.cpp --- Marlin/src/module/delta.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/module/delta.cpp b/Marlin/src/module/delta.cpp index 1b5d14c9f5eb..4737bca34438 100644 --- a/Marlin/src/module/delta.cpp +++ b/Marlin/src/module/delta.cpp @@ -21,7 +21,7 @@ */ /** - * module/delta.cpp + * module/delta.cpp - Delta-specific functions */ #include "../inc/MarlinConfig.h" From 06813fe2f09ab27ca30f85b6927f9fe4d1fa7695 Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Sat, 13 Jul 2024 07:47:10 -0400 Subject: [PATCH 5/8] update HAL/DUE + sd/usb_flashdrive comments/spacing --- Marlin/src/HAL/DUE/usb/compiler.h | 6 +-- Marlin/src/HAL/DUE/usb/conf_access.h | 2 - Marlin/src/HAL/DUE/usb/conf_clock.h | 4 +- Marlin/src/HAL/DUE/usb/conf_usb.h | 2 - Marlin/src/HAL/DUE/usb/ctrl_access.c | 2 - Marlin/src/HAL/DUE/usb/ctrl_access.h | 2 - Marlin/src/HAL/DUE/usb/genclk.h | 4 +- Marlin/src/HAL/DUE/usb/mrepeat.h | 2 - Marlin/src/HAL/DUE/usb/osc.h | 6 +-- Marlin/src/HAL/DUE/usb/pll.h | 4 +- Marlin/src/HAL/DUE/usb/preprocessor.h | 2 - Marlin/src/HAL/DUE/usb/sbc_protocol.h | 2 - Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.h | 2 - Marlin/src/HAL/DUE/usb/spc_protocol.h | 4 +- Marlin/src/HAL/DUE/usb/stringz.h | 2 - Marlin/src/HAL/DUE/usb/sysclk.c | 2 - Marlin/src/HAL/DUE/usb/sysclk.h | 4 +- Marlin/src/HAL/DUE/usb/tpaste.h | 2 - Marlin/src/HAL/DUE/usb/udc.c | 2 - Marlin/src/HAL/DUE/usb/udc.h | 2 - Marlin/src/HAL/DUE/usb/udc_desc.h | 2 - Marlin/src/HAL/DUE/usb/udd.h | 2 - Marlin/src/HAL/DUE/usb/udi.h | 2 - Marlin/src/HAL/DUE/usb/udi_cdc.c | 2 - Marlin/src/HAL/DUE/usb/udi_cdc.h | 2 - Marlin/src/HAL/DUE/usb/udi_cdc_conf.h | 2 - Marlin/src/HAL/DUE/usb/udi_cdc_desc.c | 2 - Marlin/src/HAL/DUE/usb/udi_composite_desc.c | 2 - Marlin/src/HAL/DUE/usb/udi_msc.c | 2 - Marlin/src/HAL/DUE/usb/udi_msc.h | 2 - Marlin/src/HAL/DUE/usb/uotghs_device_due.c | 3 -- Marlin/src/HAL/DUE/usb/uotghs_device_due.h | 4 +- Marlin/src/HAL/DUE/usb/uotghs_otg.h | 4 +- Marlin/src/HAL/DUE/usb/usb_protocol.h | 6 +-- Marlin/src/HAL/DUE/usb/usb_protocol_cdc.h | 4 +- Marlin/src/HAL/DUE/usb/usb_protocol_msc.h | 2 - Marlin/src/HAL/DUE/usb/usb_task.h | 2 - .../src/HAL/shared/backtrace/unwarmbytab.cpp | 8 +-- Marlin/src/module/tool_change.cpp | 2 +- Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp | 2 +- .../src/sd/usb_flashdrive/lib-uhs2/macros.h | 2 +- .../sd/usb_flashdrive/lib-uhs2/masstorage.cpp | 2 +- .../sd/usb_flashdrive/lib-uhs2/masstorage.h | 2 +- .../sd/usb_flashdrive/lib-uhs2/message.cpp | 2 +- .../UHS_BULK_STORAGE/UHS_BULK_STORAGE.h | 2 +- .../UHS_BULK_STORAGE_INLINE.h | 2 +- .../UHS_host/UHS_BULK_STORAGE/UHS_SCSI.h | 29 ++++++----- .../lib-uhs3/UHS_host/UHS_UNOFFICIAL_IDs.h | 3 +- .../lib-uhs3/UHS_host/UHS_USB_IDs.h | 4 +- .../lib-uhs3/UHS_host/UHS_UsbCore.h | 6 +-- .../lib-uhs3/UHS_host/UHS_address.h | 4 +- .../lib-uhs3/UHS_host/UHS_hexdump.h | 1 + .../lib-uhs3/UHS_host/UHS_host.h | 13 +++-- .../lib-uhs3/UHS_host/UHS_host_INLINE.h | 11 ++-- .../lib-uhs3/UHS_host/UHS_macros.h | 11 ++-- .../lib-uhs3/UHS_host/UHS_message.h | 1 + .../lib-uhs3/UHS_host/UHS_printf_HELPER.h | 8 +-- .../lib-uhs3/UHS_host/UHS_settings.h | 4 +- .../lib-uhs3/UHS_host/UHS_usb_ch9.h | 50 +++++++++---------- .../lib-uhs3/UHS_host/UHS_usbhost.h | 4 +- .../lib-uhs3/UHS_host/UHS_util_INLINE.h | 2 +- .../UHS_host/USB_HOST_SHIELD/UHS_max3421e.h | 27 +++++----- .../USB_HOST_SHIELD/USB_HOST_SHIELD.h | 8 +-- .../USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h | 7 ++- .../lib-uhs3/UHS_host/macro_logic.h | 4 +- .../lib-uhs3/dyn_SWI/SWI_INLINE.h | 10 ++-- .../usb_flashdrive/lib-uhs3/dyn_SWI/dyn_SWI.h | 8 +-- 67 files changed, 140 insertions(+), 202 deletions(-) diff --git a/Marlin/src/HAL/DUE/usb/compiler.h b/Marlin/src/HAL/DUE/usb/compiler.h index 27c554cdb7e1..81ea2ddda65b 100644 --- a/Marlin/src/HAL/DUE/usb/compiler.h +++ b/Marlin/src/HAL/DUE/usb/compiler.h @@ -39,8 +39,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ @@ -1079,7 +1077,7 @@ static inline void convert_16_bit_to_byte_address(uint16_t value, uint8_t *data) data[1] = (value >> 8) & 0xFF; } -/* +/** * @brief Converts a 2 Byte array into a 16-Bit value * * @param data Specifies the pointer to the 2 Byte array @@ -1136,4 +1134,4 @@ static inline uint64_t convert_byte_array_to_64_bit(uint8_t *data) * \} */ -#endif /* UTILS_COMPILER_H */ +#endif // UTILS_COMPILER_H diff --git a/Marlin/src/HAL/DUE/usb/conf_access.h b/Marlin/src/HAL/DUE/usb/conf_access.h index 0ea5fe228782..20b1c54bf63d 100644 --- a/Marlin/src/HAL/DUE/usb/conf_access.h +++ b/Marlin/src/HAL/DUE/usb/conf_access.h @@ -39,8 +39,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ diff --git a/Marlin/src/HAL/DUE/usb/conf_clock.h b/Marlin/src/HAL/DUE/usb/conf_clock.h index 0c7815ee4d72..6ba9085f9e98 100644 --- a/Marlin/src/HAL/DUE/usb/conf_clock.h +++ b/Marlin/src/HAL/DUE/usb/conf_clock.h @@ -39,8 +39,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ @@ -96,4 +94,4 @@ // - UPLL frequency: 480MHz // - USB clock: 480 / 1 = 480MHz -#endif /* CONF_CLOCK_H_INCLUDED */ +#endif // CONF_CLOCK_H_INCLUDED diff --git a/Marlin/src/HAL/DUE/usb/conf_usb.h b/Marlin/src/HAL/DUE/usb/conf_usb.h index fb4ef3424110..607962d9c45d 100644 --- a/Marlin/src/HAL/DUE/usb/conf_usb.h +++ b/Marlin/src/HAL/DUE/usb/conf_usb.h @@ -39,8 +39,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ diff --git a/Marlin/src/HAL/DUE/usb/ctrl_access.c b/Marlin/src/HAL/DUE/usb/ctrl_access.c index b766ed12732b..c6e750869d1a 100644 --- a/Marlin/src/HAL/DUE/usb/ctrl_access.c +++ b/Marlin/src/HAL/DUE/usb/ctrl_access.c @@ -51,8 +51,6 @@ * * \asf_license_stop * - ******************************************************************************/ -/* * Support and FAQ: visit Atmel Support */ diff --git a/Marlin/src/HAL/DUE/usb/ctrl_access.h b/Marlin/src/HAL/DUE/usb/ctrl_access.h index d9cb05da7472..d2986f37430c 100644 --- a/Marlin/src/HAL/DUE/usb/ctrl_access.h +++ b/Marlin/src/HAL/DUE/usb/ctrl_access.h @@ -51,8 +51,6 @@ * * \asf_license_stop * - ******************************************************************************/ -/* * Support and FAQ: visit Atmel Support */ diff --git a/Marlin/src/HAL/DUE/usb/genclk.h b/Marlin/src/HAL/DUE/usb/genclk.h index 45eba5873f8c..22c400ccd02a 100644 --- a/Marlin/src/HAL/DUE/usb/genclk.h +++ b/Marlin/src/HAL/DUE/usb/genclk.h @@ -39,8 +39,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ @@ -261,4 +259,4 @@ static inline void genclk_enable_source(enum genclk_source e_src) { /**INDENT-ON**/ /// @endcond -#endif /* CHIP_GENCLK_H_INCLUDED */ +#endif // CHIP_GENCLK_H_INCLUDED diff --git a/Marlin/src/HAL/DUE/usb/mrepeat.h b/Marlin/src/HAL/DUE/usb/mrepeat.h index 10a8237545de..407d6e9f990b 100644 --- a/Marlin/src/HAL/DUE/usb/mrepeat.h +++ b/Marlin/src/HAL/DUE/usb/mrepeat.h @@ -39,8 +39,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ diff --git a/Marlin/src/HAL/DUE/usb/osc.h b/Marlin/src/HAL/DUE/usb/osc.h index 1585018ed851..58acbc764d8a 100644 --- a/Marlin/src/HAL/DUE/usb/osc.h +++ b/Marlin/src/HAL/DUE/usb/osc.h @@ -39,8 +39,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ @@ -57,7 +55,7 @@ extern "C" { /**INDENT-ON**/ /// @endcond -/* +/** * Below BOARD_XXX macros are related to the specific board, and * should be defined by the board code, otherwise default value are used. */ @@ -251,4 +249,4 @@ static inline void osc_wait_ready(uint8_t id) { /**INDENT-ON**/ /// @endcond -#endif /* CHIP_OSC_H_INCLUDED */ +#endif // CHIP_OSC_H_INCLUDED diff --git a/Marlin/src/HAL/DUE/usb/pll.h b/Marlin/src/HAL/DUE/usb/pll.h index d25a1f65d09b..e8fc579b73e8 100644 --- a/Marlin/src/HAL/DUE/usb/pll.h +++ b/Marlin/src/HAL/DUE/usb/pll.h @@ -39,8 +39,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ @@ -267,4 +265,4 @@ static inline int pll_wait_for_lock(unsigned int pll_id) { /**INDENT-ON**/ /// @endcond -#endif /* CHIP_PLL_H_INCLUDED */ +#endif // CHIP_PLL_H_INCLUDED diff --git a/Marlin/src/HAL/DUE/usb/preprocessor.h b/Marlin/src/HAL/DUE/usb/preprocessor.h index fe796c4fb83e..a21e2ed1d4f6 100644 --- a/Marlin/src/HAL/DUE/usb/preprocessor.h +++ b/Marlin/src/HAL/DUE/usb/preprocessor.h @@ -39,8 +39,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ diff --git a/Marlin/src/HAL/DUE/usb/sbc_protocol.h b/Marlin/src/HAL/DUE/usb/sbc_protocol.h index cdd4caa3cd50..9104bb2079b3 100644 --- a/Marlin/src/HAL/DUE/usb/sbc_protocol.h +++ b/Marlin/src/HAL/DUE/usb/sbc_protocol.h @@ -50,8 +50,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ #ifndef _SBC_PROTOCOL_H_ diff --git a/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.h b/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.h index 464d106e5293..f0fd6f453a78 100644 --- a/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.h +++ b/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.h @@ -40,8 +40,6 @@ * * \asf_license_stop * - ******************************************************************************/ -/* * Support and FAQ: visit Atmel Support */ diff --git a/Marlin/src/HAL/DUE/usb/spc_protocol.h b/Marlin/src/HAL/DUE/usb/spc_protocol.h index 808c388f4fc4..557a82d4750d 100644 --- a/Marlin/src/HAL/DUE/usb/spc_protocol.h +++ b/Marlin/src/HAL/DUE/usb/spc_protocol.h @@ -42,11 +42,9 @@ * * \asf_license_stop * - */ - -/* * Support and FAQ: visit Atmel Support */ + #ifndef _SPC_PROTOCOL_H_ #define _SPC_PROTOCOL_H_ diff --git a/Marlin/src/HAL/DUE/usb/stringz.h b/Marlin/src/HAL/DUE/usb/stringz.h index fc9aaf38a4cf..4158900843de 100644 --- a/Marlin/src/HAL/DUE/usb/stringz.h +++ b/Marlin/src/HAL/DUE/usb/stringz.h @@ -39,8 +39,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ diff --git a/Marlin/src/HAL/DUE/usb/sysclk.c b/Marlin/src/HAL/DUE/usb/sysclk.c index cbb4e2c9ef22..d67e72406859 100644 --- a/Marlin/src/HAL/DUE/usb/sysclk.c +++ b/Marlin/src/HAL/DUE/usb/sysclk.c @@ -39,8 +39,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ diff --git a/Marlin/src/HAL/DUE/usb/sysclk.h b/Marlin/src/HAL/DUE/usb/sysclk.h index 4001366868a0..79cb32b14475 100644 --- a/Marlin/src/HAL/DUE/usb/sysclk.h +++ b/Marlin/src/HAL/DUE/usb/sysclk.h @@ -39,8 +39,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ @@ -225,4 +223,4 @@ extern void sysclk_disable_usb(void); /**INDENT-ON**/ /// @endcond -#endif /* CHIP_SYSCLK_H_INCLUDED */ +#endif // CHIP_SYSCLK_H_INCLUDED diff --git a/Marlin/src/HAL/DUE/usb/tpaste.h b/Marlin/src/HAL/DUE/usb/tpaste.h index 2ad3f2758e8a..38c23776dfd7 100644 --- a/Marlin/src/HAL/DUE/usb/tpaste.h +++ b/Marlin/src/HAL/DUE/usb/tpaste.h @@ -39,8 +39,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ diff --git a/Marlin/src/HAL/DUE/usb/udc.c b/Marlin/src/HAL/DUE/usb/udc.c index f6a4243d1d94..682a480a3a36 100644 --- a/Marlin/src/HAL/DUE/usb/udc.c +++ b/Marlin/src/HAL/DUE/usb/udc.c @@ -39,8 +39,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ diff --git a/Marlin/src/HAL/DUE/usb/udc.h b/Marlin/src/HAL/DUE/usb/udc.h index aba08d956e84..d50fcc68c367 100644 --- a/Marlin/src/HAL/DUE/usb/udc.h +++ b/Marlin/src/HAL/DUE/usb/udc.h @@ -39,8 +39,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ diff --git a/Marlin/src/HAL/DUE/usb/udc_desc.h b/Marlin/src/HAL/DUE/usb/udc_desc.h index f1f328d035c3..3a6dda397f4d 100644 --- a/Marlin/src/HAL/DUE/usb/udc_desc.h +++ b/Marlin/src/HAL/DUE/usb/udc_desc.h @@ -39,8 +39,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ diff --git a/Marlin/src/HAL/DUE/usb/udd.h b/Marlin/src/HAL/DUE/usb/udd.h index 4e482784e163..b06f3d2a1ed4 100644 --- a/Marlin/src/HAL/DUE/usb/udd.h +++ b/Marlin/src/HAL/DUE/usb/udd.h @@ -39,8 +39,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ diff --git a/Marlin/src/HAL/DUE/usb/udi.h b/Marlin/src/HAL/DUE/usb/udi.h index bc5de086f3ce..070ba93cd01d 100644 --- a/Marlin/src/HAL/DUE/usb/udi.h +++ b/Marlin/src/HAL/DUE/usb/udi.h @@ -39,8 +39,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ diff --git a/Marlin/src/HAL/DUE/usb/udi_cdc.c b/Marlin/src/HAL/DUE/usb/udi_cdc.c index 26788570c619..06eb15eb1a65 100644 --- a/Marlin/src/HAL/DUE/usb/udi_cdc.c +++ b/Marlin/src/HAL/DUE/usb/udi_cdc.c @@ -39,8 +39,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ diff --git a/Marlin/src/HAL/DUE/usb/udi_cdc.h b/Marlin/src/HAL/DUE/usb/udi_cdc.h index e9c6abbbb2f2..005eae827338 100644 --- a/Marlin/src/HAL/DUE/usb/udi_cdc.h +++ b/Marlin/src/HAL/DUE/usb/udi_cdc.h @@ -39,8 +39,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ diff --git a/Marlin/src/HAL/DUE/usb/udi_cdc_conf.h b/Marlin/src/HAL/DUE/usb/udi_cdc_conf.h index e61b8cbaadf4..38028c20496e 100644 --- a/Marlin/src/HAL/DUE/usb/udi_cdc_conf.h +++ b/Marlin/src/HAL/DUE/usb/udi_cdc_conf.h @@ -39,8 +39,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ diff --git a/Marlin/src/HAL/DUE/usb/udi_cdc_desc.c b/Marlin/src/HAL/DUE/usb/udi_cdc_desc.c index bcae362cef8f..a9f256e54146 100644 --- a/Marlin/src/HAL/DUE/usb/udi_cdc_desc.c +++ b/Marlin/src/HAL/DUE/usb/udi_cdc_desc.c @@ -39,8 +39,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ diff --git a/Marlin/src/HAL/DUE/usb/udi_composite_desc.c b/Marlin/src/HAL/DUE/usb/udi_composite_desc.c index 8fa5acbb3f72..4dd6907ffc2c 100644 --- a/Marlin/src/HAL/DUE/usb/udi_composite_desc.c +++ b/Marlin/src/HAL/DUE/usb/udi_composite_desc.c @@ -39,8 +39,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ diff --git a/Marlin/src/HAL/DUE/usb/udi_msc.c b/Marlin/src/HAL/DUE/usb/udi_msc.c index 56664f4bf7c6..5f426268097a 100644 --- a/Marlin/src/HAL/DUE/usb/udi_msc.c +++ b/Marlin/src/HAL/DUE/usb/udi_msc.c @@ -39,8 +39,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ diff --git a/Marlin/src/HAL/DUE/usb/udi_msc.h b/Marlin/src/HAL/DUE/usb/udi_msc.h index 0ede4d6a8346..de45768c3e75 100644 --- a/Marlin/src/HAL/DUE/usb/udi_msc.h +++ b/Marlin/src/HAL/DUE/usb/udi_msc.h @@ -39,8 +39,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ diff --git a/Marlin/src/HAL/DUE/usb/uotghs_device_due.c b/Marlin/src/HAL/DUE/usb/uotghs_device_due.c index 01dda7e7fec8..03cb725439e3 100644 --- a/Marlin/src/HAL/DUE/usb/uotghs_device_due.c +++ b/Marlin/src/HAL/DUE/usb/uotghs_device_due.c @@ -39,9 +39,6 @@ * * \asf_license_stop * - */ - -/* * Support and FAQ: visit Atmel Support */ diff --git a/Marlin/src/HAL/DUE/usb/uotghs_device_due.h b/Marlin/src/HAL/DUE/usb/uotghs_device_due.h index 99ad492c1f55..198158a8a176 100644 --- a/Marlin/src/HAL/DUE/usb/uotghs_device_due.h +++ b/Marlin/src/HAL/DUE/usb/uotghs_device_due.h @@ -39,8 +39,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ @@ -655,4 +653,4 @@ typedef struct { /**INDENT-ON**/ /// @endcond -#endif /* UOTGHS_DEVICE_H_INCLUDED */ +#endif // UOTGHS_DEVICE_H_INCLUDED diff --git a/Marlin/src/HAL/DUE/usb/uotghs_otg.h b/Marlin/src/HAL/DUE/usb/uotghs_otg.h index 8c12a3e29199..e1f7809da422 100644 --- a/Marlin/src/HAL/DUE/usb/uotghs_otg.h +++ b/Marlin/src/HAL/DUE/usb/uotghs_otg.h @@ -39,8 +39,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ @@ -235,4 +233,4 @@ void otg_dual_disable(void); } #endif -#endif /* UOTGHS_OTG_H_INCLUDED */ +#endif // UOTGHS_OTG_H_INCLUDED diff --git a/Marlin/src/HAL/DUE/usb/usb_protocol.h b/Marlin/src/HAL/DUE/usb/usb_protocol.h index 9bf0a1ba60c1..0e0ca878ce27 100644 --- a/Marlin/src/HAL/DUE/usb/usb_protocol.h +++ b/Marlin/src/HAL/DUE/usb/usb_protocol.h @@ -42,8 +42,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ @@ -297,7 +295,7 @@ typedef uint8_t usb_ep_t; */ #define USB_MAX_DESC_LEN 255 -/* +/** * 2-byte alignment requested for all USB structures. */ COMPILER_PACK_SET(1) @@ -489,4 +487,4 @@ COMPILER_PACK_RESET() //! @} -#endif /* _USB_PROTOCOL_H_ */ +#endif // _USB_PROTOCOL_H_ diff --git a/Marlin/src/HAL/DUE/usb/usb_protocol_cdc.h b/Marlin/src/HAL/DUE/usb/usb_protocol_cdc.h index 769e7589bcc8..b402c2e85bba 100644 --- a/Marlin/src/HAL/DUE/usb/usb_protocol_cdc.h +++ b/Marlin/src/HAL/DUE/usb/usb_protocol_cdc.h @@ -39,8 +39,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ #ifndef _USB_PROTOCOL_CDC_H_ @@ -159,7 +157,7 @@ #define USB_REQ_CDC_NOTIFY_LINE_STATE_CHANGE 0x29 //@} -/* +/** * Need to pack structures tightly, or the compiler might insert padding * and violate the spec-mandated layout. */ diff --git a/Marlin/src/HAL/DUE/usb/usb_protocol_msc.h b/Marlin/src/HAL/DUE/usb/usb_protocol_msc.h index 227a13dc533c..fdf60c1d5f5a 100644 --- a/Marlin/src/HAL/DUE/usb/usb_protocol_msc.h +++ b/Marlin/src/HAL/DUE/usb/usb_protocol_msc.h @@ -39,8 +39,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ diff --git a/Marlin/src/HAL/DUE/usb/usb_task.h b/Marlin/src/HAL/DUE/usb/usb_task.h index e9831ae0628a..442e3c1a3563 100644 --- a/Marlin/src/HAL/DUE/usb/usb_task.h +++ b/Marlin/src/HAL/DUE/usb/usb_task.h @@ -39,8 +39,6 @@ * * \asf_license_stop * - */ -/* * Support and FAQ: visit Atmel Support */ diff --git a/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp b/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp index bd87b6731cdf..07a3281b5fd8 100644 --- a/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp +++ b/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp @@ -1,4 +1,4 @@ -/* +/** * Libbacktrace * Copyright 2015 Stephen Street * @@ -46,7 +46,7 @@ static const UnwTabEntry *UnwTabSearchIndex(const UnwTabEntry *start, const UnwT return start; } -/* +/** * Get the function name or nullptr if not found */ static const char *UnwTabGetFunctionName(const UnwindCallbacks *cb, uint32_t address) { @@ -129,7 +129,7 @@ static UnwResult UnwTabStateInit(const UnwindCallbacks *cb, UnwTabState *ucb, ui return UNWIND_SUCCESS; } -/* +/** * Execute unwinding instructions */ static UnwResult UnwTabExecuteInstructions(const UnwindCallbacks *cb, UnwTabState *ucb) { @@ -292,7 +292,7 @@ static inline __attribute__((always_inline)) uint32_t read_psp() { return psp; } -/* +/** * Unwind the specified frame and goto the previous one */ static UnwResult UnwTabUnwindFrame(const UnwindCallbacks *cb, UnwindFrame *frame) { diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index b5cacc2f3bb9..ea60ef8376dd 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -1210,7 +1210,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { } else if (extruder_was_primed[old_tool]) { // Retract the old extruder if it was previously primed - // To-Do: Should SingleNozzle always retract? + // TODO: Should SingleNozzle always retract? DEBUG_ECHOLNPGM("Retracting Filament for T", old_tool, ". | Distance: ", toolchange_settings.swap_length, " | Speed: ", MMM_TO_MMS(toolchange_settings.retract_speed), "mm/s"); unscaled_e_move(-toolchange_settings.swap_length, MMM_TO_MMS(toolchange_settings.retract_speed)); } diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp b/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp index 016500d2d68c..8027691bae4a 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp @@ -685,7 +685,7 @@ uint8_t USB::Configuring(uint8_t parent, uint8_t port, bool lowspeed) { return rcode; } - // To-do? + // TODO: // Allocate new address according to device class //bAddress = addrPool.AllocAddress(parent, false, port); diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/macros.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/macros.h index 8cb5b6bf37e8..c1ebebe63026 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/macros.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/macros.h @@ -77,7 +77,7 @@ #define BMAKE64(__usc7__,__usc6__,__usc5__,__usc4__,__usc3__,__usc2__,__usc1__,__usc0__) ((uint64_t)((uint64_t)__usc0__ | (uint64_t)BOVER1(__usc1__) | (uint64_t)BOVER2(__usc2__) | (uint64_t)BOVER3(__usc3__) | (uint64_t)BOVER4(__usc4__) | (uint64_t)BOVER5(__usc5__) | (uint64_t)BOVER6(__usc6__) | (uint64_t)BOVER1(__usc7__))) #endif -/* +/** * Debug macros: Strings are stored in progmem (flash) instead of RAM. */ #define USBTRACE(s) (Notify(PSTR(s), 0x80)) diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.cpp b/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.cpp index 551fb274d781..72f3115753a1 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.cpp +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.cpp @@ -1172,7 +1172,7 @@ void BulkOnly::PrintEndpointDescriptor(const USB_FD_ENDPOINT_DESCRIPTOR * ep_ptr } //////////////////////////////////////////////////////////////////////////////// -// misc/to kill/to-do +// misc/to kill/TODO //////////////////////////////////////////////////////////////////////////////// /* We won't be needing this... */ diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.h index fa56b6857368..8de29d10fde3 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.h @@ -65,7 +65,7 @@ #define MASS_CMD_DIR_OUT 0 // (0 << 7) #define MASS_CMD_DIR_IN 0x80 //(1 << 7) -/* +/** * Reference documents from T10 (https://www.t10.org) * SCSI Primary Commands - 3 (SPC-3) * SCSI Block Commands - 2 (SBC-2) diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/message.cpp b/Marlin/src/sd/usb_flashdrive/lib-uhs2/message.cpp index 1c1131cd3caf..9ae705debd29 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/message.cpp +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/message.cpp @@ -31,7 +31,7 @@ // 0x80 is the default (i.e. trace) to turn off set this global to something lower. // this allows for 126 other debugging levels. -// TO-DO: Allow assignment to a different serial port by software +// TODO: Allow assignment to a different serial port by software int UsbDEBUGlvl = 0x80; void E_Notifyc(char c, int lvl) { diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE.h index c94e7ab990d9..9c6509eaeace 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE.h @@ -65,7 +65,7 @@ e-mail : support@circuitsathome.com #define UHS_BULK_CMD_DIR_OUT 0x00U #define UHS_BULK_CMD_DIR_IN 0x80U -/* Bulk error codes */ +// Bulk error codes #define UHS_BULK_ERR_SUCCESS UHS_HOST_ERROR_NONE #define UHS_BULK_ERR_PHASE_ERROR 0x22U #define UHS_BULK_ERR_UNIT_NOT_READY 0x23U diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE_INLINE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE_INLINE.h index 06deb7a0ae8b..f0bcfe59f5ad 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE_INLINE.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE_INLINE.h @@ -322,7 +322,7 @@ bool UHS_NI UHS_Bulk_Storage::OKtoEnumerate(ENUMERATION_INFO *ei) { BS_HOST_DEBUG("BulkOnly: checking protocol %2.2x, interface.klass %2.2x, interface.subklass %2.2x\r\n", ei->protocol, ei->interface.klass, ei->interface.subklass); BS_HOST_DEBUG("BulkOnly: checking interface.protocol %2.2x\r\n", ei->interface.protocol); // - // TO-DO? + // TODO: // Check that we have 2 bulk endpoints, and one in each direction?? // e.g. (ei->interface.numep > 1) && // two or more endpoints AND check types // This will work with proper hardware though. diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_SCSI.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_SCSI.h index bead520bf2e3..52e7dda2b3e4 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_SCSI.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_SCSI.h @@ -27,14 +27,14 @@ e-mail : support@circuitsathome.com #ifndef UHS_SCSI_H #define UHS_SCSI_H -/* +/** * Reference documents from T10 (https://www.t10.org) * SCSI Primary Commands - 3 (SPC-3) * SCSI Block Commands - 2 (SBC-2) * Multi-Media Commands - 5 (MMC-5) */ -/* Group 1 commands (CDB's here are should all be 6-bytes) */ +// Group 1 commands (CDB's here are should all be 6-bytes) #define SCSI_CMD_TEST_UNIT_READY 0x00U #define SCSI_CMD_REQUEST_SENSE 0x03U #define SCSI_CMD_FORMAT_UNIT 0x04U @@ -45,7 +45,8 @@ e-mail : support@circuitsathome.com #define SCSI_CMD_MODE_SENSE_6 0x1AU #define SCSI_CMD_START_STOP_UNIT 0x1BU #define SCSI_CMD_PREVENT_REMOVAL 0x1EU -/* Group 2 Commands (CDB's here are 10-bytes) */ + +// Group 2 Commands (CDB's here are 10-bytes) #define SCSI_CMD_READ_FORMAT_CAPACITIES 0x23U #define SCSI_CMD_READ_CAPACITY_10 0x25U #define SCSI_CMD_READ_10 0x28U @@ -77,7 +78,8 @@ e-mail : support@circuitsathome.com #define SCSI_CMD_CLOSE_TRACK_SESSION 0x5BU #define SCSI_CMD_READ_BUFFER_CAPACITY 0x5CU #define SCSI_CMD_SEND_CUE_SHEET 0x5DU -/* Group 5 Commands (CDB's here are 12-bytes) */ + +// Group 5 Commands (CDB's here are 12-bytes) #define SCSI_CMD_REPORT_LUNS 0xA0U #define SCSI_CMD_BLANK 0xA1U #define SCSI_CMD_SECURITY_PROTOCOL_IN 0xA2U @@ -99,14 +101,15 @@ e-mail : support@circuitsathome.com #define SCSI_CMD_MECHANISM_STATUS 0xBDU #define SCSI_CMD_READ_CD 0xBEU #define SCSI_CMD_SEND_DISC_STRUCTURE 0xBFU -/* Vendor-unique Commands, included for completeness */ -#define SCSI_CMD_CD_PLAYBACK_STATUS 0xC4U /* SONY unique */ -#define SCSI_CMD_PLAYBACK_CONTROL 0xC9U /* SONY unique */ -#define SCSI_CMD_READ_CDDA 0xD8U /* Vendor unique */ -#define SCSI_CMD_READ_CDXA 0xDBU /* Vendor unique */ -#define SCSI_CMD_READ_ALL_SUBCODES 0xDFU /* Vendor unique */ - -/* SCSI error codes */ + +// Vendor-unique Commands, included for completeness +#define SCSI_CMD_CD_PLAYBACK_STATUS 0xC4U // SONY unique +#define SCSI_CMD_PLAYBACK_CONTROL 0xC9U // SONY unique +#define SCSI_CMD_READ_CDDA 0xD8U // Vendor unique +#define SCSI_CMD_READ_CDXA 0xDBU // Vendor unique +#define SCSI_CMD_READ_ALL_SUBCODES 0xDFU // Vendor unique + +// SCSI error codes #define SCSI_S_NOT_READY 0x02U #define SCSI_S_MEDIUM_ERROR 0x03U #define SCSI_S_ILLEGAL_REQUEST 0x05U @@ -324,4 +327,4 @@ struct SCSI_Request_Sense_Response { uint8_t SenseKeySpecific[3]; } __attribute__((packed)); -#endif /* UHS_SCSI_H */ +#endif // UHS_SCSI_H diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UNOFFICIAL_IDs.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UNOFFICIAL_IDs.h index 6442bcc4b713..0bb3d0a0a61b 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UNOFFICIAL_IDs.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UNOFFICIAL_IDs.h @@ -23,6 +23,7 @@ Circuits At Home, LTD Web : https://www.circuitsathome.com e-mail : support@circuitsathome.com */ + #ifndef _UHS_UNOFFICIAL_IDs_h #define _UHS_UNOFFICIAL_IDs_h @@ -30,4 +31,4 @@ e-mail : support@circuitsathome.com #define UHS_VID_UNOFFICIAL_JOYTECH 0x162EU // For unofficial Joytech controllers -#endif +#endif // _UHS_UNOFFICIAL_IDs_h diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_USB_IDs.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_USB_IDs.h index 417c9f6e6946..9c7591c860ec 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_USB_IDs.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_USB_IDs.h @@ -1,4 +1,4 @@ -/* +/** * USB vendor ids * This file was generated by running python ./make-USB_IDs.py > UHS_USB_IDs.h * Don't change it directly. @@ -2990,4 +2990,4 @@ #define UHS_VID_CONRAD_ELECTRONIC_SE 0xfc08U // Conrad Electronic SE #define UHS_VID_FNK_TECH 0xffeeU // FNK Tech -#endif +#endif // _UHS_USB_IDs_h_ diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UsbCore.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UsbCore.h index 9ec18fbf4122..996384fbea92 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UsbCore.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UsbCore.h @@ -59,8 +59,8 @@ e-mail : support@circuitsathome.com // D6-5 Type (0- standard, 1 - class, 2 - vendor, 3 - reserved) // D4-0 Recipient (0 - device, 1 - interface, 2 - endpoint, 3 - other, 4..31 - reserved) -// TO-DO: Use the python script to generate these. -// TO-DO: Add _all_ subclasses here. +// TODO: Use the python script to generate these. +// TODO: Add _all_ subclasses here. // USB Device Classes, Subclasses and Protocols //////////////////////////////////////////////////////////////////////////////// // Use Class Info in the Interface Descriptors @@ -330,4 +330,4 @@ typedef struct { //#define mkSETUP_PKT8(bmReqType, bRequest, wValLo, wValHi, wInd, total) ((uint64_t)(((uint64_t)(bmReqType))<<56)|(((uint64_t)(bRequest))<<48)|(((uint64_t)(wValLo))<<40)|(((uint64_t)(wValHi))<<32)|(((uint64_t)(wInd))<<16)|((uint64_t)(total))) //#define mkSETUP_PKT16(bmReqType, bRequest, wVal, wInd, total) ((uint64_t)(((uint64_t)(bmReqType))<<56)|(((uint64_t)(bRequest))<<48) |(((uint64_t)(wVal))<<32) |(((uint64_t)(wInd))<<16)|((uint64_t)(total))) -#endif /* USBCORE_H */ +#endif // USBCORE_H diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_address.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_address.h index 3b47bbd892eb..94bf6c3f2d74 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_address.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_address.h @@ -29,8 +29,8 @@ e-mail : support@circuitsathome.com #else #define __ADDRESS_H__ -/* NAK powers. To save space in endpoint data structure, amount of retries before giving up and returning 0x4 is stored in */ -/* bmNakPower as a power of 2. The actual nak_limit is then calculated as nak_limit = ( 2^bmNakPower - 1) */ +// NAK powers. To save space in endpoint data structure, amount of retries before giving up and returning 0x4 is stored in +// bmNakPower as a power of 2. The actual nak_limit is then calculated as nak_limit = ( 2^bmNakPower - 1) #define UHS_USB_NAK_MAX_POWER 14 // NAK binary order maximum value #define UHS_USB_NAK_DEFAULT 13 // default 16K-1 NAKs before giving up #define UHS_USB_NAK_NOWAIT 1 // Single NAK stops transfer diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_hexdump.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_hexdump.h index 945512cfccbb..01beb80e8455 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_hexdump.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_hexdump.h @@ -23,6 +23,7 @@ Circuits At Home, LTD Web : https://www.circuitsathome.com e-mail : support@circuitsathome.com */ + #if !defined(_usb_h_) || defined(__HEXDUMP_H__) #error "Never include UHS_hexdump.h directly; include UHS_Usb.h instead" #else diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host.h index 5d711c1f7439..8029ba591de5 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host.h @@ -23,7 +23,8 @@ Circuits At Home, LTD Web : https://www.circuitsathome.com e-mail : support@circuitsathome.com */ -/* USB functions */ + +// USB functions #ifndef _UHS_host_h_ #define _UHS_host_h_ @@ -52,7 +53,9 @@ e-mail : support@circuitsathome.com #include "UHS_printhex.h" #include "UHS_message.h" -// Load system components as required +/** + * Load system components as required + */ #if defined(LOAD_USB_HOST_SYSTEM) && !defined(USB_HOST_SYSTEM_LOADED) #include "UHS_util_INLINE.h" #include "UHS_host_INLINE.h" @@ -70,8 +73,9 @@ e-mail : support@circuitsathome.com #include "UHS_KINETIS_EHCI/UHS_KINETIS_EHCI.h" #endif -// Load USB drivers and multiplexers - +/** + * Load USB drivers and multiplexers + */ #ifdef LOAD_UHS_HUB #include "UHS_HUB/UHS_HUB.h" #endif // HUB loaded @@ -83,6 +87,7 @@ e-mail : support@circuitsathome.com #ifdef LOAD_GENERIC_STORAGE #include "../UHS_FS/UHS_FS.h" #endif + // Add BT and optionally HID if directed to do so #ifdef LOAD_UHS_BT #include "UHS_BT/UHS_BT.h" diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host_INLINE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host_INLINE.h index d87b40fea299..8578176e1615 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host_INLINE.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host_INLINE.h @@ -160,7 +160,7 @@ uint8_t UHS_USB_HOST_BASE::doSoftReset(uint8_t parent, uint8_t port, uint8_t add return rcode; } -/* +/** * Pseudo code so you may understand the code flow. * * reset; (happens at the lower level) @@ -168,7 +168,7 @@ uint8_t UHS_USB_HOST_BASE::doSoftReset(uint8_t parent, uint8_t port, uint8_t add * reset; * If there are no configuration descriptors { * // - * // Note: I know of no device that does this. + * // NOTE: I know of no device that does this. * // I suppose there could be one though. * // * try to enumerate. @@ -1167,10 +1167,11 @@ uint8_t UHS_NI UHS_VSI::SetInterface(ENUMERATION_INFO *ei) { #if 0 -/* TO-DO: Move this silliness to a NONE driver. +/** + * TODO: Move this silliness to a NONE driver. * When we have a generic NONE driver we can: - * o Extract ALL device information to help users with a new device. - * o Use an unknown device from a sketch, kind of like usblib does. + * - Extract ALL device information to help users with a new device. + * - Use an unknown device from a sketch, kind of like usblib does. * This will aid in making more drivers in a faster way. */ uint8_t UHS_USB_HOST_BASE::DefaultAddressing(uint8_t parent, uint8_t port, uint8_t speed) { diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h index 6e9bb8b7835b..e3487571438b 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h @@ -27,7 +27,8 @@ e-mail : support@circuitsathome.com #ifndef MACROS_H #define MACROS_H #include "macro_logic.h" -/* + +/** * Universal Arduino(tm) "IDE" fixups. */ @@ -167,7 +168,7 @@ e-mail : support@circuitsathome.com #ifndef __BYTE_GRABBING_DEFINED__ #define __BYTE_GRABBING_DEFINED__ 1 #ifdef BROKEN_OPTIMIZER_LITTLE_ENDIAN -// Note: Use this if your compiler generates horrible assembler! +// NOTE: Use this if your compiler generates horrible assembler! #define UHS_UINT8_BYTE0(__usi__) (((uint8_t *)&(__usi__))[0]) #define UHS_UINT8_BYTE1(__usi__) (((uint8_t *)&(__usi__))[1]) #define UHS_UINT8_BYTE2(__usi__) (((uint8_t *)&(__usi__))[2]) @@ -177,7 +178,7 @@ e-mail : support@circuitsathome.com #define UHS_UINT8_BYTE6(__usi__) (((uint8_t *)&(__usi__))[6]) #define UHS_UINT8_BYTE7(__usi__) (((uint8_t *)&(__usi__))[7]) #else -// Note: The cast alone to uint8_t is actually enough. +// NOTE: The cast alone to uint8_t is actually enough. // GCC throws out the "& 0xFF", and the size is no different. // Some compilers need it. #define UHS_UINT8_BYTE0(__usi__) ((uint8_t)((__usi__) & 0xFF )) @@ -206,7 +207,7 @@ e-mail : support@circuitsathome.com #define UHS_BYTES_TO_UINT32(__usc3__,__usc2__,__usc1__,__usc0__) ((uint32_t)((uint32_t)(__usc0__) | UHS_UINT32_SET_BYTE1(__usc1__) | UHS_UINT32_SET_BYTE2(__usc2__) | UHS_UINT32_SET_BYTE3(__usc3__))) #define UHS_BYTES_TO_UINT64(__usc7__,__usc6__,__usc5__,__usc4__,__usc3__,__usc2__,__usc1__,__usc0__) ((uint64_t)((uint64_t)__usc0__ | UHS_UINT64_SET_BYTE1(__usc1__) | UHS_UINT64_SET_BYTE2(__usc2__) | UHS_UINT64_SET_BYTE3(__usc3__) | UHS_UINT64_SET_BYTE4(__usc4__) | UHS_UINT64_SET_BYTE5(__usc5__) | UHS_UINT64_SET_BYTE6(__usc6__) | UHS_UINT64_SET_BYTE7(__usc7__))) #endif -/* +/** * Debug macros. * Useful when porting from UHS2. * Do not use these for any new code. @@ -224,4 +225,4 @@ e-mail : support@circuitsathome.com #ifndef NOTUSED #define NOTUSED(...) __VA_ARGS__ __attribute__((unused)) #endif -#endif /* MACROS_H */ +#endif // MACROS_H diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_message.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_message.h index c0cc78d15f97..259c0b5feeae 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_message.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_message.h @@ -23,6 +23,7 @@ Circuits At Home, LTD Web : https://www.circuitsathome.com e-mail : support@circuitsathome.com */ + #if !defined(_UHS_host_h_) || defined(__MESSAGE_H__) #error "Never include UHS_message.h directly; include UHS_Usb.h instead" #else diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printf_HELPER.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printf_HELPER.h index bb464d7adf82..4112487d573f 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printf_HELPER.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printf_HELPER.h @@ -75,7 +75,7 @@ e-mail : support@circuitsathome.com #endif #ifdef ARDUINO_ARCH_PIC32 -/* +/** * For printf() output with pic32 Arduino */ extern "C" { @@ -189,10 +189,10 @@ void UHS_AVR_printf_HELPER_init() { #define UHS_printf_HELPER_init() UHS_AVR_printf_HELPER_init() #endif -#endif /* STDIO_IS_OK_TO_USE_AS_IS */ -#endif /* load.... */ +#endif // STDIO_IS_OK_TO_USE_AS_IS +#endif // load.... #ifndef UHS_printf_HELPER_init #define UHS_printf_HELPER_init() (void(0)) #endif -#endif /* UHS_PRINTF_HELPER_H */ +#endif // UHS_PRINTF_HELPER_H diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_settings.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_settings.h index 03bf1c1c07ec..96407150727f 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_settings.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_settings.h @@ -27,7 +27,7 @@ e-mail : support@circuitsathome.com #ifndef UHS_SETTINGS_H #define UHS_SETTINGS_H -// TO-DO: Move specific settings to modules which use them. +// TODO: Move specific settings to modules which use them. //////////////////////////////////////////////////////////////////////////////// // Define any of these options at the top of your sketch to override @@ -137,4 +137,4 @@ e-mail : support@circuitsathome.com #define UHS_NI __attribute__((noinline)) #endif -#endif /* SETTINGS_H */ +#endif // SETTINGS_H diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usb_ch9.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usb_ch9.h index 013be2a9d46f..332487314d43 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usb_ch9.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usb_ch9.h @@ -28,16 +28,16 @@ e-mail : support@circuitsathome.com #error "Never include UHS_usb_ch9.h directly; include UHS_Usb.h instead" #else -/* USB chapter 9 structures */ +// USB chapter 9 structures #define _UHS_ch9_h_ -/* Misc.USB constants */ +// Misc.USB constants #define DEV_DESCR_LEN 18 //device descriptor length #define CONF_DESCR_LEN 9 //configuration descriptor length #define INTR_DESCR_LEN 9 //interface descriptor length #define EP_DESCR_LEN 7 //endpoint descriptor length -/* Standard Device Requests */ +// Standard Device Requests #define USB_REQUEST_GET_STATUS 0 // Standard Device Request - GET STATUS #define USB_REQUEST_CLEAR_FEATURE 1 // Standard Device Request - CLEAR FEATURE #define USB_REQUEST_SET_FEATURE 3 // Standard Device Request - SET FEATURE @@ -50,7 +50,7 @@ e-mail : support@circuitsathome.com #define USB_REQUEST_SET_INTERFACE 11 // Standard Device Request - SET INTERFACE #define USB_REQUEST_SYNCH_FRAME 12 // Standard Device Request - SYNCH FRAME -/* Wireless USB Device Requests */ +// Wireless USB Device Requests #define USB_REQ_SET_ENCRYPTION 0x0D #define USB_REQ_GET_ENCRYPTION 0x0E #define USB_REQ_RPIPE_ABORT 0x0E @@ -65,26 +65,26 @@ e-mail : support@circuitsathome.com #define USB_REQ_LOOPBACK_DATA_READ 0x16 #define USB_REQ_SET_INTERFACE_DS 0x17 -/* USB feature flags */ -#define USB_DEVICE_SELF_POWERED 0 /* (read only) */ -#define USB_DEVICE_REMOTE_WAKEUP 1 /* dev may initiate wakeup */ -#define USB_DEVICE_TEST_MODE 2 /* (wired high speed only) */ -#define USB_DEVICE_BATTERY 2 /* (wireless) */ -#define USB_DEVICE_B_HNP_ENABLE 3 /* (otg) dev may initiate HNP */ -#define USB_DEVICE_WUSB_DEVICE 3 /* (wireless)*/ -#define USB_DEVICE_A_HNP_SUPPORT 4 /* (otg) RH port supports HNP */ -#define USB_DEVICE_A_ALT_HNP_SUPPORT 5 /* (otg) other RH port does */ -#define USB_DEVICE_DEBUG_MODE 6 /* (special devices only) */ +// USB feature flags +#define USB_DEVICE_SELF_POWERED 0 // (read only) +#define USB_DEVICE_REMOTE_WAKEUP 1 // dev may initiate wakeup +#define USB_DEVICE_TEST_MODE 2 // (wired high speed only) +#define USB_DEVICE_BATTERY 2 // (wireless) +#define USB_DEVICE_B_HNP_ENABLE 3 // (otg) dev may initiate HNP +#define USB_DEVICE_WUSB_DEVICE 3 // (wireless) +#define USB_DEVICE_A_HNP_SUPPORT 4 // (otg) RH port supports HNP +#define USB_DEVICE_A_ALT_HNP_SUPPORT 5 // (otg) other RH port does +#define USB_DEVICE_DEBUG_MODE 6 // (special devices only) #define USB_FEATURE_ENDPOINT_HALT 0 // CLEAR/SET FEATURE - Endpoint Halt #define USB_FEATURE_DEVICE_REMOTE_WAKEUP 1 // CLEAR/SET FEATURE - Device remote wake-up #define USB_FEATURE_TEST_MODE 2 // CLEAR/SET FEATURE - Test mode -/* OTG SET FEATURE Constants */ +// OTG SET FEATURE Constants #define OTG_FEATURE_B_HNP_ENABLE 3 // SET FEATURE OTG - Enable B device to perform HNP #define OTG_FEATURE_A_HNP_SUPPORT 4 // SET FEATURE OTG - A device supports HNP #define OTG_FEATURE_A_ALT_HNP_SUPPORT 5 // SET FEATURE OTG - Another port on the A device supports HNP -/* Setup Data Constants */ +// Setup Data Constants #define USB_SETUP_HOST_TO_DEVICE 0x00 // Device Request bmRequestType transfer direction - host to device transfer #define USB_SETUP_DEVICE_TO_HOST 0x80 // Device Request bmRequestType transfer direction - device to host transfer #define USB_SETUP_TYPE_STANDARD 0x00 // Device Request bmRequestType type - standard @@ -97,7 +97,7 @@ e-mail : support@circuitsathome.com #define USB_SETUP_RECIPIENT_PORT 0x04 // Wireless USB 1.0 #define USB_SETUP_RECIPIENT_RPIPE 0x05 // Wireless USB 1.0 -/* USB descriptors */ +// USB descriptors #define USB_DESCRIPTOR_DEVICE 0x01 // bDescriptorType for a Device Descriptor. #define USB_DESCRIPTOR_CONFIGURATION 0x02 // bDescriptorType for a Configuration Descriptor. #define USB_DESCRIPTOR_STRING 0x03 // bDescriptorType for a String Descriptor. @@ -129,7 +129,7 @@ e-mail : support@circuitsathome.com #define USB_DESCRIPTOR_CS_INTERFACE 0x24 #define USB_DESCRIPTOR_CS_ENDPOINT 0x25 -/* USB Endpoint Transfer Types */ +// USB Endpoint Transfer Types #define USB_TRANSFER_TYPE_CONTROL 0x00 // Endpoint is a control endpoint. #define USB_TRANSFER_TYPE_ISOCHRONOUS 0x01 // Endpoint is an isochronous endpoint. #define USB_TRANSFER_TYPE_BULK 0x02 // Endpoint is a bulk endpoint. @@ -137,14 +137,14 @@ e-mail : support@circuitsathome.com #define bmUSB_TRANSFER_TYPE 0x03 // bit mask to separate transfer type from ISO attributes #define USB_TRANSFER_DIRECTION_IN 0x80 // Indicate direction is IN -/* Standard Feature Selectors for CLEAR_FEATURE Requests */ +// Standard Feature Selectors for CLEAR_FEATURE Requests #define USB_FEATURE_ENDPOINT_STALL 0 // Endpoint recipient #define USB_FEATURE_DEVICE_REMOTE_WAKEUP 1 // Device recipient #define USB_FEATURE_TEST_MODE 2 // Device recipient -/* descriptor data structures */ +// descriptor data structures -/* Device descriptor structure */ +// Device descriptor structure typedef struct { uint8_t bLength; // Length of this descriptor. uint8_t bDescriptorType; // DEVICE descriptor type (USB_DESCRIPTOR_DEVICE). @@ -162,7 +162,7 @@ typedef struct { uint8_t bNumConfigurations; // Number of possible configurations. } __attribute__((packed)) USB_FD_DEVICE_DESCRIPTOR; -/* Configuration descriptor structure */ +// Configuration descriptor structure typedef struct { uint8_t bLength; // Length of this descriptor. uint8_t bDescriptorType; // CONFIGURATION descriptor type (USB_DESCRIPTOR_CONFIGURATION). @@ -174,7 +174,7 @@ typedef struct { uint8_t bMaxPower; // Maximum power consumed by this configuration. } __attribute__((packed)) USB_FD_CONFIGURATION_DESCRIPTOR; -/* Interface descriptor structure */ +// Interface descriptor structure typedef struct { uint8_t bLength; // Length of this descriptor. uint8_t bDescriptorType; // INTERFACE descriptor type (USB_DESCRIPTOR_INTERFACE). @@ -187,7 +187,7 @@ typedef struct { uint8_t iInterface; // Index of String Descriptor describing the interface. } __attribute__((packed)) USB_FD_INTERFACE_DESCRIPTOR; -/* Endpoint descriptor structure */ +// Endpoint descriptor structure typedef struct { uint8_t bLength; // Length of this descriptor. uint8_t bDescriptorType; // ENDPOINT descriptor type (USB_DESCRIPTOR_ENDPOINT). @@ -197,7 +197,7 @@ typedef struct { uint8_t bInterval; // Polling interval in frames. } __attribute__((packed)) USB_FD_ENDPOINT_DESCRIPTOR; -/* HID descriptor */ +// HID descriptor /* typedef struct { uint8_t bLength; diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usbhost.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usbhost.h index b81dbf2a28f0..26806ae0ca60 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usbhost.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usbhost.h @@ -445,5 +445,5 @@ class UHS_VSI : public UHS_USBInterface { }; #endif -#endif //_USBHOST_H_ -#endif +#endif // _USBHOST_H_ +#endif // !_UHS_host_h_ diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_util_INLINE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_util_INLINE.h index 52015b59877a..a4f129b07d09 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_util_INLINE.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_util_INLINE.h @@ -29,7 +29,7 @@ e-mail : support@circuitsathome.com // 0x80 is the default (i.e. trace) to turn off set this global to something lower. // this allows for 126 other debugging levels. -// TO-DO: Allow assignment to a different serial port by software +// TODO: Allow assignment to a different serial port by software int UsbDEBUGlvl = 0x80; void E_Notifyc(char c, int lvl) { diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/UHS_max3421e.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/UHS_max3421e.h index 841cc8fe75c5..0ef3df29a098 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/UHS_max3421e.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/UHS_max3421e.h @@ -22,18 +22,17 @@ e-mail : support@circuitsathome.com #define _max3421e_h_ -/* MAX3421E register/bit names and bitmasks */ - +// MAX3421E register/bit names and bitmasks #define SE0 0 #define SE1 1 #define FSHOST 2 #define LSHOST 3 -/* MAX3421E command byte format: rrrrr0wa where 'r' is register number */ +/** + * MAX3421E command byte format: rrrrr0wa where 'r' is register number + */ -// // MAX3421E Registers in HOST mode. -// #define rRCVFIFO 0x08 // Receive FIFO Register #define rSNDFIFO 0x10 // Send FIFO Register #define rSUDFIFO 0x20 // Set Up Data FIFO Register @@ -144,11 +143,12 @@ e-mail : support@circuitsathome.com #define bmGPINPOL6 0x40 // #define bmGPINPOL7 0x80 // -// -// If any data transfer errors occur, the HXFRDNIRQ asserts, while the RCVDAVIRQ does not. -// -// The CPU clears the SNDBAVIRQ by writing the SNDBC register. -// The CPU should never directly clear the SNDBAVIRQ bit. +/** + * If any data transfer errors occur, the HXFRDNIRQ asserts, while the RCVDAVIRQ does not. + * + * The CPU clears the SNDBAVIRQ by writing the SNDBC register. + * The CPU should never directly clear the SNDBAVIRQ bit. + */ // Host Interrupt Request Status (HIRQ) #define rHIRQ 0xC8 // Host Interrupt Request Register @@ -201,8 +201,9 @@ e-mail : support@circuitsathome.com // Host transfer (HXFR) #define rHXFR 0xF0 //30<<3 -/* Host transfer token values for writing the HXFR register (R30) */ -/* OR this bit field with the endpoint number in bits 3:0 */ + +// Host transfer token values for writing the HXFR register (R30) +// OR this bit field with the endpoint number in bits 3:0 #define MAX3421E_tokSETUP 0x10 // HS=0, ISO=0, OUTNIN=0, SETUP=1 #define MAX3421E_tokIN 0x00 // HS=0, ISO=0, OUTNIN=0, SETUP=0 #define MAX3421E_tokOUT 0x20 // HS=0, ISO=0, OUTNIN=1, SETUP=0 @@ -223,4 +224,4 @@ e-mail : support@circuitsathome.com #define MODE_FS_HOST (bmDPPULLDN|bmDMPULLDN|bmHOST|bmSOFKAENAB) #define MODE_LS_HOST (bmDPPULLDN|bmDMPULLDN|bmHOST|bmLOWSPEED|bmSOFKAENAB) -#endif //_max3421e_h_ +#endif // _max3421e_h_ diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h index eb4f35eb136f..5a8586696817 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h @@ -139,7 +139,7 @@ e-mail : support@circuitsathome.com //#define UHS_MAX3421E_SPD 100000 #elif defined(CORE_TEENSY) && (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)) -// TO-DO! +// TODO: #if EXT_RAM // Teensy++ 2.0 with XMEM2 @@ -292,11 +292,11 @@ public UHS_USB_HOST_BASE , public dyn_SWI #endif { - // TO-DO: move these into the parent class. + // TODO: move these into the parent class. volatile uint8_t vbusState; volatile uint16_t sof_countdown; - // TO-DO: pack into a struct/union and use one byte + // TODO: pack into a struct/union and use one byte volatile bool busevent; volatile bool sofevent; volatile bool counted; @@ -510,4 +510,4 @@ public UHS_USB_HOST_BASE #else #error "define LOAD_USB_HOST_SHIELD in your sketch, never include USB_HOST_SHIELD.h in a driver." #endif -#endif /* USB_HOST_SHIELD_H */ +#endif // USB_HOST_SHIELD_H diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h index f126a6fcef74..3e8573a28a12 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (C) 2015-2016 Andrew J. Kroll * and * Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. @@ -16,7 +16,6 @@ * Circuits At Home, LTD * Web : https://www.circuitsathome.com * e-mail : support@circuitsathome.com - * */ #if defined(USB_HOST_SHIELD_H) && !defined(USB_HOST_SHIELD_LOADED) @@ -984,7 +983,7 @@ void UHS_NI MAX3421E_HOST::ISRbottom() { interrupts(); #endif ISRbottom(); - #endif /* SWI_IRQ_NUM */ + #endif // SWI_IRQ_NUM } } } @@ -995,4 +994,4 @@ void UHS_NI MAX3421E_HOST::ISRbottom() { #else #error "Never include USB_HOST_SHIELD_INLINE.h, include UHS_host.h instead" -#endif +#endif // USB_HOST_SHIELD_LOADED diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/macro_logic.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/macro_logic.h index 1318ea8b287f..7d97a18cc28b 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/macro_logic.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/macro_logic.h @@ -1,4 +1,4 @@ -/* +/** * File: macro_logic.h * Author: root * @@ -147,4 +147,4 @@ Make 3 bogus function bodies AJK_MAKE_FUNS(unsigned Cfunc,(arg1, arg2),3,BODY) #endif -#endif /* MACRO_LOGIC_H */ +#endif // MACRO_LOGIC_H diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/SWI_INLINE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/SWI_INLINE.h index f50b3bd4c1e8..cf385d72c350 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/SWI_INLINE.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/SWI_INLINE.h @@ -1,4 +1,4 @@ -/* +/** * File: SWI_INLINE.h * Author: xxxajk@gmail.com * @@ -74,7 +74,7 @@ void softISR() { #endif // - // TO-DO: Perhaps limit to 8, and inline this? + // TODO: Perhaps limit to 8, and inline this? // // Make a working copy, while clearing the queue. @@ -233,8 +233,8 @@ int exec_SWI(const dyn_SWI* klass) { return rc; } -#endif /* defined(__arm__) */ -#endif /* SWI_INLINE_H */ +#endif // defined(__arm__) +#endif // SWI_INLINE_H #else #error "Never include SWI_INLINE.h directly, include dyn_SWI.h instead" -#endif +#endif // DYN_SWI_H diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/dyn_SWI.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/dyn_SWI.h index 652b43fd2e36..5f1d044d703e 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/dyn_SWI.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/dyn_SWI.h @@ -1,4 +1,4 @@ -/* +/** * File: dyn_SWI.h * Author: xxxajk@gmail.com * @@ -157,8 +157,8 @@ extern int exec_SWI(const dyn_SWI* klass); // IMPORTANT! Define this so that you do NOT end up with a NULL stub! #define SWI_NO_STUB -#endif /* SWI_IRQ_NUM */ -#endif /* __arm__ */ +#endif // SWI_IRQ_NUM +#endif // __arm__ // if no SWI for CPU (e.g. AVR) make a void stub. #ifndef SWI_NO_STUB @@ -167,4 +167,4 @@ extern int exec_SWI(const dyn_SWI* klass); #define DDSB() (void(0)) #endif #endif -#endif /* DYN_SWI_H */ +#endif // DYN_SWI_H From 707ccfa69feb7efada4c66c423fc75390f12f294 Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Sat, 13 Jul 2024 08:01:31 -0400 Subject: [PATCH 6/8] update HAL/STM32F1/SPI.cpp --- Marlin/src/HAL/STM32F1/SPI.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Marlin/src/HAL/STM32F1/SPI.cpp b/Marlin/src/HAL/STM32F1/SPI.cpp index ab111ddbf01b..b3897f522ec9 100644 --- a/Marlin/src/HAL/STM32F1/SPI.cpp +++ b/Marlin/src/HAL/STM32F1/SPI.cpp @@ -43,7 +43,7 @@ #include "../../inc/MarlinConfig.h" #include "spi_pins.h" -/** Time in ms for DMA receive timeout */ +// Time in ms for DMA receive timeout #define DMA_TIMEOUT 100 #if CYCLES_PER_MICROSECOND != 72 @@ -151,7 +151,7 @@ SPIClass::SPIClass(uint32_t spi_num) { _settings[2].spiRxDmaChannel = DMA_CH1; #endif - // added for DMA callbacks. + // Added for DMA callbacks. _currentSetting->state = SPI_STATE_IDLE; } @@ -179,7 +179,7 @@ void SPIClass::begin() { spi_init(_currentSetting->spi_d); configure_gpios(_currentSetting->spi_d, 1); updateSettings(); - // added for DMA callbacks. + // Added for DMA callbacks. _currentSetting->state = SPI_STATE_READY; } @@ -188,7 +188,7 @@ void SPIClass::beginSlave() { configure_gpios(_currentSetting->spi_d, 0); uint32_t flags = ((_currentSetting->bitOrder == MSBFIRST ? SPI_FRAME_MSB : SPI_FRAME_LSB) | _currentSetting->dataSize); spi_slave_enable(_currentSetting->spi_d, (spi_mode)_currentSetting->dataMode, flags); - // added for DMA callbacks. + // Added for DMA callbacks. _currentSetting->state = SPI_STATE_READY; } @@ -204,12 +204,12 @@ void SPIClass::end() { waitSpiTxEnd(_currentSetting->spi_d); spi_peripheral_disable(_currentSetting->spi_d); - // added for DMA callbacks. + // Added for DMA callbacks. // Need to add unsetting the callbacks for the DMA channels. _currentSetting->state = SPI_STATE_IDLE; } -/* Roger Clark added 3 functions */ +// Roger Clark added 3 functions void SPIClass::setClockDivider(uint32_t clockDivider) { _currentSetting->clockDivider = clockDivider; uint32_t cr1 = _currentSetting->spi_d->regs->CR1 & ~(SPI_CR1_BR); @@ -237,7 +237,7 @@ void SPIClass::setDataSize(uint32_t datasize) { void SPIClass::setDataMode(uint8_t dataMode) { /** - * Notes: + * NOTES: * As far as we know the AVR numbers for dataMode match the numbers required by the STM32. * From the AVR doc https://www.atmel.com/images/doc2585.pdf section 2.4 * @@ -297,7 +297,7 @@ void SPIClass::read(uint8_t *buf, uint32_t len) { spi_rx_reg(_currentSetting->spi_d); // clear the RX buffer in case a byte is waiting on it. spi_reg_map * regs = _currentSetting->spi_d->regs; // start sequence: write byte 0 - regs->DR = 0x00FF; // write the first byte + regs->DR = 0x00FF; // write the first byte // main loop while (--len) { while (!(regs->SR & SPI_SR_TXE)) { /* nada */ } // wait for TXE flag @@ -313,7 +313,8 @@ void SPIClass::read(uint8_t *buf, uint32_t len) { } void SPIClass::write(uint16_t data) { - /* Added for 16bit data Victor Perez. Roger Clark + /** + * Added for 16bit data Victor Perez. Roger Clark * Improved speed by just directly writing the single byte to the SPI data reg and wait for completion, * by taking the Tx code from transfer(byte) * This almost doubles the speed of this function. @@ -713,7 +714,7 @@ static const spi_baud_rate baud_rates[8] __FLASH__ = { }; /** - * Note: This assumes you're on a LeafLabs-style board + * NOTE: This assumes you're on a LeafLabs-style board * (CYCLES_PER_MICROSECOND == 72, APB2 at 72MHz, APB1 at 36MHz). */ static spi_baud_rate determine_baud_rate(spi_dev *dev, uint32_t freq) { From 1046963f957f12517a2050d15c40d7b65d81f326 Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Sat, 13 Jul 2024 08:08:29 -0400 Subject: [PATCH 7/8] update W25Qxx.cpp spacing --- Marlin/src/libs/W25Qxx.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/libs/W25Qxx.cpp b/Marlin/src/libs/W25Qxx.cpp index 558d604ea52d..fec832e22f54 100644 --- a/Marlin/src/libs/W25Qxx.cpp +++ b/Marlin/src/libs/W25Qxx.cpp @@ -63,7 +63,7 @@ void W25QXXFlash::init(uint8_t spiRate) { case SPI_EIGHTH_SPEED: clock = SPI_CLOCK_DIV16; break; case SPI_SPEED_5: clock = SPI_CLOCK_DIV32; break; case SPI_SPEED_6: clock = SPI_CLOCK_DIV64; break; - default: clock = SPI_CLOCK_DIV2;// Default from the SPI library + default: clock = SPI_CLOCK_DIV2; // Default from the SPI library } mySPI.setClockDivider(clock); From c8bfcda68ca861e34c3458fc512c764771a42d43 Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Wed, 17 Jul 2024 02:53:18 -0400 Subject: [PATCH 8/8] update comments --- Marlin/src/lcd/tft/ui_color_ui.cpp | 3 ++- Marlin/src/libs/numtostr.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Marlin/src/lcd/tft/ui_color_ui.cpp b/Marlin/src/lcd/tft/ui_color_ui.cpp index 9861cbc1f6ff..df1263ff5fa6 100644 --- a/Marlin/src/lcd/tft/ui_color_ui.cpp +++ b/Marlin/src/lcd/tft/ui_color_ui.cpp @@ -81,7 +81,8 @@ void MarlinUI::tft_idle() { if ((BOOTSCREEN_TIMEOUT) > sofar) safe_delay((BOOTSCREEN_TIMEOUT) - sofar); clear_for_drawing(); } -#endif + +#endif // SHOW_BOOTSCREEN void MarlinUI::draw_kill_screen() { tft.queue.reset(); diff --git a/Marlin/src/libs/numtostr.h b/Marlin/src/libs/numtostr.h index fde07e836846..d718f6dca530 100644 --- a/Marlin/src/libs/numtostr.h +++ b/Marlin/src/libs/numtostr.h @@ -59,7 +59,7 @@ const char* i16tostr3rj(const int16_t x); // Convert signed int to lj string with 123 format const char* i16tostr3left(const int16_t xx); -// Convert signed int to rj string with _123, -123, _-12, or __-1 format +// Convert signed int to rj string with 1234, _123, -123, _-12, or __-1 format const char* i16tostr4signrj(const int16_t x); // Convert unsigned float to string with 1.2 format @@ -156,7 +156,7 @@ FORCE_INLINE const char* ftostr3rj(const_float_t x) { return i16tostr3rj(int16_t // Convert signed float to rj string with 1234, _123, 12.3, _1.2, -123, _-12, or -1.2 format const char* ftostr4sign(const_float_t fx); #else - // Convert signed float to rj string with 1234, _123, -123, __12, _-12, ___1, or __-1 format + // Convert signed float to rj string with 1234, _123, -123, _-12, or __-1 format FORCE_INLINE const char* ftostr4sign(const_float_t x) { return i16tostr4signrj(int16_t(x + (x < 0 ? -0.5f : 0.5f))); } #endif