🧑‍💻 Misc. updates for extra axes (#23521)

This commit is contained in:
Scott Lahteine
2022-01-14 03:14:13 -06:00
committed by GitHub
parent 70d3607f56
commit 40481947fc
27 changed files with 289 additions and 205 deletions

View File

@@ -68,10 +68,10 @@ namespace DirectStepping {
static State state;
static volatile bool fatal_error;
static volatile PageState page_states[Cfg::NUM_PAGES];
static volatile PageState page_states[Cfg::PAGE_COUNT];
static volatile bool page_states_dirty;
static uint8_t pages[Cfg::NUM_PAGES][Cfg::PAGE_SIZE];
static uint8_t pages[Cfg::PAGE_COUNT][Cfg::PAGE_SIZE];
static uint8_t checksum;
static write_byte_idx_t write_byte_idx;
static page_idx_t write_page_idx;
@@ -87,8 +87,8 @@ namespace DirectStepping {
struct config_t {
static constexpr char CONTROL_CHAR = '!';
static constexpr int NUM_PAGES = num_pages;
static constexpr int NUM_AXES = num_axes;
static constexpr int PAGE_COUNT = num_pages;
static constexpr int AXIS_COUNT = num_axes;
static constexpr int BITS_SEGMENT = bits_segment;
static constexpr int DIRECTIONAL = dir ? 1 : 0;
static constexpr int SEGMENTS = segments;
@@ -96,10 +96,10 @@ namespace DirectStepping {
static constexpr int NUM_SEGMENTS = _BV(BITS_SEGMENT);
static constexpr int SEGMENT_STEPS = _BV(BITS_SEGMENT - DIRECTIONAL) - 1;
static constexpr int TOTAL_STEPS = SEGMENT_STEPS * SEGMENTS;
static constexpr int PAGE_SIZE = (NUM_AXES * BITS_SEGMENT * SEGMENTS) / 8;
static constexpr int PAGE_SIZE = (AXIS_COUNT * BITS_SEGMENT * SEGMENTS) / 8;
typedef typename TypeSelector<(PAGE_SIZE>256), uint16_t, uint8_t>::type write_byte_idx_t;
typedef typename TypeSelector<(NUM_PAGES>256), uint16_t, uint8_t>::type page_idx_t;
typedef typename TypeSelector<(PAGE_COUNT>256), uint16_t, uint8_t>::type page_idx_t;
};
template <uint8_t num_pages>