From e873d577f701eecda3a4cd677dbcb1b83ec69427 Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Mon, 20 Feb 2017 15:06:22 +0200 Subject: [PATCH] Restructure Arduino.h a bit to help eclipse code indexer --- cores/esp32/Arduino.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/cores/esp32/Arduino.h b/cores/esp32/Arduino.h index b4dde5a8..9bf75db9 100644 --- a/cores/esp32/Arduino.h +++ b/cores/esp32/Arduino.h @@ -20,10 +20,6 @@ #ifndef Arduino_h #define Arduino_h -#ifdef __cplusplus -extern "C" { -#endif - #include #include #include @@ -105,8 +101,6 @@ extern "C" { #define _NOP() do { __asm__ volatile ("nop"); } while (0) #endif -typedef unsigned int word; - #define bit(b) (1UL << (b)) #define _BV(b) (1UL << (b)) @@ -125,14 +119,23 @@ typedef unsigned int word; typedef bool boolean; typedef uint8_t byte; +typedef unsigned int word; + +void setup(void); +void loop(void); + +long random(long, long); +void randomSeed(unsigned long); +long map(long, long, long, long, long); + +#ifdef __cplusplus +extern "C" { +#endif void init(void); void initVariant(void); void initArduino(void); -void setup(void); -void loop(void); - unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout); unsigned long pulseInLong(uint8_t pin, uint8_t state, unsigned long timeout); @@ -170,10 +173,6 @@ extern "C" void configTime(long gmtOffset_sec, int daylightOffset_sec, long random(long); #endif /* __cplusplus */ -long random(long, long); -void randomSeed(unsigned long); -long map(long, long, long, long, long); - #ifndef _GLIBCXX_VECTOR // arduino is not compatible with std::vector #define min(a,b) ((a)<(b)?(a):(b)) @@ -182,6 +181,7 @@ long map(long, long, long, long, long); #define _min(a,b) ((a)<(b)?(a):(b)) #define _max(a,b) ((a)>(b)?(a):(b)) + #include "pins_arduino.h" #endif /* _ESP32_CORE_ARDUINO_H_ */