Added .a linkage PR fix

This commit is contained in:
NicoHood 2015-08-24 17:05:20 +02:00
parent 4df1f30427
commit 797b6c9cce
10 changed files with 57 additions and 21 deletions

View file

@ -11,7 +11,7 @@
*/
#include "HID.h"
#include "AbsoluteMouse.h"
#include "HID-Project.h"
const int pinLed = LED_BUILTIN;
const int pinButtonClick = 2;

View file

@ -10,7 +10,7 @@
*/
#include "HID.h"
#include "Consumer.h"
#include "HID-Project.h"
const int pinLed = LED_BUILTIN;
const int pinButton = 2;

View file

@ -9,9 +9,8 @@
https://github.com/NicoHood/HID/wiki/Gamepad-API
*/
#include "Mouse.h"
#include "HID.h"
#include "Gamepad.h"
#include "HID-Project.h"
const int pinLed = LED_BUILTIN;
const int pinButton = 2;

View file

@ -10,7 +10,7 @@
*/
#include "HID.h"
#include "System.h"
#include "HID-Project.h"
const int pinLed = LED_BUILTIN;
const int pinButtonS = 2;

View file

@ -7,3 +7,4 @@ paragraph=Includes Consumer, System and Gamepad. Also compatible with Arduino Un
category=Device Control
url=https://github.com/NicoHood/HID
architectures=*
alinkage=true

View file

@ -27,7 +27,7 @@ THE SOFTWARE.
#if !defined(_USING_HID)
#warning "Using legacy HID core (non pluggable)"
#error "This is not an USB AVR or you use an old version of the IDE."
#else
@ -48,7 +48,7 @@ THE SOFTWARE.
// but the last 3 wont do anything from what I tested
#define MOUSE_ALL (MOUSE_LEFT | MOUSE_RIGHT | MOUSE_MIDDLE | MOUSE_PREV | MOUSE_NEXT)
static const u8 _hidReportDescriptor[] PROGMEM = {
static const uint8_t _absmouseReportDescriptor[] PROGMEM = {
/* Mouse absolute */
0x05, 0x01, /* USAGE_PAGE (Generic Desktop) 54 */
0x09, 0x02, /* USAGE (Mouse) */
@ -137,8 +137,8 @@ private:
public:
inline AbsMouse_(void) {
static HID_Descriptor cb = {
.length = sizeof(_hidReportDescriptor),
.descriptor = _hidReportDescriptor,
.length = sizeof(_absmouseReportDescriptor),
.descriptor = _absmouseReportDescriptor,
};
static HIDDescriptorListNode node(&cb);
HID.AppendDescriptor(&node);

View file

@ -27,7 +27,7 @@ THE SOFTWARE.
#if !defined(_USING_HID)
#warning "Using legacy HID core (non pluggable)"
#error "This is not an USB AVR or you use an old version of the IDE."
#else
@ -67,7 +67,7 @@ THE SOFTWARE.
#define CONSUMER_BROWSER_REFRESH 0x227
#define CONSUMER_BROWSER_BOOKMARKS 0x22A
static const u8 _hidReportDescriptor[] PROGMEM = {
static const uint8_t _consumerReportDescriptor[] PROGMEM = {
/* Consumer Control (Sound/Media keys) */
0x05, 0x0C, /* usage page (consumer device) */
0x09, 0x01, /* usage -- consumer control */
@ -103,8 +103,8 @@ class Consumer_ {
public:
inline Consumer_(void) {
static HID_Descriptor cb = {
.length = sizeof(_hidReportDescriptor),
.descriptor = _hidReportDescriptor,
.length = sizeof(_consumerReportDescriptor),
.descriptor = _consumerReportDescriptor,
};
static HIDDescriptorListNode node(&cb);
HID.AppendDescriptor(&node);

View file

@ -27,7 +27,7 @@ THE SOFTWARE.
#if !defined(_USING_HID)
#warning "Using legacy HID core (non pluggable)"
#error "This is not an USB AVR or you use an old version of the IDE."
#else
@ -50,7 +50,7 @@ THE SOFTWARE.
#define GAMEPAD_DPAD_LEFT 7
#define GAMEPAD_DPAD_UP_LEFT 8
static const u8 _hidReportDescriptor[] PROGMEM = {
static const uint8_t _gamepadReportDescriptor[] PROGMEM = {
/* Gamepad with 32 buttons and 6 axis*/
0x05, 0x01, /* USAGE_PAGE (Generic Desktop) */
0x09, 0x04, /* USAGE (Joystick) */
@ -162,8 +162,8 @@ class Gamepad_{
public:
inline Gamepad_(void){
static HID_Descriptor cb = {
.length = sizeof(_hidReportDescriptor),
.descriptor = _hidReportDescriptor,
.length = sizeof(_gamepadReportDescriptor),
.descriptor = _gamepadReportDescriptor,
};
static HIDDescriptorListNode node(&cb);
HID.AppendDescriptor(&node);

View file

@ -0,0 +1,36 @@
/*
Copyright (c) 2014-2015 NicoHood
See the readme for credit to other people.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
// Include guard
#pragma once
// Software version
#define HID_PROJECT_VERSION 240
#include <Arduino.h>
// Include all HID libraries (.a linkage required to work) properly
#include "AbsoluteMouse.h"
#include "Consumer.h"
#include "Gamepad.h"
#include "System.h"

View file

@ -27,7 +27,7 @@ THE SOFTWARE.
#if !defined(_USING_HID)
#warning "Using legacy HID core (non pluggable)"
#error "This is not an USB AVR or you use an old version of the IDE."
#else
@ -43,7 +43,7 @@ THE SOFTWARE.
#define SYSTEM_SLEEP 0x82
#define SYSTEM_WAKE_UP 0x83
static const u8 _hidReportDescriptor[] PROGMEM = {
static const uint8_t _systemReportDescriptor[] PROGMEM = {
//TODO limit to system keys only?
/* System Control (Power Down, Sleep, Wakeup, ...) */
0x05, 0x01, /* USAGE_PAGE (Generic Desktop) */
@ -73,8 +73,8 @@ class System_{
public:
inline System_(void){
static HID_Descriptor cb = {
.length = sizeof(_hidReportDescriptor),
.descriptor = _hidReportDescriptor,
.length = sizeof(_systemReportDescriptor),
.descriptor = _systemReportDescriptor,
};
static HIDDescriptorListNode node(&cb);
HID.AppendDescriptor(&node);