|
@@ -57,9 +57,6 @@ namespace DirectStepping {
|
57
|
57
|
volatile bool SerialPageManager<Cfg>::page_states_dirty;
|
58
|
58
|
|
59
|
59
|
template<typename Cfg>
|
60
|
|
- millis_t SerialPageManager<Cfg>::next_response;
|
61
|
|
-
|
62
|
|
- template<typename Cfg>
|
63
|
60
|
uint8_t SerialPageManager<Cfg>::pages[Cfg::NUM_PAGES][Cfg::PAGE_SIZE];
|
64
|
61
|
|
65
|
62
|
template<typename Cfg>
|
|
@@ -80,7 +77,6 @@ namespace DirectStepping {
|
80
|
77
|
page_states[i] = PageState::FREE;
|
81
|
78
|
|
82
|
79
|
fatal_error = false;
|
83
|
|
- next_response = 0;
|
84
|
80
|
state = State::NEWLINE;
|
85
|
81
|
|
86
|
82
|
page_states_dirty = false;
|
|
@@ -181,15 +177,8 @@ namespace DirectStepping {
|
181
|
177
|
return;
|
182
|
178
|
}
|
183
|
179
|
|
184
|
|
- // Runs on a set interval also, as responses may get lost.
|
185
|
|
- if (next_response && next_response < millis()) {
|
186
|
|
- page_states_dirty = true;
|
187
|
|
- }
|
188
|
|
-
|
189
|
180
|
if (!page_states_dirty) return;
|
190
|
|
-
|
191
|
181
|
page_states_dirty = false;
|
192
|
|
- next_response = millis() + Cfg::RESPONSE_INTERVAL_MS;
|
193
|
182
|
|
194
|
183
|
SERIAL_ECHO(Cfg::CONTROL_CHAR);
|
195
|
184
|
constexpr int state_bits = 2;
|
|
@@ -238,29 +227,29 @@ const uint8_t segment_table[DirectStepping::Config::NUM_SEGMENTS][DirectStepping
|
238
|
227
|
|
239
|
228
|
#if STEPPER_PAGE_FORMAT == SP_4x4D_128
|
240
|
229
|
|
241
|
|
- { 1, 1, 1, 1, 1, 1, 1, 0 }, // 0 = -7
|
242
|
|
- { 1, 1, 1, 0, 1, 1, 1, 0 }, // 1 = -6
|
243
|
|
- { 0, 1, 1, 0, 1, 0, 1, 1 }, // 2 = -5
|
244
|
|
- { 0, 1, 0, 1, 0, 1, 0, 1 }, // 3 = -4
|
245
|
|
- { 0, 1, 0, 0, 1, 0, 0, 1 }, // 4 = -3
|
246
|
|
- { 0, 0, 1, 0, 0, 0, 1, 0 }, // 5 = -2
|
247
|
|
- { 0, 0, 0, 0, 1, 0, 0, 0 }, // 6 = -1
|
248
|
|
- { 0, 0, 0, 0, 0, 0, 0, 0 }, // 7 = 0
|
249
|
|
- { 0, 0, 0, 0, 1, 0, 0, 0 }, // 8 = 1
|
250
|
|
- { 0, 0, 1, 0, 0, 0, 1, 0 }, // 9 = 2
|
251
|
|
- { 0, 1, 0, 0, 1, 0, 0, 1 }, // 10 = 3
|
252
|
|
- { 0, 1, 0, 1, 0, 1, 0, 1 }, // 11 = 4
|
253
|
|
- { 0, 1, 1, 0, 1, 0, 1, 1 }, // 12 = 5
|
254
|
|
- { 1, 1, 1, 0, 1, 1, 1, 0 }, // 13 = 6
|
255
|
|
- { 1, 1, 1, 1, 1, 1, 1, 0 }, // 14 = 7
|
|
230
|
+ { 1, 1, 1, 1, 1, 1, 1 }, // 0 = -7
|
|
231
|
+ { 1, 1, 1, 0, 1, 1, 1 }, // 1 = -6
|
|
232
|
+ { 1, 1, 1, 0, 1, 0, 1 }, // 2 = -5
|
|
233
|
+ { 1, 1, 0, 1, 0, 1, 0 }, // 3 = -4
|
|
234
|
+ { 1, 1, 0, 0, 1, 0, 0 }, // 4 = -3
|
|
235
|
+ { 0, 0, 1, 0, 0, 0, 1 }, // 5 = -2
|
|
236
|
+ { 0, 0, 0, 1, 0, 0, 0 }, // 6 = -1
|
|
237
|
+ { 0, 0, 0, 0, 0, 0, 0 }, // 7 = 0
|
|
238
|
+ { 0, 0, 0, 1, 0, 0, 0 }, // 8 = 1
|
|
239
|
+ { 0, 0, 1, 0, 0, 0, 1 }, // 9 = 2
|
|
240
|
+ { 1, 1, 0, 0, 1, 0, 0 }, // 10 = 3
|
|
241
|
+ { 1, 1, 0, 1, 0, 1, 0 }, // 11 = 4
|
|
242
|
+ { 1, 1, 1, 0, 1, 0, 1 }, // 12 = 5
|
|
243
|
+ { 1, 1, 1, 0, 1, 1, 1 }, // 13 = 6
|
|
244
|
+ { 1, 1, 1, 1, 1, 1, 1 }, // 14 = 7
|
256
|
245
|
{ 0 }
|
257
|
246
|
|
258
|
247
|
#elif STEPPER_PAGE_FORMAT == SP_4x2_256
|
259
|
248
|
|
260
|
|
- { 0, 0, 0, 0 }, // 0
|
261
|
|
- { 0, 1, 0, 0 }, // 1
|
262
|
|
- { 1, 0, 1, 0 }, // 2
|
263
|
|
- { 1, 1, 1, 0 }, // 3
|
|
249
|
+ { 0, 0, 0 }, // 0
|
|
250
|
+ { 0, 1, 0 }, // 1
|
|
251
|
+ { 1, 0, 1 }, // 2
|
|
252
|
+ { 1, 1, 1 }, // 3
|
264
|
253
|
|
265
|
254
|
#elif STEPPER_PAGE_FORMAT == SP_4x1_512
|
266
|
255
|
|