Browse Source

Trailing whitespace cleanup

Scott Lahteine 7 years ago
parent
commit
57c2f8d2f6
1 changed files with 94 additions and 94 deletions
  1. 94
    94
      Marlin/src/module/planner.cpp

+ 94
- 94
Marlin/src/module/planner.cpp View File

422
         // for the same result - Using C division, it takes 500cycles to complete .
422
         // for the same result - Using C division, it takes 500cycles to complete .
423
 
423
 
424
         A("clr %3")                        // idx = 0
424
         A("clr %3")                        // idx = 0
425
-        A("mov %14,%6")      
426
-        A("mov %15,%7")      
425
+        A("mov %14,%6")
426
+        A("mov %15,%7")
427
         A("mov %16,%8")                    // nr = interval
427
         A("mov %16,%8")                    // nr = interval
428
         A("tst %16")                       // nr & 0xFF0000 == 0 ?
428
         A("tst %16")                       // nr & 0xFF0000 == 0 ?
429
         A("brne 2f")                       // No, skip this
429
         A("brne 2f")                       // No, skip this
430
-        A("mov %16,%15")      
430
+        A("mov %16,%15")
431
         A("mov %15,%14")                   // nr <<= 8, %14 not needed
431
         A("mov %15,%14")                   // nr <<= 8, %14 not needed
432
         A("subi %3,-8")                    // idx += 8
432
         A("subi %3,-8")                    // idx += 8
433
         A("tst %16")                       // nr & 0xFF0000 == 0 ?
433
         A("tst %16")                       // nr & 0xFF0000 == 0 ?
442
         A("brcc 3f")                       // No, skip this
442
         A("brcc 3f")                       // No, skip this
443
         A("swap %15")                      // Swap nibbles
443
         A("swap %15")                      // Swap nibbles
444
         A("swap %16")                      // Swap nibbles. Low nibble is 0
444
         A("swap %16")                      // Swap nibbles. Low nibble is 0
445
-        A("mov %14, %15")      
445
+        A("mov %14, %15")
446
         A("andi %14,0x0F")                 // Isolate low nibble
446
         A("andi %14,0x0F")                 // Isolate low nibble
447
         A("andi %15,0xF0")                 // Keep proper nibble in %15
447
         A("andi %15,0xF0")                 // Keep proper nibble in %15
448
         A("or %16, %14")                   // %16:%15 <<= 4
448
         A("or %16, %14")                   // %16:%15 <<= 4
451
         L("3")
451
         L("3")
452
         A("cpi %16,0x40")                  // (nr & 0xC00000) == 0 ?
452
         A("cpi %16,0x40")                  // (nr & 0xC00000) == 0 ?
453
         A("brcc 4f")                       // No, skip this
453
         A("brcc 4f")                       // No, skip this
454
-        A("add %15,%15")      
455
-        A("adc %16,%16")      
456
-        A("add %15,%15")      
454
+        A("add %15,%15")
455
+        A("adc %16,%16")
456
+        A("add %15,%15")
457
         A("adc %16,%16")                   // %16:%15 <<= 2
457
         A("adc %16,%16")                   // %16:%15 <<= 2
458
         A("subi %3,-2")                    // idx += 2
458
         A("subi %3,-2")                    // idx += 2
459
 
459
 
460
         L("4")
460
         L("4")
461
         A("cpi %16,0x80")                  // (nr & 0x800000) == 0 ?
461
         A("cpi %16,0x80")                  // (nr & 0x800000) == 0 ?
462
         A("brcc 5f")                       // No, skip this
462
         A("brcc 5f")                       // No, skip this
463
-        A("add %15,%15")      
463
+        A("add %15,%15")
464
         A("adc %16,%16")                   // %16:%15 <<= 1
464
         A("adc %16,%16")                   // %16:%15 <<= 1
465
         A("inc %3")                        // idx += 1
465
         A("inc %3")                        // idx += 1
466
 
466
 
467
         // Now %16:%15 contains its MSBit set to 1, or %16:%15 is == 0. We are now absolutely sure
