|
@@ -192,14 +192,14 @@ void setup()
|
192
|
192
|
Serial.begin(BAUDRATE);
|
193
|
193
|
SERIAL_ECHOLN("Marlin "<<version_string);
|
194
|
194
|
Serial.println("start");
|
195
|
|
- for(int i = 0; i < BUFSIZE; i++)
|
|
195
|
+ for(int8_t i = 0; i < BUFSIZE; i++)
|
196
|
196
|
{
|
197
|
197
|
fromsd[i] = false;
|
198
|
198
|
}
|
199
|
199
|
|
200
|
200
|
RetrieveSettings(); // loads data from EEPROM if available
|
201
|
201
|
|
202
|
|
- for(int i=0; i < NUM_AXIS; i++)
|
|
202
|
+ for(int8_t i=0; i < NUM_AXIS; i++)
|
203
|
203
|
{
|
204
|
204
|
axis_steps_per_sqr_second[i] = max_acceleration_units_per_sq_second[i] * axis_steps_per_unit[i];
|
205
|
205
|
}
|
|
@@ -470,7 +470,7 @@ inline void process_commands()
|
470
|
470
|
saved_feedmultiply = feedmultiply;
|
471
|
471
|
feedmultiply = 100;
|
472
|
472
|
|
473
|
|
- for(int i=0; i < NUM_AXIS; i++) {
|
|
473
|
+ for(int8_t i=0; i < NUM_AXIS; i++) {
|
474
|
474
|
destination[i] = current_position[i];
|
475
|
475
|
}
|
476
|
476
|
feedrate = 0.0;
|
|
@@ -501,7 +501,7 @@ inline void process_commands()
|
501
|
501
|
case 92: // G92
|
502
|
502
|
if(!code_seen(axis_codes[E_AXIS]))
|
503
|
503
|
st_synchronize();
|
504
|
|
- for(int i=0; i < NUM_AXIS; i++) {
|
|
504
|
+ for(int8_t i=0; i < NUM_AXIS; i++) {
|
505
|
505
|
if(code_seen(axis_codes[i])) current_position[i] = code_value();
|
506
|
506
|
}
|
507
|
507
|
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
@@ -587,7 +587,7 @@ inline void process_commands()
|
587
|
587
|
if (code_seen('P') && pin_status >= 0 && pin_status <= 255)
|
588
|
588
|
{
|
589
|
589
|
int pin_number = code_value();
|
590
|
|
- for(int i = 0; i < (int)sizeof(sensitive_pins); i++)
|
|
590
|
+ for(int8_t i = 0; i < (int8_t)sizeof(sensitive_pins); i++)
|
591
|
591
|
{
|
592
|
592
|
if (sensitive_pins[i] == pin_number)
|
593
|
593
|
{
|
|
@@ -759,7 +759,7 @@ inline void process_commands()
|
759
|
759
|
max_inactive_time = code_value() * 1000;
|
760
|
760
|
break;
|
761
|
761
|
case 92: // M92
|
762
|
|
- for(int i=0; i < NUM_AXIS; i++)
|
|
762
|
+ for(int8_t i=0; i < NUM_AXIS; i++)
|
763
|
763
|
{
|
764
|
764
|
if(code_seen(axis_codes[i]))
|
765
|
765
|
axis_steps_per_unit[i] = code_value();
|
|
@@ -816,20 +816,20 @@ inline void process_commands()
|
816
|
816
|
break;
|
817
|
817
|
//TODO: update for all axis, use for loop
|
818
|
818
|
case 201: // M201
|
819
|
|
- for(int i=0; i < NUM_AXIS; i++)
|
|
819
|
+ for(int8_t i=0; i < NUM_AXIS; i++)
|
820
|
820
|
{
|
821
|
821
|
if(code_seen(axis_codes[i])) axis_steps_per_sqr_second[i] = code_value() * axis_steps_per_unit[i];
|
822
|
822
|
}
|
823
|
823
|
break;
|
824
|
824
|
#if 0 // Not used for Sprinter/grbl gen6
|
825
|
825
|
case 202: // M202
|
826
|
|
- for(int i=0; i < NUM_AXIS; i++) {
|
|
826
|
+ for(int8_t i=0; i < NUM_AXIS; i++) {
|
827
|
827
|
if(code_seen(axis_codes[i])) axis_travel_steps_per_sqr_second[i] = code_value() * axis_steps_per_unit[i];
|
828
|
828
|
}
|
829
|
829
|
break;
|
830
|
830
|
#endif
|
831
|
831
|
case 203: // M203 max feedrate mm/sec
|
832
|
|
- for(int i=0; i < NUM_AXIS; i++) {
|
|
832
|
+ for(int8_t i=0; i < NUM_AXIS; i++) {
|
833
|
833
|
if(code_seen(axis_codes[i])) max_feedrate[i] = code_value()*60 ;
|
834
|
834
|
}
|
835
|
835
|
break;
|
|
@@ -914,7 +914,7 @@ void ClearToSend()
|
914
|
914
|
|
915
|
915
|
inline void get_coordinates()
|
916
|
916
|
{
|
917
|
|
- for(int i=0; i < NUM_AXIS; i++) {
|
|
917
|
+ for(int8_t i=0; i < NUM_AXIS; i++) {
|
918
|
918
|
if(code_seen(axis_codes[i])) destination[i] = (float)code_value() + (axis_relative_modes[i] || relative_mode)*current_position[i];
|
919
|
919
|
else destination[i] = current_position[i]; //Are these else lines really needed?
|
920
|
920
|
}
|
|
@@ -934,7 +934,7 @@ inline void get_arc_coordinates()
|
934
|
934
|
void prepare_move()
|
935
|
935
|
{
|
936
|
936
|
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60.0/100.0);
|
937
|
|
- for(int i=0; i < NUM_AXIS; i++) {
|
|
937
|
+ for(int8_t i=0; i < NUM_AXIS; i++) {
|
938
|
938
|
current_position[i] = destination[i];
|
939
|
939
|
}
|
940
|
940
|
}
|
|
@@ -948,7 +948,7 @@ void prepare_arc_move(char isclockwise) {
|
948
|
948
|
// As far as the parser is concerned, the position is now == target. In reality the
|
949
|
949
|
// motion control system might still be processing the action and the real tool position
|
950
|
950
|
// in any intermediate location.
|
951
|
|
- for(int i=0; i < NUM_AXIS; i++) {
|
|
951
|
+ for(int8_t i=0; i < NUM_AXIS; i++) {
|
952
|
952
|
current_position[i] = destination[i];
|
953
|
953
|
}
|
954
|
954
|
}
|