Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RawProgressCode & ProgressCode::_cnt #313

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/logic/progress_codes.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@
#pragma once
#include <stdint.h>

/// Base class for ProgressCode and its extensions
using RawProgressCode = uint_fast8_t;

/// A complete set of progress codes which may be reported while running a high-level command/operation
/// This header file shall be included in the printer's firmware as well as a reference,
/// therefore the progress codes have been extracted to one place
enum class ProgressCode : uint_fast8_t {
enum class ProgressCode : RawProgressCode {
OK = 0, ///< finished ok

EngagingIdler, // P1
DisengagingIdler, // P2
UnloadingToFinda, // P3
UnloadingToPulley, //P4
UnloadingToPulley, // P4
FeedingToFinda, // P5
FeedingToBondtech, // P6
FeedingToNozzle, // P7
Expand All @@ -37,7 +40,7 @@ enum class ProgressCode : uint_fast8_t {
RetractingFromFinda, // P25

Homing, // P26
MovingSelector, // P27
MovingSelector, // P2

FeedingToFSensor, // P28

Expand All @@ -50,5 +53,9 @@ enum class ProgressCode : uint_fast8_t {
HWTestDisplay, // P35
ErrHwTestFailed, // P36

/// Keep as the last item (except for Empty)
/// Used for extending the progress codes on the printer side
_cnt,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏 add a comment describing the fact, that _cnt shall be kept pre-last just before the Empty item


Empty = 0xff // dummy empty state
};
Loading