Skip to content

Commit

Permalink
Add header file trampoline to allow library build with Arduino IDE.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelpatel committed Apr 12, 2015
1 parent 14e0541 commit 825937b
Show file tree
Hide file tree
Showing 11 changed files with 98 additions and 7 deletions.
3 changes: 3 additions & 0 deletions build/Arduino-Makefile/Arduino.mk
Expand Up @@ -780,8 +780,11 @@ endif

ifndef ARDUINO_LIBS
# automatically determine included libraries
ARDUINO_LIBS += $(filter $(notdir $(wildcard $(ARDUINO_LIB_PATH)/*)), $(shell sed -ne "s/^ *\# *include *[<\"]\(.*\)\.h[>\"]/\1/p" $(LOCAL_SRCS)))
ARDUINO_LIBS += $(filter $(notdir $(wildcard $(ARDUINO_LIB_PATH)/*)), $(shell sed -ne "s/^ *\# *include *[<\"]\(.*\)\.hh[>\"]/\1/p" $(LOCAL_SRCS)))
ARDUINO_LIBS += $(filter $(notdir $(wildcard $(ARDUINO_SKETCHBOOK)/libraries/*)), $(shell sed -ne "s/^ *\# *include *[<\"]\(.*\)\.h[>\"]/\1/p" $(LOCAL_SRCS)))
ARDUINO_LIBS += $(filter $(notdir $(wildcard $(ARDUINO_SKETCHBOOK)/libraries/*)), $(shell sed -ne "s/^ *\# *include *[<\"]\(.*\)\.hh[>\"]/\1/p" $(LOCAL_SRCS)))
ARDUINO_LIBS += $(filter $(notdir $(wildcard $(USER_LIB_PATH)/*)), $(shell sed -ne "s/^ *\# *include *[<\"]\(.*\)\.h[>\"]/\1/p" $(LOCAL_SRCS)))
ARDUINO_LIBS += $(filter $(notdir $(wildcard $(USER_LIB_PATH)/*)), $(shell sed -ne "s/^ *\# *include *[<\"]\(.*\)\.hh[>\"]/\1/p" $(LOCAL_SRCS)))
endif

Expand Down
30 changes: 30 additions & 0 deletions libraries/Library/Library.h
@@ -0,0 +1,30 @@
/**
* @file Library.h
* @version 1.0
*
* @section License
* Copyright (C) 2014-2015, Mikael Patel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* @section Description
* Library main class header file template. Trampoline for Arduino
* library handling.
*
* This file is part of the Arduino Che Cosa project.
*/

#ifndef LIBRARY_H
#define LIBRARY_H

#include "Library.hh"

#endif
2 changes: 1 addition & 1 deletion libraries/Library/examples/CosaLibrary/CosaLibrary.ino
Expand Up @@ -25,7 +25,7 @@
* This file is part of the Arduino Che Cosa project.
*/

#include "Library.hh"
#include <Library.h>
#include "Cosa/Trace.hh"
#include "Cosa/Watchdog.hh"
#include "Cosa/IOStream.hh"
Expand Down
29 changes: 29 additions & 0 deletions libraries/MQTT/MQTT.h
@@ -0,0 +1,29 @@
/**
* @file MQTT.h
* @version 1.0
*
* @section License
* Copyright (C) 2014-2015, Mikael Patel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* @section Description
* Trampoline for Arduino library handling.
*
* This file is part of the Arduino Che Cosa project.
*/

#ifndef COSA_IOT_MQTT_H
#define COSA_IOT_MQTT_H

#include "MQTT.hh"

#endif
2 changes: 1 addition & 1 deletion libraries/MQTT/examples/CosaMQTTclient/CosaMQTTclient.ino
Expand Up @@ -33,7 +33,7 @@
* This file is part of the Arduino Che Cosa project.
*/

#include "MQTT.hh"
#include <MQTT.h>
#include "Cosa/Watchdog.hh"
#include "Cosa/Trace.hh"
#include "Cosa/IOStream/Driver/UART.hh"
Expand Down
Expand Up @@ -42,7 +42,7 @@
* This file is part of the Arduino Che Cosa project.
*/

#include "MQTT.hh"
#include <MQTT.h>
#include "Cosa/RTC.hh"
#include "Cosa/Watchdog.hh"
#include "Cosa/IOBuffer.hh"
Expand Down
Expand Up @@ -43,7 +43,7 @@
* This file is part of the Arduino Che Cosa project.
*/

#include "MQTT.hh"
#include <MQTT.h>
#include "Cosa/Board.hh"
#include "Cosa/Watchdog.hh"
#include "Cosa/IOBuffer.hh"
Expand Down
29 changes: 29 additions & 0 deletions libraries/ThingSpeak/ThingSpeak.h
@@ -0,0 +1,29 @@
/**
* @file ThingSpeak.h
* @version 1.0
*
* @section License
* Copyright (C) 2014, Mikael Patel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* @section Description
* Trampoline for Arduino library handling.
*
* This file is part of the Arduino Che Cosa project.
*/

#ifndef COSA_IOT_THINGSPEAK_H
#define COSA_IOT_THINGSPEAK_H

#include "ThingSpeak.hh"

#endif
Expand Up @@ -45,7 +45,7 @@
// Uncomment to remove debug output
// #define NDEBUG

#include "ThingSpeak.hh"
#include <ThingSpeak.h>
#include "Cosa/RTC.hh"
#include "Cosa/Watchdog.hh"
#include "Cosa/Driver/DHT.hh"
Expand Down
Expand Up @@ -54,7 +54,7 @@
* This file is part of the Arduino Che Cosa project.
*/

#include "ThingSpeak.hh"
#include <ThingSpeak.h>
#include "Cosa/RTC.hh"
#include "Cosa/Event.hh"
#include "Cosa/Watchdog.hh"
Expand Down
Expand Up @@ -38,7 +38,7 @@
* This file is part of the Arduino Che Cosa project.
*/

#include "ThingSpeak.hh"
#include <ThingSpeak.h>
#include "Cosa/Watchdog.hh"
#include "Cosa/Socket/Driver/W5100.hh"

Expand Down

0 comments on commit 825937b

Please sign in to comment.