|
26 | 26 | if the interrupt changes a multi-byte variable between a sequence of instructions, it can be read incorrectly. |
27 | 27 | If your data is multiple variables, such as an array and a count, usually interrupts need to be disabled |
28 | 28 | or the entire sequence of your code which accesses the data. |
29 | | -
|
30 | | - Version: 1.1.0 |
31 | | -
|
32 | | - Version Modified By Date Comments |
33 | | - ------- ----------- ---------- ----------- |
34 | | - 1.0.0 K Hoang 12/12/2019 Initial coding |
35 | | - 1.0.1 K Hoang 13/12/2019 Add more features getPosition and getPulseWidth. Optimize. |
36 | | - 1.0.2 K Hoang 20/12/2019 Add more Blynk examples.Change example names to avoid duplication. |
37 | | - 1.1.0 K Hoang 03/01/2021 Fix bug. Add TOC and Version String. |
38 | 29 | *****************************************************************************************************************************/ |
39 | 30 |
|
40 | 31 | /**************************************************************************************************************************** |
|
78 | 69 | Experimentally, 550 and 2350 are pretty close to 0 and 180. |
79 | 70 | *****************************************************************************************************************************/ |
80 | 71 | #ifndef ESP32 |
81 | | -#error This code is designed to run on ESP32 platform, not Arduino nor ESP8266! Please check your Tools->Board setting. |
| 72 | + #error This code is designed to run on ESP32 platform, not Arduino nor ESP8266! Please check your Tools->Board setting. |
82 | 73 | #endif |
83 | 74 |
|
84 | 75 | #define TIMER_INTERRUPT_DEBUG 1 |
|
87 | 78 | // Select different ESP32 timer number (0-3) to avoid conflict |
88 | 79 | #define USE_ESP32_TIMER_NO 3 |
89 | 80 |
|
| 81 | +// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error |
90 | 82 | #include "ESP32_ISR_Servo.h" |
91 | 83 |
|
92 | 84 | //See file .../hardware/espressif/esp32/variants/(esp32|doitESP32devkitV1)/pins_arduino.h |
@@ -150,7 +142,7 @@ typedef struct |
150 | 142 |
|
151 | 143 | ISR_servo_t ISR_servo[NUM_SERVOS] = |
152 | 144 | { |
153 | | - { -1, PIN_D21 }, { -1, PIN_D22 }, { -1, PIN_D23 }, { -1, PIN_D24 }, { -1, PIN_D25 }, { -1, PIN_D26 } |
| 145 | + { -1, PIN_D1 }, { -1, PIN_D2 }, { -1, PIN_D3 }, { -1, PIN_D4 }, { -1, PIN_D5 }, { -1, PIN_D6 } |
154 | 146 | }; |
155 | 147 |
|
156 | 148 | void setup() |
|
0 commit comments