Git Product home page Git Product logo

Comments (9)

identy avatar identy commented on May 24, 2024

edit included file motion_control.c

void mc_dwell(uint32_t milliseconds)
{
st_synchronize();
delay_ms(milliseconds);
}

/* function for long delay */
void delay_ms(uint32_t ms) {
while ( ms )
{
_delay_ms(1);
ms--;
}
}

I Think, probe :-/

from grbl.

chamnit avatar chamnit commented on May 24, 2024

Take a look at my grbl fork. I've effectively picked up the torch, as Simen has been busy with other things. A lot of lingering bugs have been fixed and improvements have been made to v0.7, which is now master status.

FYI, a new v0.8 version with run-time commands (decelerating feedhold, resume, reset, jogging(TBD)) will be released later tonight. This is an alpha release.

from grbl.

TheExtraPiece avatar TheExtraPiece commented on May 24, 2024

I just checked out your fork, but it seems to have the same problem. I looked into it a bit more, and it seems that it is due to a change in avr-libc. As of v1.7.1 it is not possible to use variables with the delay functions. Apparently you weren't supposed to do this with previous versions anyways, but now it is being enforced due to a change in how delays are implemented.
You're probably using an older version of the library, so you don't get this error. It's really quite trivial to fix, I just added a couple of inline functions to nuts_bolts to mimic the old functionality of _delay_ms() and _delay_us(). The function that Identy suggested above does the trick, and it seems to be what most people are using.

from grbl.

identy avatar identy commented on May 24, 2024

:)

from grbl.

chamnit avatar chamnit commented on May 24, 2024

Good to know! I haven't run into this problem, as I pretty much exclusively use the avrdude compiler that comes the Arduino software. It sounds like it still supports the variable in the delay. I'll try to work a fix in when I get some time.

from grbl.

jes1510 avatar jes1510 commented on May 24, 2024

I am having the exact same problem with the latest versions in Master and Edge.

avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=atmega328p -I. -ffunction-sections -c motion_control.c -o motion_control.o
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=atmega328p -I. -ffunction-sections -c limits.c -o limits.o
In file included from limits.c:21:0:
/usr/lib/gcc/avr/4.5.3/../../../avr/include/util/delay.h: In function ‘homing_cycle’:
/usr/lib/gcc/avr/4.5.3/../../../avr/include/util/delay.h:230:28: error: __builtin_avr_delay_cycles expects an integer constant.
/usr/lib/gcc/avr/4.5.3/../../../avr/include/util/delay.h:230:28: error: __builtin_avr_delay_cycles expects an integer constant.
make: *** [limits.o] Error 1

from grbl.

chamnit avatar chamnit commented on May 24, 2024

Thanks! Looks like I missed the _delay_us() calls when I had fixed it for the _delay_ms(). I'll issue a fix for this later today. If you want to fix it immediately, look in nut_bolts.c and repeat the same procedure as did with _delay_ms().

from grbl.

jes1510 avatar jes1510 commented on May 24, 2024

Thanks that fixed it. For completeness I changed it to this in limits.c:
delay_us(settings.pulse_microseconds);
STEPPING_PORT ^= out_bits & STEP_MASK;
delay_us(step_delay);

and I added this function to nuts_bolts.h:
void delay_us(uint16_t us)
{
while (us--) { _delay_us(1);}
}

from grbl.

chamnit avatar chamnit commented on May 24, 2024

Good to hear. Sorry that I didn't post the fix when I stated. I've been sidetracked with other things. When I finally get this next edge push out, I'll make sure to update the master branch with this fix.

from grbl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.