467
         // Now %16:%15 contains its MSBit set to 1, or %16:%15 is == 0. We are now absolutely sure
468
         // we have at least 9 MSBits available to enter the initial estimation table
468
         // we have at least 9 MSBits available to enter the initial estimation table
469
         L("5")
469
         L("5")
470
-        A("add %15,%15")      
470
+        A("add %15,%15")
471
         A("adc %16,%16")                   // %16:%15 = tidx = (nr <<= 1), we lose the top MSBit (always set to 1, %16 is the index into the inverse table)
471
         A("adc %16,%16")                   // %16:%15 = tidx = (nr <<= 1), we lose the top MSBit (always set to 1, %16 is the index into the inverse table)
472
         A("add r30,%16")                   // Only use top 8 bits
472
         A("add r30,%16")                   // Only use top 8 bits
473
         A("adc r31,%13")                   // r31:r30 = inv_tab + (tidx)
473
         A("adc r31,%13")                   // r31:r30 = inv_tab + (tidx)
483
         // idx > 8, now %3 = idx - 8. We must perform a left shift. idx range:[1-8]
483
         // idx > 8, now %3 = idx - 8. We must perform a left shift. idx range:[1-8]
484
         A("sbrs %3,0")                     // shift by 1bit position?
484
         A("sbrs %3,0")                     // shift by 1bit position?
485
         A("rjmp 8f")                       // No
485
         A("rjmp 8f")                       // No
486
-        A("add %14,%14")      
486
+        A("add %14,%14")
487
         A("adc %15,%15")                   // %15:16 <<= 1
487
         A("adc %15,%15")                   // %15:16 <<= 1
488
         L("8")
488
         L("8")
489
         A("sbrs %3,1")                     // shift by 2bit position?
489
         A("sbrs %3,1")                     // shift by 2bit position?
490
         A("rjmp 9f")                       // No
490
         A("rjmp 9f")                       // No
491
-        A("add %14,%14")      
492
-        A("adc %15,%15")      
493
-        A("add %14,%14")      
491
+        A("add %14,%14")
492
+        A("adc %15,%15")
493
+        A("add %14,%14")
494
         A("adc %15,%15")                   // %15:16 <<= 1
494
         A("adc %15,%15")                   // %15:16 <<= 1
495
         L("9")
495
         L("9")
496
         A("sbrs %3,2")                     // shift by 4bits position?
496
         A("sbrs %3,2")                     // shift by 4bits position?
497
         A("rjmp 16f")                      // No
497
         A("rjmp 16f")                      // No
498
         A("swap %15")                      // Swap nibbles. lo nibble of %15 will always be 0
498
         A("swap %15")                      // Swap nibbles. lo nibble of %15 will always be 0
499
         A("swap %14")                      // Swap nibbles
499
         A("swap %14")                      // Swap nibbles
500
-        A("mov %12,%14")      
500
+        A("mov %12,%14")
501
         A("andi %12,0x0F")                 // isolate low nibble
501
         A("andi %12,0x0F")                 // isolate low nibble
502
         A("andi %14,0xF0")                 // and clear it
502
         A("andi %14,0xF0")                 // and clear it
503
         A("or %15,%12")                    // %15:%16 <<= 4
503
         A("or %15,%12")                    // %15:%16 <<= 4
504
         L("16")
504
         L("16")
505
         A("sbrs %3,3")                     // shift by 8bits position?
505
         A("sbrs %3,3")                     // shift by 8bits position?
506
         A("rjmp 6f")                       // No, we are done
506
         A("rjmp 6f")                       // No, we are done
507
-        A("mov %16,%15")      
508
-        A("mov %15,%14")      
509
-        A("clr %14")      
510
-        A("jmp 6f")      
507
+        A("mov %16,%15")
508
+        A("mov %15,%14")
509
+        A("clr %14")
510
+        A("jmp 6f")
511
 
511
 
512
         // idx < 8, now %3 = idx - 8. Get the count of bits
512
         // idx < 8, now %3 = idx - 8. Get the count of bits
513
         L("7")
513
         L("7")
515
         A("sbrs %3,0")                     // shift by 1 bit position ?
