Skip to content

Commit

Permalink
Fixing #22
Browse files Browse the repository at this point in the history
The arduino IDE doesn't compile files in sub directories.  So when its not a Platformio build pull those files into the main file so they get compiled and linked correctly.
Also fixed up some include paths so they work in both IDEs/Environments
  • Loading branch information
pyjamasam committed Dec 16, 2020
1 parent 338772d commit 49f2cc5
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 6 deletions.
58 changes: 57 additions & 1 deletion CANserver/CANserver.ino
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,60 @@ void loop()
delay(1000);
ESP.restart();
}
}
}


#ifndef PLATFORMIO
//When compiling under the arduino IDE we need to pull in all the source files that aren't in the root directory so things link correctly
#include "can_common/can_common.cpp"

#include "esp32_can/esp32_can.cpp"
#include "esp32_can/esp32_can_builtin.cpp"
#include "esp32_can/esp32_can_builtin_lowlevel.cpp"
#include "esp32_can/mcp2515.cpp"

#include "asynctcp/AsyncTCP.cpp"

#include "esp_async_webserver/AsyncEventSource.cpp"
#include "esp_async_webserver/SPIFFSEditor.cpp"
#include "esp_async_webserver/WebAuthentication.cpp"
#include "esp_async_webserver/WebHandlers.cpp"
#include "esp_async_webserver/WebRequest.cpp"
#include "esp_async_webserver/WebResponses.cpp"
#include "esp_async_webserver/WebServer.cpp"


extern "C" {
#include "lua/lapi.c"
#include "lua/lauxlib.c"
#include "lua/lbaselib.c"
#include "lua/lbitlib.c"
#include "lua/lcode.c"
#include "lua/lcorolib.c"
#include "lua/lctype.c"
#include "lua/ldblib.c"
#include "lua/ldebug.c"
#include "lua/ldo.c"
#include "lua/ldump.c"
#include "lua/lfunc.c"
#include "lua/lgc.c"
#include "lua/linit.c"
#include "lua/llex.c"
#include "lua/lmathlib.c"
#include "lua/lmem.c"
#include "lua/lobject.c"
#include "lua/lopcodes.c"
#include "lua/lparser.c"
#include "lua/lstate.c"
#include "lua/lstring.c"
#include "lua/lstrlib.c"
#include "lua/ltable.c"
#include "lua/ltablib.c"
#include "lua/ltm.c"
#include "lua/lua.c"
#include "lua/lundump.c"
#include "lua/lvm.c"
#include "lua/lzio.c"
}

#endif
2 changes: 1 addition & 1 deletion CANserver/Displays.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define __DISPLAYS_H__

#include <Arduino.h>
#include <Average.h>
#include "Average.h"

#include "lua/lua.hpp"

Expand Down
2 changes: 1 addition & 1 deletion CANserver/esp32_can/esp32_can_builtin.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#define __ESP32_CAN__

#include <Arduino.h>
#include "can_common/can_common.h"
#include "../can_common/can_common.h"
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include <freertos/queue.h>
Expand Down
2 changes: 1 addition & 1 deletion CANserver/esp32_can/mcp2515.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#include "Arduino.h"
#include "mcp2515_defs.h"
#include "can_common/can_common.h"
#include "../can_common/can_common.h"

//#define DEBUG_SETUP

Expand Down
2 changes: 1 addition & 1 deletion CANserver/esp_async_webserver/AsyncEventSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include <Arduino.h>
#ifdef ESP32
#include "asynctcp/AsyncTCP.h"
#include "../asynctcp/AsyncTCP.h"
#else
#include <ESPAsyncTCP.h>
#endif
Expand Down
2 changes: 1 addition & 1 deletion CANserver/esp_async_webserver/ESPAsyncWebServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#ifdef ESP32
#include <WiFi.h>
#include "asynctcp/AsyncTCP.h"
#include "../asynctcp/AsyncTCP.h"
#elif defined(ESP8266)
#include <ESP8266WiFi.h>
#include <ESPAsyncTCP.h>
Expand Down

0 comments on commit 49f2cc5

Please sign in to comment.