Browse Source

Trailing whitespace cleanup

Scott Lahteine 6 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,12 +422,12 @@ void Planner::init() {
422 422
         // for the same result - Using C division, it takes 500cycles to complete .
423 423
 
424 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 427
         A("mov %16,%8")                    // nr = interval
428 428
         A("tst %16")                       // nr & 0xFF0000 == 0 ?
429 429
         A("brne 2f")                       // No, skip this
430
-        A("mov %16,%15")      
430
+        A("mov %16,%15")
431 431
         A("mov %15,%14")                   // nr <<= 8, %14 not needed
432 432
         A("subi %3,-8")                    // idx += 8
433 433
         A("tst %16")                       // nr & 0xFF0000 == 0 ?
@@ -442,7 +442,7 @@ void Planner::init() {
442 442
         A("brcc 3f")                       // No, skip this
443 443
         A("swap %15")                      // Swap nibbles
444 444
         A("swap %16")                      // Swap nibbles. Low nibble is 0
445
-        A("mov %14, %15")      
445
+        A("mov %14, %15")
446 446
         A("andi %14,0x0F")                 // Isolate low nibble
447 447
         A("andi %15,0xF0")                 // Keep proper nibble in %15
448 448
         A("or %16, %14")                   // %16:%15 <<= 4
@@ -451,23 +451,23 @@ void Planner::init() {
451 451
         L("3")
452 452
         A("cpi %16,0x40")                  // (nr & 0xC00000) == 0 ?
453 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 457
         A("adc %16,%16")                   // %16:%15 <<= 2
458 458
         A("subi %3,-2")                    // idx += 2
459 459
 
460 460
         L("4")
461 461
         A("cpi %16,0x80")                  // (nr & 0x800000) == 0 ?
462 462
         A("brcc 5f")                       // No, skip this
463
-        A("add %15,%15")      
463
+        A("add %15,%15")
464 464
         A("adc %16,%16")                   // %16:%15 <<= 1
465 465
         A("inc %3")                        // idx += 1
466 466
 
467 467
         // Now %16:%15 contains its MSBit set to 1, or %16:%15 is == 0. We are now absolutely sure
468 468
         // we have at least 9 MSBits available to enter the initial estimation table
469 469
         L("5")
470
-        A("add %15,%15")      
470
+        A("add %15,%15")
471 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 472
         A("add r30,%16")                   // Only use top 8 bits
473 473
         A("adc r31,%13")                   // r31:r30 = inv_tab + (tidx)
@@ -483,31 +483,31 @@ void Planner::init() {
483 483
         // idx > 8, now %3 = idx - 8. We must perform a left shift. idx range:[1-8]
484 484
         A("sbrs %3,0")                     // shift by 1bit position?
485 485
         A("rjmp 8f")                       // No
486
-        A("add %14,%14")      
486
+        A("add %14,%14")
487 487
         A("adc %15,%15")                   // %15:16 <<= 1
488 488
         L("8")
489 489
         A("sbrs %3,1")                     // shift by 2bit position?
490 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 494
         A("adc %15,%15")                   // %15:16 <<= 1
495 495
         L("9")
496 496
         A("sbrs %3,2")                     // shift by 4bits position?
497 497
         A("rjmp 16f")                      // No
498 498
         A("swap %15")                      // Swap nibbles. lo nibble of %15 will always be 0
499 499
         A("swap %14")                      // Swap nibbles
500
-        A("mov %12,%14")      
500
+        A("mov %12,%14")
501 501
         A("andi %12,0x0F")                 // isolate low nibble
502 502
         A("andi %14,0xF0")                 // and clear it
503 503
         A("or %15,%12")                    // %15:%16 <<= 4
504 504
         L("16")
505 505
         A("sbrs %3,3")                     // shift by 8bits position?
506 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 512
         // idx < 8, now %3 = idx - 8. Get the count of bits
513 513
         L("7")
@@ -515,14 +515,14 @@ void Planner::init() {
515 515
         A("sbrs %3,0")                     // shift by 1 bit position ?
516 516
         A("rjmp 10f")                      // No, skip it
517 517
         A("asr %15")                       // (bit7 is always 0 here)
518
-        A("ror %14")      
518
+        A("ror %14")
519 519
         L("10")
520 520
         A("sbrs %3,1")                     // shift by 2 bit position ?
521 521
         A("rjmp 11f")                      // No, skip it
522 522
         A("asr %15")                       // (bit7 is always 0 here)
523
-        A("ror %14")      
523
+        A("ror %14")
524 524
         A("asr %15")                       // (bit7 is always 0 here)
525
-        A("ror %14")      
525
+        A("ror %14")
526 526
         L("11")
527 527
         A("sbrs %3,2")                     // shift by 4 bit position ?
528 528
         A("rjmp 12f")                      // No, skip it
@@ -534,8 +534,8 @@ void Planner::init() {
534 534
         L("12")
535 535
         A("sbrs %3,3")                     // shift by 8 bit position ?
536 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 539
         L("6")                       // %16:%15:%14 = initial estimation of 0x1000000 / d
540 540
 
541 541
         // Now, we must refine the estimation present on %16:%15:%14 using 1 iteration
@@ -549,33 +549,33 @@ void Planner::init() {
549 549
         // %3:%2:%1:%0 = working accumulator
550 550
 
551 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 555
         A("ldi %3,2")                      // %3:%2:%1:%0 = 0x2000000
556 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 560
         A("sbc %3,%13")                    // %3:%2:%1:%0 -= LO(d) * LO(x)
561 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 564
         A("sbc %3,%13")                    // %3:%2:%1:%0 -= MI(d) * LO(x) << 8
565 565
         A("mul %8,%14")                    // r1:r0 = HI(d) * LO(x)
566
-        A("sub %2,r0")      
566
+        A("sub %2,r0")
567 567
         A("sbc %3,r1")                     // %3:%2:%1:%0 -= MIL(d) * LO(x) << 16
568 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 571
         A("sbc %3,%13")                    // %3:%2:%1:%0 -= LO(d) * MI(x) << 8
572 572
         A("mul %7,%15")                    // r1:r0 = MI(d) * MI(x)
573
-        A("sub %2,r0")      
573
+        A("sub %2,r0")
574 574
         A("sbc %3,r1")                     // %3:%2:%1:%0 -= MI(d) * MI(x) << 16
575 575
         A("mul %8,%15")                    // r1:r0 = HI(d) * MI(x)
576 576
         A("sub %3,r0")                     // %3:%2:%1:%0 -= MIL(d) * MI(x) << 24
577 577
         A("mul %6,%16")                    // r1:r0 = LO(d) * HI(x)
578
-        A("sub %2,r0")      
578
+        A("sub %2,r0")
579 579
         A("sbc %3,r1")                     // %3:%2:%1:%0 -= LO(d) * HI(x) << 16
580 580
         A("mul %7,%16")                    // r1:r0 = MI(d) * HI(x)
581 581
         A("sub %3,r0")                     // %3:%2:%1:%0 -= MI(d) * HI(x) << 24
@@ -589,58 +589,58 @@ void Planner::init() {
589 589
 
590 590
         // result = %11:%10:%9:%5:%4
591 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 596
         A("clr %11")                       // %11:%10:%9:%5:%4 = LO(x) * LO(acc) >> 8
597 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 602
         A("adc %11,%13")                   // %11:%10:%9:%5:%4 += MI(x) * LO(acc)
603 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 607
         A("adc %11,%13")                   // %11:%10:%9:%5:%4 += MI(x) * LO(acc) << 8
608 608
 
609 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 614
         A("adc %11,%13")                   // %11:%10:%9:%5:%4 = LO(x) * MIL(acc)
615 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 619
         A("adc %11,%13")                   // %11:%10:%9:%5:%4 += MI(x) * MIL(acc) << 8
620 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 623
         A("adc %11,%13")                   // %11:%10:%9:%5:%4 += MI(x) * MIL(acc) << 16
624 624
 
625 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 629
         A("adc %11,%13")                   // %11:%10:%9:%5:%4 = LO(x) * MIH(acc) << 8
630 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 633
         A("adc %11,%13")                   // %11:%10:%9:%5:%4 += MI(x) * MIH(acc) << 16
634 634
         A("mul %16,%2")                    // r1:r0 = HI(x) * MIH(acc)
635
-        A("add %10,r0")      
635
+        A("add %10,r0")
636 636
         A("adc %11,r1")                    // %11:%10:%9:%5:%4 += MI(x) * MIH(acc) << 24
637 637
 
638 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 641
         A("adc %11,%13")                   // %11:%10:%9:%5:%4 = LO(x) * HI(acc) << 16
642 642
         A("mul %15,%3")                    // r1:r0 = MI(x) * HI(acc)
643
-        A("add %10,r0")      
643
+        A("add %10,r0")
644 644
         A("adc %11,r1")                    // %11:%10:%9:%5:%4 += MI(x) * HI(acc) << 24
645 645
         A("mul %16,%3")                    // r1:r0 = HI(x) * HI(acc)
646 646
         A("add %11,r0")                    // %11:%10:%9:%5:%4 += MI(x) * HI(acc) << 32
@@ -651,33 +651,33 @@ void Planner::init() {
651 651
         // (1<<24) - x*d
652 652
         // %11:%10:%9 = x
653 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 657
         A("clr %0")                        // %3:%2:%1:%0 = 0x1000000
658 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 662
         A("sbc %3,%13")                    // %3:%2:%1:%0 -= LO(d) * LO(x)
663 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 666
         A("sbc %3,%13")                    // %3:%2:%1:%0 -= MI(d) * LO(x) << 8
667 667
         A("mul %8,%9")                     // r1:r0 = HI(d) * LO(x)
668
-        A("sub %2,r0")      
668
+        A("sub %2,r0")
669 669
         A("sbc %3,r1")                     // %3:%2:%1:%0 -= MIL(d) * LO(x) << 16
670 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 673
         A("sbc %3,%13")                    // %3:%2:%1:%0 -= LO(d) * MI(x) << 8
674 674
         A("mul %7,%10")                    // r1:r0 = MI(d) * MI(x)
675
-        A("sub %2,r0")      
675
+        A("sub %2,r0")
676 676
         A("sbc %3,r1")                     // %3:%2:%1:%0 -= MI(d) * MI(x) << 16
677 677
         A("mul %8,%10")                    // r1:r0 = HI(d) * MI(x)
678 678
         A("sub %3,r0")                     // %3:%2:%1:%0 -= MIL(d) * MI(x) << 24
679 679
         A("mul %6,%11")                    // r1:r0 = LO(d) * HI(x)
680
-        A("sub %2,r0")      
680
+        A("sub %2,r0")
681 681
         A("sbc %3,r1")                     // %3:%2:%1:%0 -= LO(d) * HI(x) << 16
682 682
         A("mul %7,%11")                    // r1:r0 = MI(d) * HI(x)
683 683
         A("sub %3,r0")                     // %3:%2:%1:%0 -= MI(d) * HI(x) << 24
@@ -685,15 +685,15 @@ void Planner::init() {
685 685
         // %8:%7:%6 = d = interval
686 686
 
687 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 690
         A("sbc %2,%8")                     // r -= d
691 691
         A("brcs 14f")                      // if ( r >= d)
692 692
 
693 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 697
         A("adc %11,%13")                   // x++
698 698
         L("14")
699 699
 
@@ -1874,25 +1874,25 @@ void Planner::_buffer_steps(const int32_t (&target)[XYZE]
1874 1874
 
1875 1875
     /**
1876 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 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 1883
      * from path, but used as a robust way to compute cornering speeds, as it takes into account the
1884 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 1887
      * mode (G61). If the junction deviation value is zero, Grbl will execute the motion in an exact
1888 1888
      * stop mode (G61.1) manner. In the future, if continuous mode (G64) is desired, the math here
1889 1889
      * is exactly the same. Instead of motioning all the way to junction point, the machine will
1890 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 1893
      * NOTE: The max junction speed is a fixed value, since machine acceleration limits cannot be
1894 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 1896
      * change the overall maximum entry speed conditions of all blocks.
1897 1897
      */
1898 1898
 
@@ -2020,7 +2020,7 @@ void Planner::_buffer_steps(const int32_t (&target)[XYZE]
2020 2020
     }
2021 2021
     else
2022 2022
       vmax_junction = safe_speed;
2023
-  
2023
+
2024 2024
     previous_safe_speed = safe_speed;
2025 2025
   #endif // Classic Jerk Limiting
2026 2026
 
@@ -2084,7 +2084,7 @@ void Planner::buffer_sync_block() {
2084 2084
   block->nominal_speed   =
2085 2085
   block->entry_speed     =
2086 2086
   block->max_entry_speed =
2087
-  block->millimeters     =  
2087
+  block->millimeters     =
2088 2088
   block->acceleration    = 0;
2089 2089
 
2090 2090
   block->step_event_count          =

Loading…
Cancel
Save