synthetos / g2

g2core - The Next Generation
Other
625 stars 296 forks source link

Compile g2core for gShield on Windows #512

Closed Element21302 closed 1 year ago

Element21302 commented 2 years ago

I'm still very new to C code and I was having issues compiling g2core for gShield. I was able to get it to compile after adding this to the settings_shapeoko2.h file (copied from settings_cheapo_laser.h):

#define HAS_LASER                   0 
#define HAS_PRESSURE                0 
#define LASER_TOOL                  1   // default tool is 1 - note that TOOLS may be limited to 5!
#define LASER_MIN_S                 0.0001// {th2mns:0.0001}
#define LASER_MAX_S                 255.0 // {th2mxs:255}
#define LASER_MIN_PPM               200   // {th2mnp:200}
#define LASER_MAX_PPM               8000  // {th2mxp:8000}
#define LASER_PULSE_DURATION        100                      // in microseconds {th2pd:5}

I also need to comment out a few of the lines in 0_hardware.cpp to ignore laser_tool This seems like the wrong approach, but I don't really know what I'm doing. I can get the other configurations to compile without modification.

Should I need to define laser settings for gShield?

Thanks to anyone that has any information that can help me. This is all new to me and the documentation doesn't have a ton of information.

RobMackie commented 2 years ago

I'm also having trouble building the DUE target. I'm wondering if I don't know the correct incantation of "make" to get all the right platform things figured out. Since the wiki now says that the DUE is the default target, I tried just doing:

make

But you need a board. So I tried: make PLATFORM=DUE BOARD=gShield and make BOARD=gShield #depends on due being the default target platform

The last two built a lot of files but ended in what look like the same errors you must have been hitting (based on what you say you changed.)

Anyone out there who knows why DUE doesn't build - including that we're just doing it wrong?

Seems like if anything would have an unbroken build, it would be the "default" target. I'm pretty sure I built it in Jan of 2021. I even started a document on how to do it under docker for desktop on windows (and then someone dressed that up and made it more readable)

I'm going to start looking to see if I can determine what has changed. (because I, too, would like to deploy it on due).

Element21302 commented 2 years ago

I was able to compile and flash after making the changes, and it seems to run just fine.

ril3y commented 1 year ago

make PLATFORM=DUE BOARD=gShield This is the correct make command! Thanks for fixing that.