Skip to content

Commit 0039f23

Browse files
committed
Fix crazy dependencies.
1 parent 76a79b5 commit 0039f23

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

cores/esp8266/core_esp8266_wiring_digital.cpp

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,21 @@ typedef struct {
115115
bool functional;
116116
} interrupt_handler_t;
117117

118-
//duplicate from functionalInterrupt.h keep in sync
118+
//duplicates from functionalInterrupt.h keep in sync
119119
typedef struct InterruptInfo {
120120
uint8_t pin;
121121
uint8_t value;
122122
uint32_t micro;
123123
} InterruptInfo;
124124

125-
typedef struct {
125+
typedef struct FunctionInfo {
126+
std::function<void(void)> reqFunction;
127+
std::function<void(InterruptInfo)> reqScheduledFunction;
128+
} FunctionInfo;
129+
130+
typedef struct ArgStructure {
126131
InterruptInfo* interruptInfo;
127-
void* functionInfo;
132+
FunctionInfo* functionInfo;
128133
} ArgStructure;
129134

130135
static interrupt_handler_t interrupt_handlers[16] = { {0, 0, 0, 0}, };
@@ -172,7 +177,13 @@ void ICACHE_RAM_ATTR interrupt_handler(void*)
172177
ETS_GPIO_INTR_ENABLE();
173178
}
174179

175-
extern void cleanupFunctional(void* arg);
180+
static void cleanupFunctional(void* arg)
181+
{
182+
ArgStructure* localArg = (ArgStructure*)arg;
183+
delete (FunctionInfo*)localArg->functionInfo;
184+
delete (InterruptInfo*)localArg->interruptInfo;
185+
delete localArg;
186+
}
176187

177188
static void set_interrupt_handlers(uint8_t pin, voidFuncPtr userFunc, void* arg, uint8_t mode, bool functional)
178189
{

libraries/FunctionalInterrupt/src/FunctionalInterrupt.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,6 @@ void ICACHE_RAM_ATTR interruptFunctional(void* arg)
2323
}
2424
}
2525

26-
extern "C"
27-
{
28-
void cleanupFunctional(void* arg)
29-
{
30-
ArgStructure* localArg = (ArgStructure*)arg;
31-
delete (FunctionInfo*)localArg->functionInfo;
32-
delete (InterruptInfo*)localArg->interruptInfo;
33-
delete localArg;
34-
}
35-
}
36-
3726
void attachInterrupt(uint8_t pin, std::function<void(void)> intRoutine, int mode)
3827
{
3928
// use the local interrupt routine which takes the ArgStructure as argument

libraries/FunctionalInterrupt/src/FunctionalInterrupt.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,4 @@ struct ArgStructure {
3131
void attachInterrupt(uint8_t pin, std::function<void(void)> intRoutine, int mode);
3232
void attachScheduledInterrupt(uint8_t pin, std::function<void(InterruptInfo)> scheduledIntRoutine, int mode);
3333

34-
35-
#endif //INTERRUPTS_H
34+
#endif //FUNCTIONALINTERRUPT_H

0 commit comments

Comments
 (0)