소스 검색

Fixed crashes.

Erik van der Zalm 12 년 전
부모
커밋
0b1423c303
1개의 변경된 파일8개의 추가작업 그리고 11개의 파일을 삭제
  1. 8
    11
      Marlin/Marlin.pde

+ 8
- 11
Marlin/Marlin.pde 파일 보기

33
 #include "Marlin.h"
33
 #include "Marlin.h"
34
 #include "speed_lookuptable.h"
34
 #include "speed_lookuptable.h"
35
 
35
 
36
-char version_string[] = "0.9.9";
36
+char version_string[] = "0.9.10";
37
 
37
 
38
 #ifdef SDSUPPORT
38
 #ifdef SDSUPPORT
39
 #include "SdFat.h"
39
 #include "SdFat.h"
1286
 // implements the reverse pass.
1286
 // implements the reverse pass.
1287
 void planner_reverse_pass() {
1287
 void planner_reverse_pass() {
1288
   char block_index = block_buffer_head;
1288
   char block_index = block_buffer_head;
1289
-  block_t *block[3] = {
1290
-    NULL, NULL, NULL  };
1291
-  while(block_index != block_buffer_tail) {    
1289
+  block_index--;
1290
+  block_t *block[3] = { NULL, NULL, NULL };
1291
+  while(block_index != block_buffer_tail) {  
1292
+    block_index--;
1293
+    if(block_index < 0) block_index = BLOCK_BUFFER_SIZE-1;  
1292
     block[2]= block[1];
1294
     block[2]= block[1];
1293
     block[1]= block[0];
1295
     block[1]= block[0];
1294
     block[0] = &block_buffer[block_index];
1296
     block[0] = &block_buffer[block_index];
1295
     planner_reverse_pass_kernel(block[0], block[1], block[2]);
1297
     planner_reverse_pass_kernel(block[0], block[1], block[2]);
1296
-    block_index--;
1297
-    if(block_index < 0) {
1298
-      block_index = BLOCK_BUFFER_SIZE-1;
1299
-    }
1300
   }
1298
   }
1301
-//  planner_reverse_pass_kernel(NULL, block[0], block[1]);
1299
+  planner_reverse_pass_kernel(NULL, block[0], block[1]);
1302
 }
1300
 }
1303
 
1301
 
1304
 // The kernel called by planner_recalculate() when scanning the plan from first to last entry.
1302
 // The kernel called by planner_recalculate() when scanning the plan from first to last entry.
1428
 // mm. Microseconds specify how many microseconds the move should take to perform. To aid acceleration
1426
 // mm. Microseconds specify how many microseconds the move should take to perform. To aid acceleration
1429
 // calculation the caller must also provide the physical length of the line in millimeters.
1427
 // calculation the caller must also provide the physical length of the line in millimeters.
1430
 void plan_buffer_line(float x, float y, float z, float e, float feed_rate) {
1428
 void plan_buffer_line(float x, float y, float z, float e, float feed_rate) {
1431
-
1432
   // The target position of the tool in absolute steps
1429
   // The target position of the tool in absolute steps
1433
   // Calculate target position in absolute steps
1430
   // Calculate target position in absolute steps
1434
   long target[4];
1431
   long target[4];
1519
   // Compute the acceleration rate for the trapezoid generator. 
1516
   // Compute the acceleration rate for the trapezoid generator. 
1520
   float travel_per_step = block->millimeters/block->step_event_count;
1517
   float travel_per_step = block->millimeters/block->step_event_count;
1521
   if(block->steps_x == 0 && block->steps_y == 0 && block->steps_z == 0) {
1518
   if(block->steps_x == 0 && block->steps_y == 0 && block->steps_z == 0) {
1522
-    block->acceleration = ceil( (retract_acceleration)/travel_per_step); // convert to: acceleration steps/sec^2
1519
+    block->acceleration_st = ceil( (retract_acceleration)/travel_per_step); // convert to: acceleration steps/sec^2
1523
   }
1520
   }
1524
   else {
1521
   else {
1525
     block->acceleration_st = ceil( (acceleration)/travel_per_step);      // convert to: acceleration steps/sec^2
1522
     block->acceleration_st = ceil( (acceleration)/travel_per_step);      // convert to: acceleration steps/sec^2

Loading…
취소
저장