Peter-van-Tol / LiteX-CNC

Generic CNC firmware and driver for FPGA cards which are supported by LiteX
GNU General Public License v3.0
56 stars 22 forks source link

11-add-external-extensions-to-linuxcnc litexcnc.c #22

Closed ozzyrob closed 1 year ago

ozzyrob commented 1 year ago

Should the following code

// Between version 2.8 and 2.9 the definition of LINELEN has moved. Below
// is a check whether 2.9 is installed. If so, the header is imported to
// get the correct value of LINELEN.
#ifdef LINUXCNC_H
#include "linuxcnc.h"
#endif /* LINUXCNC_H */

#include "litexcnc.h"

be

// Between version 2.8 and 2.9 the definition of LINELEN has moved. Below
// is a check whether 2.9 is installed. If so, the header is imported to
// get the correct value of LINELEN.
#ifndef LINUXCNC_H
#include "linuxcnc.h"
#endif /* LINUXCNC_H */

#include "litexcnc.h"

When compiling with 2.9 the first doesn't work but the second will.

Peter-van-Tol commented 1 year ago

Your correct that the code does nor work with LinuxCNC 2.9. However, when using this code on LinuxCNC 2.8 it won't work, as the import "linuxcnc.h" does not exist. Have to investigate how to check for this with the pre-processor.

Peter-van-Tol commented 1 year ago

Could you please verify that the following code works on LinuxCNC 2.9?

// Between version 2.8 and 2.9 the definition of LINELEN has moved. Below
// is a check whether 2.9 is installed. If so, the header is imported to
// get the correct value of LINELEN.
#ifndef LINELEN
#include "linuxcnc.h"
#endif /* LINELEN*/
ozzyrob commented 1 year ago

Can confirm, as that is the code mod I used in the opening post.

Peter-van-Tol commented 1 year ago

Your change has been applied to 11-add-external-extensions-to-linuxcnc. Thanks a lot!