515
         A("sbrs %3,0")                     // shift by 1 bit position ?
516
         A("rjmp 10f")                      // No, skip it
516
         A("rjmp 10f")                      // No, skip it
517
         A("asr %15")                       // (bit7 is always 0 here)
517
         A("asr %15")                       // (bit7 is always 0 here)
518
-        A("ror %14")      
518
+        A("ror %14")
519
         L("10")
519
         L("10")
520
         A("sbrs %3,1")                     // shift by 2 bit position ?
520
         A("sbrs %3,1")                     // shift by 2 bit position ?
521
         A("rjmp 11f")                      // No, skip it
521
         A("rjmp 11f")                      // No, skip it
522
         A("asr %15")                       // (bit7 is always 0 here)
522
         A("asr %15")                       // (bit7 is always 0 here)
523
-        A("ror %14")      
523
+        A("ror %14")
524
         A("asr %15")                       // (bit7 is always 0 here)
524
         A("asr %15")                       // (bit7 is always 0 here)
525
-        A("ror %14")      
525
+        A("ror %14")
526
         L("11")
526
         L("11")
527
         A("sbrs %3,2")                     // shift by 4 bit position ?
527
         A("sbrs %3,2")                     // shift by 4 bit position ?
528
         A("rjmp 12f")                      // No, skip it
528
         A("rjmp 12f")                      // No, skip it
534
         L("12")
534
         L("12")
535
         A("sbrs %3,3")                     // shift by 8 bit position ?
535
         A("sbrs %3,3")                     // shift by 8 bit position ?
536
         A("rjmp 6f")                       // No, skip it
536
         A("rjmp 6f")                       // No, skip it
537
-        A("mov %14,%15")      
538
-        A("clr %15")      
537
+        A("mov %14,%15")
538
+        A("clr %15")
539
         L("6")                       // %16:%15:%14 = initial estimation of 0x1000000 / d
539
         L("6")                       // %16:%15:%14 = initial estimation of 0x1000000 / d
540
 
540
 
541
         // Now, we must refine the estimation present on %16:%15:%14 using 1 iteration
541
         // Now, we must refine the estimation present on %16:%15:%14 using 1 iteration
549
         // %3:%2:%1:%0 = working accumulator
549
         // %3:%2:%1:%0 = working accumulator
550
 
550
 
551
         // Compute 1<<25 - x*d. Result should never exceed 25 bits and should always be positive
551
         // Compute 1<<25 - x*d. Result should never exceed 25 bits and should always be positive
552
-        A("clr %0")      
553
-        A("clr %1")      
554
-        A("clr %2")      
552
+        A("clr %0")
553
+        A("clr %1")
554
+        A("clr %2")
555
         A("ldi %3,2")                      // %3:%2:%1:%0 = 0x2000000
555
         A("ldi %3,2")                      // %3:%2:%1:%0 = 0x2000000
556
         A("mul %6,%14")                    // r1:r0 = LO(d) * LO(x)
556
         A("mul %6,%14")                    // r1:r0 = LO(d) * LO(x)
557
-        A("sub %0,r0")      
558
-        A("sbc %1,r1")      
559
-        A("sbc %2,%13")      
557
+        A("sub %0,r0")
558
+        A("sbc %1,r1")
559
+        A("sbc %2,%13")
560
         A("sbc %3,%13")                    // %3:%2:%1:%0 -= LO(d) * LO(x)
560
         A("sbc %3,%13")                    // %3:%2:%1:%0 -= LO(d) * LO(x)
561
         A("mul %7,%14")                    // r1:r0 = MI(d) * LO(x)
561
         A("mul %7,%14")                    // r1:r0 = MI(d) * LO(x)
562
-        A("sub %1,r0")      
563
-        A("sbc %2,r1" )      
562
+        A("sub %1,r0")
563
+        A("sbc %2,r1" )
564
         A("sbc %3,%13")                    // %3:%2:%1:%0 -= MI(d) * LO(x) << 8
564
         A("sbc %3,%13")                    // %3:%2:%1:%0 -= MI(d) * LO(x) << 8
