Standardize some hexadecimals
This commit is contained in:
@ -322,19 +322,19 @@ void Planner::init() {
|
||||
// // Get most significant bit set on divider
|
||||
// uint8_t idx = 0;
|
||||
// uint32_t nr = d;
|
||||
// if (!(nr & 0xff0000)) {
|
||||
// if (!(nr & 0xFF0000)) {
|
||||
// nr <<= 8;
|
||||
// idx += 8;
|
||||
// if (!(nr & 0xff0000)) {
|
||||
// if (!(nr & 0xFF0000)) {
|
||||
// nr <<= 8;
|
||||
// idx += 8;
|
||||
// }
|
||||
// }
|
||||
// if (!(nr & 0xf00000)) {
|
||||
// if (!(nr & 0xF00000)) {
|
||||
// nr <<= 4;
|
||||
// idx += 4;
|
||||
// }
|
||||
// if (!(nr & 0xc00000)) {
|
||||
// if (!(nr & 0xC00000)) {
|
||||
// nr <<= 2;
|
||||
// idx += 2;
|
||||
// }
|
||||
|
@ -365,14 +365,14 @@ class Stepper {
|
||||
step_rate -= F_CPU / 500000; // Correct for minimal speed
|
||||
if (step_rate >= (8 * 256)) { // higher step rate
|
||||
unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate >> 8)][0];
|
||||
unsigned char tmp_step_rate = (step_rate & 0x00ff);
|
||||
unsigned char tmp_step_rate = (step_rate & 0x00FF);
|
||||
unsigned short gain = (unsigned short)pgm_read_word_near(table_address + 2);
|
||||
MultiU16X8toH16(timer, tmp_step_rate, gain);
|
||||
timer = (unsigned short)pgm_read_word_near(table_address) - timer;
|
||||
}
|
||||
else { // lower step rates
|
||||
unsigned short table_address = (unsigned short)&speed_lookuptable_slow[0][0];
|
||||
table_address += ((step_rate) >> 1) & 0xfffc;
|
||||
table_address += ((step_rate) >> 1) & 0xFFFC;
|
||||
timer = (unsigned short)pgm_read_word_near(table_address);
|
||||
timer -= (((unsigned short)pgm_read_word_near(table_address + 2) * (unsigned char)(step_rate & 0x0007)) >> 3);
|
||||
}
|
||||
|
Reference in New Issue
Block a user