Merge coil errors, fix bit masks

pull/66/head
D.R.racer 2021-07-27 10:26:47 +02:00
parent abc92105ed
commit 461ef5a008
1 changed files with 18 additions and 12 deletions

View File

@ -26,29 +26,35 @@ enum class ErrorCode : uint_fast16_t {
FILAMENT_ALREADY_LOADED = 0x8005, ///< cannot perform operation LoadFilament or move the selector as the filament is already loaded
MMU_NOT_RESPONDING = 0x801e, ///< internal error of the printer - communication with the MMU is not working
MMU_NOT_RESPONDING = 0x802e, ///< internal error of the printer - communication with the MMU is not working
INTERNAL = 0x801f, ///< internal runtime error (software)
INTERNAL = 0x802f, ///< internal runtime error (software)
// TMC bit masks
TMC_PULLEY_BIT = 0x0020, ///< TMC Pulley bit
TMC_SELECTOR_BIT = 0x0040, ///< TMC Pulley bit
TMC_IDLER_BIT = 0x0080, ///< TMC Pulley bit
TMC_PULLEY_BIT = 0x0040, ///< TMC Pulley bit
TMC_SELECTOR_BIT = 0x0080, ///< TMC Pulley bit
TMC_IDLER_BIT = 0x0100, ///< TMC Pulley bit
TMC_IOIN_MISMATCH = 0x8100, ///< TMC driver init error - TMC dead or bad communication
TMC_IOIN_MISMATCH = 0x8200, ///< TMC driver init error - TMC dead or bad communication
/// TMC driver reset - recoverable, we just need to rehome the axis
/// Idler: can be rehomed any time
/// Selector: if there is a filament, remove it and rehome, if there is no filament, just rehome
/// Pulley: do nothing - for the loading sequence - just restart and move slowly, for the unload sequence just restart
TMC_RESET = 0x8200,
TMC_RESET = 0x8400,
TMC_UNDERVOLTAGE_ON_CHARGE_PUMP = 0x8400, ///< not enough current for the TMC, NOT RECOVERABLE
TMC_UNDERVOLTAGE_ON_CHARGE_PUMP = 0x8800, ///< not enough current for the TMC, NOT RECOVERABLE
TMC_SERIOUS_COIL_ERROR = 0x8800, ///< TMC driver serious error coil A or coil B - dangerous to recover
TMC_COIL_ERROR = 0x9000, ///< TMC driver error coil A or coil B - can be recovered
TMC_SHORT_TO_GROUND = 0x9000, ///< TMC driver serious error - short to ground on coil A or coil B - dangerous to recover
TMC_OVER_TEMPERATURE_WARN = 0xA000, ///< TMC driver over temperature warning - can be recovered by restarting the driver
TMC_OVER_TEMPERATURE_ERROR = 0xC000, ///< TMC driver over temperature error - the TMC probably fried
/// TMC driver over temperature warning - can be recovered by restarting the driver.
/// If this error happens, we should probably go into the error state as soon as the current command is finished.
/// The driver technically still works at this point.
TMC_OVER_TEMPERATURE_WARN = 0xA000,
/// TMC driver over temperature error - we really shouldn't ever reach this error.
/// It can still be recovered if the driver cools down below 120C.
/// The driver needs to be disabled and enabled again for operation to resume after this error is cleared.
TMC_OVER_TEMPERATURE_ERROR = 0xC000,
};