565
         A("mul %8,%14")                    // r1:r0 = HI(d) * LO(x)
565
         A("mul %8,%14")                    // r1:r0 = HI(d) * LO(x)
566
-        A("sub %2,r0")      
566
+        A("sub %2,r0")
567
         A("sbc %3,r1")                     // %3:%2:%1:%0 -= MIL(d) * LO(x) << 16
567
         A("sbc %3,r1")                     // %3:%2:%1:%0 -= MIL(d) * LO(x) << 16
568
         A("mul %6,%15")                    // r1:r0 = LO(d) * MI(x)
568
         A("mul %6,%15")                    // r1:r0 = LO(d) * MI(x)
569
-        A("sub %1,r0")      
570
-        A("sbc %2,r1")      
569
+        A("sub %1,r0")
570
+        A("sbc %2,r1")
571
         A("sbc %3,%13")                    // %3:%2:%1:%0 -= LO(d) * MI(x) << 8
571
         A("sbc %3,%13")                    // %3:%2:%1:%0 -= LO(d) * MI(x) << 8
572
         A("mul %7,%15")                    // r1:r0 = MI(d) * MI(x)
572
         A("mul %7,%15")                    // r1:r0 = MI(d) * MI(x)
573
-        A("sub %2,r0")      
573
+        A("sub %2,r0")
574
         A("sbc %3,r1")                     // %3:%2:%1:%0 -= MI(d) * MI(x) << 16
574
         A("sbc %3,r1")                     // %3:%2:%1:%0 -= MI(d) * MI(x) << 16
575
         A("mul %8,%15")                    // r1:r0 = HI(d) * MI(x)
575
         A("mul %8,%15")                    // r1:r0 = HI(d) * MI(x)
576
         A("sub %3,r0")                     // %3:%2:%1:%0 -= MIL(d) * MI(x) << 24
576
         A("sub %3,r0")                     // %3:%2:%1:%0 -= MIL(d) * MI(x) << 24
577
         A("mul %6,%16")                    // r1:r0 = LO(d) * HI(x)
577
         A("mul %6,%16")                    // r1:r0 = LO(d) * HI(x)
578
-        A("sub %2,r0")      
578
+        A("sub %2,r0")
579
         A("sbc %3,r1")                     // %3:%2:%1:%0 -= LO(d) * HI(x) << 16
579
         A("sbc %3,r1")                     // %3:%2:%1:%0 -= LO(d) * HI(x) << 16
580
         A("mul %7,%16")                    // r1:r0 = MI(d) * HI(x)
580
         A("mul %7,%16")                    // r1:r0 = MI(d) * HI(x)
581
         A("sub %3,r0")                     // %3:%2:%1:%0 -= MI(d) * HI(x) << 24
581
         A("sub %3,r0")                     // %3:%2:%1:%0 -= MI(d) * HI(x) << 24
589
 
589
 
590
         // result = %11:%10:%9:%5:%4
590
         // result = %11:%10:%9:%5:%4
591
         A("mul %14,%0")                    // r1:r0 = LO(x) * LO(acc)
591
         A("mul %14,%0")                    // r1:r0 = LO(x) * LO(acc)
592
-        A("mov %4,r1")      
593
-        A("clr %5")      
594
-        A("clr %9")      
595
-        A("clr %10")      
592
+        A("mov %4,r1")
593
+        A("clr %5")
594
+        A("clr %9")
595
+        A("clr %10")
596
         A("clr %11")                       // %11:%10:%9:%5:%4 = LO(x) * LO(acc) >> 8
596
         A("clr %11")                       // %11:%10:%9:%5:%4 = LO(x) * LO(acc) >> 8
597
         A("mul %15,%0")                    // r1:r0 = MI(x) * LO(acc)
597
         A("mul %15,%0")                    // r1:r0 = MI(x) * LO(acc)
598
-        A("add %4,r0")      
599
-        A("adc %5,r1")      
600
-        A("adc %9,%13")      
601
-        A("adc %10,%13")      
598
+        A("add %4,r0")
599
+        A("adc %5,r1")
600
+        A("adc %9,%13")
601
+        A("adc %10,%13")
602
         A("adc %11,%13")                   // %11:%10:%9:%5:%4 += MI(x) * LO(acc)
