Improve/fix some comments

pull/112/head
D.R.racer 2021-08-27 08:42:32 +02:00 committed by DRracer
parent 74629f0103
commit 5571e77809
4 changed files with 7 additions and 6 deletions

View File

@ -15,7 +15,7 @@ bool TMC2130::Init(const MotorParams &params, const MotorCurrents &currents, Mot
// if the version is incorrect or a bit always set to 1 is suddenly 0
// (the supposed SD_MODE pin that doesn't exist on this driver variant)
if (((IOIN >> 24U) != 0x11) | !(IOIN & (1U << 6U)))
return true; // @todo return some kind of failure
return true; // @@TODO return some kind of failure
///clear reset_flag as we are (re)initializing
errorFlags.reset_flag = false;
@ -63,7 +63,7 @@ bool TMC2130::Init(const MotorParams &params, const MotorCurrents &currents, Mot
void TMC2130::SetMode(const MotorParams &params, MotorMode mode) {
///0xFFF00 is used as a "Normal" mode threshold since stealthchop will be used at standstill.
WriteRegister(params, Registers::TPWMTHRS, (mode == Stealth) ? 70 : 0xFFF00); // @todo should be configurable
WriteRegister(params, Registers::TPWMTHRS, (mode == Stealth) ? 70 : 0xFFF00); // @@TODO should be configurable
}
void TMC2130::SetCurrents(const MotorParams &params, const MotorCurrents &currents) {
@ -81,7 +81,7 @@ void TMC2130::SetEnabled(const MotorParams &params, bool enabled) {
}
void TMC2130::ClearStallguard(const MotorParams &params) {
// @todo: maximum resolution right now is x256/4 (uint8_t / 4)
// @@TODO maximum resolution right now is x256/4 (uint8_t / 4)
sg_counter = 4 * (1 << (8 - params.mRes)) - 1; /// one electrical full step (4 steps when fullstepping)
}
@ -132,6 +132,7 @@ void TMC2130::_spi_tx_rx(const MotorParams &params, uint8_t (&pData)[5]) {
}
void TMC2130::_handle_spi_status(const MotorParams &params, uint8_t status) {
//@@TODO
// errorFlags.reset_flag |= status & (1 << 0);
// errorFlags.driver_error |= status & (1 << 1);
}

View File

@ -140,7 +140,7 @@ private:
ErrorFlags errorFlags;
bool enabled = false;
uint8_t sg_counter;
uint8_t sg_counter = 0;
};
} // namespace tmc2130

View File

@ -63,7 +63,7 @@ bool CommandBase::Step() {
// if (ms::selector.State() == ms::Selector::Failed) {
// state = ProgressCode::ERRTMCFailed;
// error |= TMC2130ToErrorCode(mm::motion.DriverForAxis(mm::Axis::Selector), mm::Axis::Selector);
// return true; // the HW error prevents us from continuing with the with the state machine - the MMU must be restarted/fixed before continuing
// return true; // the HW error prevents us from continuing with the state machine - the MMU must be restarted/fixed before continuing
// }
// @@TODO not sure how to prevent losing the previously accumulated error ... or do I really need to do it?

View File

@ -14,7 +14,7 @@
/// TMC_PULLEY_BIT, TMC_SELECTOR_BIT, TMC_IDLER_BIT,
/// The resulting error is a bitwise OR over 3 TMC drivers and their status, which should cover most of the situations correctly.
enum class ErrorCode : uint_fast16_t {
RUNNING = 0x0000, ///< the operation is still running
RUNNING = 0x0000, ///< the operation is still running - keep this value as ZERO as it is used for initialization of error codes as well
OK = 0x0001, ///< the operation finished OK
/// Unload Filament related error codes