Standardize some hexadecimals

This commit is contained in:
Scott Lahteine
2018-05-08 09:17:44 -05:00
parent ec05408453
commit d1b619be52
27 changed files with 204 additions and 204 deletions

View File

@ -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;
// }

View File

@ -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);
}