Repetier said:
Seems to be a older version. Go to HAL.cpp and search stepperWait and modify definition into
volatile long attribute((used)) stepperWait = 0;
attribute((used)) was added to tell compiler to not omit it. It does not see it due to only be used in assembler part.
Thx for your reply, but to be honest , I still have no idea what to do. stepperWait first appears in line 633
626{
asm volatile (
"cli \n\t"
"tst %C[delay] \n\t" //if(delay<65536) {
"brne else%= \n\t"
"cpi %B[delay],255 \n\t"
"breq else%= \n\t" // delay <65280
633 "sts stepperWait,r1 \n\t" // stepperWait = 0;
"sts stepperWait+1,r1 \n\t"
"sts stepperWait+2,r1 \n\t"
"lds %C[delay],%[time] \n\t" // Read TCNT1
"lds %D[delay],%[time]+1 \n\t"
"ldi r18,100 \n\t" // Add 100 to TCNT1
"add %C[delay],r18 \n\t"
"adc %D[delay],r1 \n\t"
"cp %A[delay],%C[delay] \n\t" // delay<TCNT1+1
"cpc %B[delay],%D[delay] \n\t"
"brcc exact%= \n\t"
"sts %[ocr]+1,%D[delay] \n\t" // OCR1A = TCNT1+100;
"sts %[ocr],%C[delay] \n\t"
"rjmp end%= \n\t"
"exact%=: sts %[ocr]+1,%B[delay] \n\t" // OCR1A = delay;
"sts %[ocr],%A[delay] \n\t"
"rjmp end%= \n\t"
"else%=: subi %B[delay], 0x80 \n\t" //} else { stepperWait = delay-32768;
"sbci %C[delay], 0x00 \n\t"
"sts stepperWait,%A[delay] \n\t"
"sts stepperWait+1,%B[delay] \n\t"
"sts stepperWait+2,%C[delay] \n\t"
"ldi %D[delay], 0x80 \n\t" //OCR1A = 32768;
"sts %[ocr]+1, %D[delay] \n\t"
"sts %[ocr], r1 \n\t"
"end%=: \n\t"
:[delay]"=&d"(delay) // Output
:"0"(delay),[ocr]"i" (_SFR_MEM_ADDR(OCR1A)),[time]"i"(_SFR_MEM_ADDR(TCNT1)) // Input
:"r18" // Clobber
662 );
and , as I can see in error message, line 662 in where complier finds an error. So, do I need to change something in code which I copy-pasted right now or I'm in totally wrong place in the code ?