602
         A("adc %11,%13")                   // %11:%10:%9:%5:%4 += MI(x) * LO(acc)
603
         A("mul %16,%0")                    // r1:r0 = HI(x) * LO(acc)
603
         A("mul %16,%0")                    // r1:r0 = HI(x) * LO(acc)
604
-        A("add %5,r0")      
605
-        A("adc %9,r1")      
606
-        A("adc %10,%13")      
604
+        A("add %5,r0")
605
+        A("adc %9,r1")
606
+        A("adc %10,%13")
607
         A("adc %11,%13")                   // %11:%10:%9:%5:%4 += MI(x) * LO(acc) << 8
607
         A("adc %11,%13")                   // %11:%10:%9:%5:%4 += MI(x) * LO(acc) << 8
608
 
608
 
609
         A("mul %14,%1")                    // r1:r0 = LO(x) * MIL(acc)
609
         A("mul %14,%1")                    // r1:r0 = LO(x) * MIL(acc)
610
-        A("add %4,r0")      
611
-        A("adc %5,r1")      
612
-        A("adc %9,%13")      
613
-        A("adc %10,%13")      
610
+        A("add %4,r0")
611
+        A("adc %5,r1")
612
+        A("adc %9,%13")
613
+        A("adc %10,%13")
614
         A("adc %11,%13")                   // %11:%10:%9:%5:%4 = LO(x) * MIL(acc)
614
         A("adc %11,%13")                   // %11:%10:%9:%5:%4 = LO(x) * MIL(acc)
615
         A("mul %15,%1")                    // r1:r0 = MI(x) * MIL(acc)
615
         A("mul %15,%1")                    // r1:r0 = MI(x) * MIL(acc)
616
-        A("add %5,r0")      
617
-        A("adc %9,r1")      
618
-        A("adc %10,%13")      
616
+        A("add %5,r0")
617
+        A("adc %9,r1")
618
+        A("adc %10,%13")
619
         A("adc %11,%13")                   // %11:%10:%9:%5:%4 += MI(x) * MIL(acc) << 8
619
         A("adc %11,%13")                   // %11:%10:%9:%5:%4 += MI(x) * MIL(acc) << 8
620
         A("mul %16,%1")                    // r1:r0 = HI(x) * MIL(acc)
620
         A("mul %16,%1")                    // r1:r0 = HI(x) * MIL(acc)
621
-        A("add %9,r0")      
622
-        A("adc %10,r1")      
621
+        A("add %9,r0")
622
+        A("adc %10,r1")
623
         A("adc %11,%13")                   // %11:%10:%9:%5:%4 += MI(x) * MIL(acc) << 16
623
         A("adc %11,%13")                   // %11:%10:%9:%5:%4 += MI(x) * MIL(acc) << 16
624
 
624
 
625
         A("mul %14,%2")                    // r1:r0 = LO(x) * MIH(acc)
625
         A("mul %14,%2")                    // r1:r0 = LO(x) * MIH(acc)
626
-        A("add %5,r0")      
627
-        A("adc %9,r1")      
628
-        A("adc %10,%13")      
626
+        A("add %5,r0")
627
+        A("adc %9,r1")
628
+        A("adc %10,%13")
629
         A("adc %11,%13")                   // %11:%10:%9:%5:%4 = LO(x) * MIH(acc) << 8
629
         A("adc %11,%13")                   // %11:%10:%9:%5:%4 = LO(x) * MIH(acc) << 8
630
         A("mul %15,%2")                    // r1:r0 = MI(x) * MIH(acc)
630
         A("mul %15,%2")                    // r1:r0 = MI(x) * MIH(acc)
631
-        A("add %9,r0")      
632
-        A("adc %10,r1")      
631
+        A("add %9,r0")
632
+        A("adc %10,r1")
633
         A("adc %11,%13")                   // %11:%10:%9:%5:%4 += MI(x) * MIH(acc) << 16
