Fix library ARCH issues
stm32duino / Arduino_Core_STM32 can't be compiled with Arduino Bridge/Ethernet/WiFi libraries.
This commit is contained in:
Binary file not shown.
@@ -1,3 +1,4 @@
|
||||
|
||||
/* BlinkOnBridgeProp.ino
|
||||
MIT License (c) Faure Systems <dev at faure dot systems>
|
||||
|
||||
|
||||
@@ -14,9 +14,10 @@
|
||||
- STM32 Nucleo-144 borads require: STM32duino LwIP and STM32duino STM32Ethernet libraries
|
||||
|
||||
*/
|
||||
#if defined(ARDUINO_ARCH_STM32)
|
||||
#include <LwIP.h>
|
||||
#include <STM32Ethernet.h>
|
||||
#include "Stm32Nucleo144Prop.h"
|
||||
//#include "Stm32Nucleo144Prop.h"
|
||||
#include "ArduinoProps.h"
|
||||
#include "Stm32Millis.h"
|
||||
extern Stm32MillisClass Stm32Millis;
|
||||
@@ -119,3 +120,4 @@ void InboxMessage::run(String a) {
|
||||
prop.sendOmit(a);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
+6
-4
@@ -10,8 +10,12 @@
|
||||
#ifndef _ArduinoProps_h
|
||||
#define _ArduinoProps_h
|
||||
|
||||
#if !defined(STM32F4xx) && !defined(STM32F7xx) // tested with STM32F767
|
||||
#if defined(ARDUINO_ARCH_STM32)
|
||||
// tested with STM32F767ZI
|
||||
#include <Arduino.h>
|
||||
#include "Stm32Nucleo144Prop.h"
|
||||
|
||||
#else
|
||||
|
||||
#if defined(ARDUINO) && ARDUINO >= 100
|
||||
#include "arduino.h"
|
||||
@@ -23,9 +27,7 @@
|
||||
#include "EthernetProp.h"
|
||||
#include "WifiProp.h"
|
||||
|
||||
#else // !STM32F4xx && !STM32F7xx
|
||||
#include <Arduino.h>
|
||||
#endif // STM32F4
|
||||
#endif
|
||||
|
||||
#include "PropAction.h"
|
||||
#include "PropData.h"
|
||||
|
||||
@@ -9,6 +9,10 @@
|
||||
|
||||
#include "BridgeProp.h"
|
||||
|
||||
#if defined(ARDUINO_ARCH_STM32)
|
||||
// Don't compile Arduino Bridge library when compiling for STM32 ARCH
|
||||
#else
|
||||
|
||||
BridgeProp::BridgeProp(const char* client_id, const char* in_box, const char* out_box, const char* broker, const int port)
|
||||
: Prop(client_id, in_box, out_box, broker, port)
|
||||
{
|
||||
@@ -26,3 +30,4 @@ void BridgeProp::setBrokerIpAddress(IPAddress ip, uint16_t port)
|
||||
_client.setServer(_brokerIpAddress, port);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -9,6 +9,10 @@
|
||||
#ifndef BRIDGEPROP_H
|
||||
#define BRIDGEPROP_H
|
||||
|
||||
#if defined(ARDUINO_ARCH_STM32)
|
||||
// Don't compile Arduino Bridge library when compiling for STM32 ARCH
|
||||
#else
|
||||
|
||||
#include <BridgeClient.h>
|
||||
#include <IPAddress.h>
|
||||
#include "Prop.h"
|
||||
@@ -25,3 +29,4 @@ class BridgeProp : public Prop
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -9,6 +9,10 @@
|
||||
|
||||
#include "EthernetProp.h"
|
||||
|
||||
#if defined(ARDUINO_ARCH_STM32)
|
||||
// Don't compile Arduino Ethernet library when compiling for STM32 ARCH
|
||||
#else
|
||||
|
||||
EthernetProp::EthernetProp(const char* client_id, const char* in_box, const char* out_box, const char* broker, const int port)
|
||||
: Prop(client_id, in_box, out_box, broker, port)
|
||||
{
|
||||
@@ -19,3 +23,5 @@ void EthernetProp::begin(void(*on_message)(String))
|
||||
{
|
||||
if (on_message) onInboxMessageReceived = on_message;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
#ifndef ETHERNETPROP_H
|
||||
#define ETHERNETPROP_H
|
||||
|
||||
#if defined(ARDUINO_ARCH_STM32)
|
||||
// Don't compile Arduino Ethernet library when compiling for STM32 ARCH
|
||||
#else
|
||||
|
||||
#include <SPI.h>
|
||||
#include <Ethernet.h>
|
||||
@@ -26,3 +29,4 @@ class EthernetProp : public Prop
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+1
-2
@@ -8,7 +8,6 @@
|
||||
*/
|
||||
|
||||
#include "Prop.h"
|
||||
//#include <Process.h>
|
||||
#if defined(__AVR__)
|
||||
#include <avr/wdt.h>
|
||||
#endif
|
||||
@@ -99,7 +98,7 @@ void Prop::checkDataChanges()
|
||||
|
||||
void Prop::resetMcu()
|
||||
{
|
||||
#if defined(ARDUINO_ARCH_SAMD) || defined(STM32F4xx) || defined(STM32F7xx)
|
||||
#if defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_STM32F0) || defined(ARDUINO_ARCH_STM32F1) || defined(ARDUINO_ARCH_STM32F3) || defined(ARDUINO_ARCH_STM32F4) || defined(ARDUINO_ARCH_STM32L4) || defined(ARDUINO_ARCH_STM32F7)
|
||||
NVIC_SystemReset();
|
||||
#elif defined(ARDUINO_ARCH_AVR) || defined(__AVR__)
|
||||
wdt_enable(WDTO_15MS);
|
||||
|
||||
+4
-2
@@ -9,7 +9,9 @@
|
||||
#ifndef PROP_H
|
||||
#define PROP_H
|
||||
|
||||
#if !defined(STM32F4xx) && !defined(STM32F7xx) // tested with STM32F767
|
||||
#if defined(ARDUINO_ARCH_STM32)
|
||||
// tested with STM32F767ZI
|
||||
#else
|
||||
|
||||
#if defined(ARDUINO) && ARDUINO >= 100
|
||||
#include "arduino.h"
|
||||
@@ -19,7 +21,7 @@
|
||||
|
||||
#include <BridgeClient.h>
|
||||
|
||||
#endif // !STM32F4xx && !STM32F7xx
|
||||
#endif
|
||||
|
||||
#include <PubSubClient.h>
|
||||
#include <ListLib.h>
|
||||
|
||||
+12
-1
@@ -9,8 +9,19 @@
|
||||
|
||||
#include "PropAction.h"
|
||||
|
||||
#if defined(STM32F4xx) || defined(STM32F7xx)
|
||||
#if defined(ARDUINO_ARCH_STM32)
|
||||
// tested with STM32F767ZI
|
||||
#include <Arduino.h>
|
||||
#include "Stm32Millis.h"
|
||||
|
||||
#else
|
||||
|
||||
#if defined(ARDUINO) && ARDUINO >= 100
|
||||
#include "arduino.h"
|
||||
#else
|
||||
#include "WProgram.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
PropAction::PropAction()
|
||||
|
||||
+2
-2
@@ -6,11 +6,11 @@
|
||||
|
||||
Implement millis() missing in STM32duino.
|
||||
*/
|
||||
#if defined(STM32F4xx) || defined(STM32F7xx)
|
||||
#if defined(ARDUINO_ARCH_STM32)
|
||||
|
||||
#include "Stm32Millis.h"
|
||||
|
||||
unsigned long Stm32MillisClass::milliseconds = 0;
|
||||
Stm32MillisClass Stm32Millis;
|
||||
|
||||
#endif // STM32F4xx|STM32F7xx
|
||||
#endif
|
||||
|
||||
+2
-2
@@ -11,7 +11,7 @@
|
||||
#ifndef STM32MILLIS_H
|
||||
#define STM32MILLIS_H
|
||||
|
||||
#if defined(STM32F4xx) || defined(STM32F7xx)
|
||||
#if defined(ARDUINO_ARCH_STM32)
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
@@ -44,5 +44,5 @@ class Stm32MillisClass {
|
||||
|
||||
extern Stm32MillisClass Stm32Millis;
|
||||
|
||||
#endif // STM32F4xx|STM32F7xx
|
||||
#endif // STM32
|
||||
#endif
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
Prop for Arduino with Ethernet shield.
|
||||
*/
|
||||
#if defined(ARDUINO_ARCH_STM32)
|
||||
|
||||
#include "Stm32Nucleo144Prop.h"
|
||||
|
||||
@@ -19,3 +20,5 @@ void Stm32Nucleo144Prop::begin(void(*on_message)(String))
|
||||
{
|
||||
if (on_message) onInboxMessageReceived = on_message;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -9,6 +9,10 @@
|
||||
|
||||
#include "WifiProp.h"
|
||||
|
||||
#if defined(ARDUINO_ARCH_STM32)
|
||||
// Don't compile Arduino WiFi libraries when compiling for STM32 ARCH
|
||||
#else
|
||||
|
||||
|
||||
#if defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_SAMD_MKRVIDOR4000)
|
||||
|
||||
@@ -26,3 +30,4 @@ void WifiProp::begin(void(*on_message)(String))
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+4
-2
@@ -9,6 +9,9 @@
|
||||
#ifndef WIFIPROP_H
|
||||
#define WIFIPROP_H
|
||||
|
||||
#if defined(ARDUINO_ARCH_STM32)
|
||||
// Don't compile Arduino WiFi libraries when compiling for STM32 ARCH
|
||||
#else
|
||||
|
||||
#if defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_SAMD_MKRVIDOR4000)
|
||||
|
||||
@@ -30,6 +33,5 @@ private:
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user