Palatis / Arduino-Lufa

LUFA (Lightweight USB For AVRs) on the Arduino!
MIT License
100 stars 26 forks source link

installation instuctions outdated #1

Closed just-ole closed 7 years ago

just-ole commented 7 years ago

I stumbled upon this repo while trying to get lufa working on a leonardo board and decided to give it a shot.

with the 1.6.12 version of arduino studio, the files mentioned in the installation section changed:

HID.cpp doesn't exist anymore the line numbers in Arduino.h and main.cpp are off the lines meant for main.cpp are already there Platform.h doesn't exist anymore

I'm not sure what route I'll go from here to get lufa working, if it is relevant to this repo, there will be a pull request, if you or anyone else knows how to do it now before that that'd be even better.

Palatis commented 7 years ago

the main idea is to disable USB specific code in the core, to avoid LUFA and Arduino USB stuff messing each others.

just look around the source files, and comment out according lines, you're good to go.

Dak0r commented 7 years ago

If some stumbles upon this: I got it working in 1.8.2 with latest LUFA. As @Palatis said, you simply have to remove everything that is related to USB from the files in the core directory.

Additional steps, i did to get it working:

For clarification, Lufa.h should look like this when you are done:

#ifndef __LUFA_H__
#define __LUFA_H__
/*
 * This file is here only because Arduino wants it...
 */
//#include <Platform.h>
#define F_USB F_CPU
#include <Arduino.h>
#include <LUFA/Drivers/USB/USB.h>
#endif

That's all to get it working. The example is outdated as well, but the only change you have to do is: in Descriptors.c, replace all VERSION_BCD(01.10) with VERSION_BCD(1,1,0) and VERSION_BCD(00.01)with VERSION_BCD(0,0,1)

After this, i successfully uploaded the example to my Arduino Micro 👍

Palatis commented 7 years ago

Thanks for the details, @Dakor91, I shifted onto other stuff and didn't really visit this repo for a long time. However I might come back to this one since I recently have another (paid) project involving a small USB device.

Happy Arduinoing! 👍

Palatis commented 7 years ago

btw, I do accept PR :-D

Dak0r commented 7 years ago

I currently don't have much time, so I didn't want to create one. But I found a few spare minutes (procrastination at its best) 😀 https://github.com/Palatis/Arduino-Lufa/pull/2