633
         A("adc %11,%13")                   // %11:%10:%9:%5:%4 += MI(x) * MIH(acc) << 16
634
         A("mul %16,%2")                    // r1:r0 = HI(x) * MIH(acc)
634
         A("mul %16,%2")                    // r1:r0 = HI(x) * MIH(acc)
635
-        A("add %10,r0")      
635
+        A("add %10,r0")
636
         A("adc %11,r1")                    // %11:%10:%9:%5:%4 += MI(x) * MIH(acc) << 24
636
         A("adc %11,r1")                    // %11:%10:%9:%5:%4 += MI(x) * MIH(acc) << 24
637
 
637
 
638
         A("mul %14,%3")                    // r1:r0 = LO(x) * HI(acc)
638
         A("mul %14,%3")                    // r1:r0 = LO(x) * HI(acc)
639
-        A("add %9,r0")      
640
-        A("adc %10,r1")      
639
+        A("add %9,r0")
640
+        A("adc %10,r1")
641
         A("adc %11,%13")                   // %11:%10:%9:%5:%4 = LO(x) * HI(acc) << 16
641
         A("adc %11,%13")                   // %11:%10:%9:%5:%4 = LO(x) * HI(acc) << 16
642
         A("mul %15,%3")                    // r1:r0 = MI(x) * HI(acc)
642
         A("mul %15,%3")                    // r1:r0 = MI(x) * HI(acc)
643
-        A("add %10,r0")      
643
+        A("add %10,r0")
644
         A("adc %11,r1")                    // %11:%10:%9:%5:%4 += MI(x) * HI(acc) << 24
644
         A("adc %11,r1")                    // %11:%10:%9:%5:%4 += MI(x) * HI(acc) << 24
645
         A("mul %16,%3")                    // r1:r0 = HI(x) * HI(acc)
645
         A("mul %16,%3")                    // r1:r0 = HI(x) * HI(acc)
646
         A("add %11,r0")                    // %11:%10:%9:%5:%4 += MI(x) * HI(acc) << 32
646
         A("add %11,r0")                    // %11:%10:%9:%5:%4 += MI(x) * HI(acc) << 32
651
         // (1<<24) - x*d
651
         // (1<<24) - x*d
652
         // %11:%10:%9 = x
652
         // %11:%10:%9 = x
653
         // %8:%7:%6 = d = interval" "\n\t"
653
         // %8:%7:%6 = d = interval" "\n\t"
654
-        A("ldi %3,1")      
655
-        A("clr %2")      
656
-        A("clr %1")      
654
+        A("ldi %3,1")
655
+        A("clr %2")
656
+        A("clr %1")
657
         A("clr %0")                        // %3:%2:%1:%0 = 0x1000000
657
         A("clr %0")                        // %3:%2:%1:%0 = 0x1000000
658
         A("mul %6,%9")                     // r1:r0 = LO(d) * LO(x)
658
         A("mul %6,%9")                     // r1:r0 = LO(d) * LO(x)
659
-        A("sub %0,r0")      
660
-        A("sbc %1,r1")      
661
-        A("sbc %2,%13")      
659
+        A("sub %0,r0")
660
+        A("sbc %1,r1")
661
+        A("sbc %2,%13")
662
         A("sbc %3,%13")                    // %3:%2:%1:%0 -= LO(d) * LO(x)
662
         A("sbc %3,%13")                    // %3:%2:%1:%0 -= LO(d) * LO(x)
663
         A("mul %7,%9")                     // r1:r0 = MI(d) * LO(x)
663
         A("mul %7,%9")                     // r1:r0 = MI(d) * LO(x)
664
-        A("sub %1,r0")      
665
-        A("sbc %2,r1")      
664
+        A("sub %1,r0")
665
+        A("sbc %2,r1")
666
         A("sbc %3,%13")                    // %3:%2:%1:%0 -= MI(d) * LO(x) << 8
666
         A("sbc %3,%13")                    // %3:%2:%1:%0 -= MI(d) * LO(x) << 8
667
         A("mul %8,%9")                     // r1:r0 = HI(d) * LO(x)
