-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Constants not defined during compilation #66
Comments
A few points:
|
I'm using Arduino IDE 1.8.20 I am using this CMake file and it seems to work. However without setting those compile definitions, it will error out (see above). cmake_minimum_required(VERSION 3.0.0)
add_compile_definitions(ARDUINO=10820)
add_compile_definitions(USBCON=1)
set(CMAKE_TOOLCHAIN_FILE "/home/user/repositories/arduino/Arduino-CMake-Toolchain/Arduino-toolchain.cmake")
set(ARDUINO_INSTALL_PATH "/home/user/repositories/arduino/arduino-ide/build")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
project (AH64MFDController CXX)
add_executable(AH64MFDController lnk/MFDController.cpp)
target_link_arduino_libraries(AH64MFDController PRIVATE HID HID-Project core)
set_target_properties(AH64MFDController PROPERTIES LINKER_LANGUAGE CXX)
target_enable_arduino_upload(AH64MFDController) My project directory structure is as such:
|
Sorry I was confused about the AH64 :D. The question is what's your target board, what hardware are you planning to run this on? I was getting at if it has USB HID functionality, but if settings those constants work, I guess yes. |
I'm using an arduino pro micro. Flashing with the arduino ide works just fine. I selected avr.micro. I actually just got done debugging and testing the thing on a breadboard and it works fine, even in the flight sim. So it definitely has HID capability. |
Hi, I could replicate the issue, I'll see what I can do, |
I get compilation errors like AH64MFD-Arduino/lnk/MFDController.cpp:164:41: error: 'PIN_A0' was not declared in this scope Where are those definitions supposed to come from? |
I've added setting the ARDUINO symbol to the toolchain, it's one error less. Not sure how to get the USBCON symbol, it would need to come from the board definition. |
Strange. it compiles fine for me. Honestly, I just want to use nvim to write my code. I don't mind compiling and uploading with the arduino thing. But that IDE is a joke. Edit: Fixed flashing. Had to touch the serial interface first. Would be neat if that were done automagically though. |
The Arduino IDE only helps you installing the SDK files, besides that it's just a text editor. I went for cmake because it's a powerful build system, and it allows me to use CLion instead of the Arduino IDE. So your issue is fixed now? BTW, you can use my fork which includes PRs not merged here, and a few other fixes. |
I am using your fork. And no, it seems it defines `ARDUINO=10000´ and it complains about the version being wrong. I still have to re-define it. |
I'm a but confused, did you try with my latest changes? For me it did define a number that was bigger than the required minimum version, so I could compile without redefining it. |
When I look at compile_commands.json, then |
I am trying to compile for an avr.micro and to use the HID-Project library.
When I try to compile with this CMake file
I get those errors
However when I define them, I get warning about redefinitions.
The text was updated successfully, but these errors were encountered: