Sprinter "Expected Identifier" Error

Hello all! I am putting together a DLP 3D printer using Sprinter (Marlin) firmware and keep getting an error when trying to compile my .h file. I’m not a coder and cannot figure out why this keeps happening. :confused: Any assistance would be appreciated. I’m using release version 1.6.10.

[Arduino: 1.6.10 (Windows 7), Board: “Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)”

Sprintermod:2232: error: ‘block_t’ was not declared in this scope

Sprintermod:2232: error: ‘block’ was not declared in this scope

void calculate_trapezoid_for_block(block_t *block, float entry_factor, float exit_factor)

^

Sprintermod:2232: error: expected primary-expression before ‘float’

void calculate_trapezoid_for_block(block_t *block, float entry_factor, float exit_factor)

^

Sprintermod:2232: error: expected primary-expression before ‘float’

void calculate_trapezoid_for_block(block_t *block, float entry_factor, float exit_factor)

^

Sprintermod:2234: error: conflicting declaration ‘long unsigned int final_rate’

unsigned long final_rate = ceil(block->nominal_rate*exit_factor); // (step/min)

^

In file included from C:\Users\Primary\Documents\Arduino\Little_Dipper\Sprintermod.ino:154:0:

sketch\Sprinter.h:83:8: note: previous declaration as ‘long int final_rate’

long final_rate; // The minimal rate at exit

^

Sprintermod:2234: error: ‘block’ was not declared in this scope

unsigned long final_rate = ceil(block->nominal_rate*exit_factor); // (step/min)

^

Sprintermod:2234: error: ‘exit_factor’ was not declared in this scope

unsigned long final_rate = ceil(block->nominal_rate*exit_factor); // (step/min)

^

Sprintermod:2237: error: expected unqualified-id before ‘if’

if(initial_rate <120) {initial_rate=120; }

^

Sprintermod:2238: error: expected unqualified-id before ‘if’

if(final_rate < 120) {final_rate=120; }

^

Sprintermod:2240: error: conflicting declaration ‘long int acceleration’

long acceleration = block->acceleration_st;

^

In file included from C:\Users\Primary\Documents\Arduino\Little_Dipper\Sprintermod.ino:154:0:

sketch\Sprinter.h:75:9: note: previous declaration as ‘float acceleration’

float acceleration; // acceleration mm/sec^2

^

Sprintermod:2240: error: ‘block’ was not declared in this scope

long acceleration = block->acceleration_st;

^

Sprintermod:2242: error: ‘block’ was not declared in this scope

ceil(estimate_acceleration_distance(block->initial_rate, block->nominal_rate, acceleration));

^

Sprintermod:2242: error: ‘block’ was not declared in this scope

ceil(estimate_acceleration_distance(block->initial_rate, block->nominal_rate, acceleration));

^

Sprintermod:2244: error: ‘block’ was not declared in this scope

floor(estimate_acceleration_distance(block->nominal_rate, block->final_rate, -acceleration));

^

Sprintermod:2244: error: ‘block’ was not declared in this scope

floor(estimate_acceleration_distance(block->nominal_rate, block->final_rate, -acceleration));

^

Sprintermod:2247: error: conflicting declaration ‘int32_t plateau_steps’

int32_t plateau_steps = block->step_event_count-accelerate_steps-decelerate_steps;

^

C:\Users\Primary\Documents\Arduino\Little_Dipper\Sprintermod.ino:281:15: note: previous declaration as ‘long unsigned int plateau_steps’

unsigned long plateau_steps;

^

Sprintermod:2247: error: ‘block’ was not declared in this scope

int32_t plateau_steps = block->step_event_count-accelerate_steps-decelerate_steps;

^

Sprintermod:2252: error: expected unqualified-id before ‘if’

if (plateau_steps < 0) {

^

In file included from C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:30:0,

from sketch\Little_Dipper.ino.cpp:1:

Sprintermod:171: error: expected ‘)’ before ‘::’ token

#define CRITICAL_SECTION_START unsigned char _sreg = SREG; cli()

^

C:\Users\Primary\Documents\Arduino\Little_Dipper\Sprintermod.ino:2267:3: note: in expansion of macro ‘CRITICAL_SECTION_START’

CRITICAL_SECTION_START; // Fill variables used by the stepper in a critical section

^

Sprintermod:2268: error: expected unqualified-id before ‘if’

if(block->busy == false) { // Don’t update variables if block is busy.

^

In file included from c:\program files\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,

from c:\program files\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

from C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,

from sketch\Little_Dipper.ino.cpp:1:

Sprintermod:172: error: expected unqualified-id before ‘volatile’

#define CRITICAL_SECTION_END SREG = _sreg

^

C:\Users\Primary\Documents\Arduino\Little_Dipper\Sprintermod.ino:2278:3: note: in expansion of macro ‘CRITICAL_SECTION_END’

CRITICAL_SECTION_END;

^

Sprintermod:172: error: expected ‘)’ before ‘volatile’

#define CRITICAL_SECTION_END SREG = _sreg

^

C:\Users\Primary\Documents\Arduino\Little_Dipper\Sprintermod.ino:2278:3: note: in expansion of macro ‘CRITICAL_SECTION_END’

CRITICAL_SECTION_END;

^

Sprintermod:172: error: expected ‘)’ before ‘volatile’

#define CRITICAL_SECTION_END SREG = _sreg

^

C:\Users\Primary\Documents\Arduino\Little_Dipper\Sprintermod.ino:2278:3: note: in expansion of macro ‘CRITICAL_SECTION_END’

CRITICAL_SECTION_END;

^

Sprintermod:2279: error: expected declaration before ‘}’ token

}

^

exit status 1
expected identifier before ‘long’

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.
]

Curadh013: Hello all! I am putting together a DLP 3D

And? You have some problem? Care to enlighten us as to what it is?

Sorry, posted too early! Updated original post above...

I'm using release version 1.6.10

To compile what code? In this part of the forum, POST YOUR CODE rules.