667
         A("mul %8,%9")                     // r1:r0 = HI(d) * LO(x)
668
-        A("sub %2,r0")      
668
+        A("sub %2,r0")
669
         A("sbc %3,r1")                     // %3:%2:%1:%0 -= MIL(d) * LO(x) << 16
669
         A("sbc %3,r1")                     // %3:%2:%1:%0 -= MIL(d) * LO(x) << 16
670
         A("mul %6,%10")                    // r1:r0 = LO(d) * MI(x)
670
         A("mul %6,%10")                    // r1:r0 = LO(d) * MI(x)
671
-        A("sub %1,r0")      
672
-        A("sbc %2,r1")      
671
+        A("sub %1,r0")
672
+        A("sbc %2,r1")
673
         A("sbc %3,%13")                    // %3:%2:%1:%0 -= LO(d) * MI(x) << 8
673
         A("sbc %3,%13")                    // %3:%2:%1:%0 -= LO(d) * MI(x) << 8
674
         A("mul %7,%10")                    // r1:r0 = MI(d) * MI(x)
674
         A("mul %7,%10")                    // r1:r0 = MI(d) * MI(x)
675
-        A("sub %2,r0")      
675
+        A("sub %2,r0")
676
         A("sbc %3,r1")                     // %3:%2:%1:%0 -= MI(d) * MI(x) << 16
676
         A("sbc %3,r1")                     // %3:%2:%1:%0 -= MI(d) * MI(x) << 16
677
         A("mul %8,%10")                    // r1:r0 = HI(d) * MI(x)
677
         A("mul %8,%10")                    // r1:r0 = HI(d) * MI(x)
678
         A("sub %3,r0")                     // %3:%2:%1:%0 -= MIL(d) * MI(x) << 24
678
         A("sub %3,r0")                     // %3:%2:%1:%0 -= MIL(d) * MI(x) << 24
679
         A("mul %6,%11")                    // r1:r0 = LO(d) * HI(x)
679
         A("mul %6,%11")                    // r1:r0 = LO(d) * HI(x)
680
-        A("sub %2,r0")      
680
+        A("sub %2,r0")
681
         A("sbc %3,r1")                     // %3:%2:%1:%0 -= LO(d) * HI(x) << 16
681
         A("sbc %3,r1")                     // %3:%2:%1:%0 -= LO(d) * HI(x) << 16
682
         A("mul %7,%11")                    // r1:r0 = MI(d) * HI(x)
682
         A("mul %7,%11")                    // r1:r0 = MI(d) * HI(x)
683
         A("sub %3,r0")                     // %3:%2:%1:%0 -= MI(d) * HI(x) << 24
683
         A("sub %3,r0")                     // %3:%2:%1:%0 -= MI(d) * HI(x) << 24
685
         // %8:%7:%6 = d = interval
685
         // %8:%7:%6 = d = interval
686
 
686
 
687
         // Perform the final correction
687
         // Perform the final correction
688
-        A("sub %0,%6")      
689
-        A("sbc %1,%7")      
688
+        A("sub %0,%6")
689
+        A("sbc %1,%7")
690
         A("sbc %2,%8")                     // r -= d
690
         A("sbc %2,%8")                     // r -= d
691
         A("brcs 14f")                      // if ( r >= d)
691
         A("brcs 14f")                      // if ( r >= d)
692
 
692
 
693
         // %11:%10:%9 = x
693
         // %11:%10:%9 = x
694
-        A("ldi %3,1")      
695
-        A("add %9,%3")      
696
-        A("adc %10,%13")      
694
+        A("ldi %3,1")
695
+        A("add %9,%3")
696
+        A("adc %10,%13")
697
         A("adc %11,%13")                   // x++
697
         A("adc %11,%13")                   // x++
698
         L("14")
698
         L("14")
699
 
699
 
1874
 
1874
 
1875
     /**
1875
     /**
1876
      * Compute maximum allowable entry speed at junction by centripetal acceleration approximation.
1876
      * Compute maximum allowable entry speed at junction by centripetal acceleration approximation.
1877
-     * Let a circle be tangent to both previous and current path line segments, where the junction 
1878
-     * deviation is defined as the distance from the junction to the closest edge of the circle, 
1879
-     * colinear with the circle center. The circular segment joining the two paths represents the 
1877
+     * Let a circle be tangent to both previous and current path line segments, where the junction
1878
+     * deviation is defined as the distance from the junction to the closest edge of the circle,
1879
+     * colinear with the circle center. The circular segment joining the two paths represents the
1880
      * path of centripetal acceleration. Solve for max velocity based on max acceleration about the
1880
      * path of centripetal acceleration. Solve for max velocity based on max acceleration about the
1881
-     * radius of the circle, defined indirectly by junction deviation. This may be also viewed as 
1882
-     * path width or max_jerk in the previous Grbl version. This approach does not actually deviate 
1881
+     * radius of the circle, defined indirectly by junction deviation. This may be also viewed as
1882
+     * path width or max_jerk in the previous Grbl version. This approach does not actually deviate
1883
      * from path, but used as a robust way to compute cornering speeds, as it takes into account the
1883
      * from path, but used as a robust way to compute cornering speeds, as it takes into account the
1884
      * nonlinearities of both the junction angle and junction velocity.
1884
      * nonlinearities of both the junction angle and junction velocity.
1885
      *
1885
      *
1886
-     * NOTE: If the junction deviation value is finite, Grbl executes the motions in an exact path 
1886
+     * NOTE: If the junction deviation value is finite, Grbl executes the motions in an exact path
1887
      * mode (G61). If the junction deviation value is zero, Grbl will execute the motion in an exact
1887
      * mode (G61). If the junction deviation value is zero, Grbl will execute the motion in an exact
1888
      * stop mode (G61.1) manner. In the future, if continuous mode (G64) is desired, the math here
1888
      * stop mode (G61.1) manner. In the future, if continuous mode (G64) is desired, the math here
1889
      * is exactly the same. Instead of motioning all the way to junction point, the machine will
1889
      * is exactly the same. Instead of motioning all the way to junction point, the machine will
1890
      * just follow the arc circle defined here. The Arduino doesn't have the CPU cycles to perform
1890
      * just follow the arc circle defined here. The Arduino doesn't have the CPU cycles to perform
1891
-     * a continuous mode path, but ARM-based microcontrollers most certainly do. 
1892
-     * 
1891
+     * a continuous mode path, but ARM-based microcontrollers most certainly do.
1892
+     *
1893
      * NOTE: The max junction speed is a fixed value, since machine acceleration limits cannot be
1893
      * NOTE: The max junction speed is a fixed value, since machine acceleration limits cannot be
1894
      * changed dynamically during operation nor can the line move geometry. This must be kept in
1894
      * changed dynamically during operation nor can the line move geometry. This must be kept in
1895
-     * memory in the event of a feedrate override changing the nominal speeds of blocks, which can 
1895
+     * memory in the event of a feedrate override changing the nominal speeds of blocks, which can
1896
      * change the overall maximum entry speed conditions of all blocks.
1896
      * change the overall maximum entry speed conditions of all blocks.
1897
      */
1897
      */
1898
 
1898
 
2020
     }
2020
     }
2021
     else
2021
     else
2022
       vmax_junction = safe_speed;
2022
       vmax_junction = safe_speed;
2023
-  
2023
+
2024
     previous_safe_speed = safe_speed;
2024
     previous_safe_speed = safe_speed;
2025
   #endif // Classic Jerk Limiting
2025
   #endif // Classic Jerk Limiting
2026
 
2026
 
2084
   block->nominal_speed   =
2084
   block->nominal_speed   =
2085
   block->entry_speed     =
2085
   block->entry_speed     =
2086
   block->max_entry_speed =
2086
   block->max_entry_speed =
2087
-  block->millimeters     =  
2087
+  block->millimeters     =
2088
   block->acceleration    = 0;
2088
   block->acceleration    = 0;
2089
 
2089
 
2090
   block->step_event_count          =
2090
   block->step_event_count          =

Loading…
Cancel
Save