File tree Expand file tree Collapse file tree 3 files changed +8
-11
lines changed
libraries/lwIP_Ethernet/src Expand file tree Collapse file tree 3 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -825,13 +825,12 @@ extern "C" {
825
825
return __real_ethernet_input (p, netif);
826
826
}
827
827
828
- void lwip_callback (void (*cb)(void *), void *cbData, void *buffer) {
828
+ void lwip_callback (void (*cb)(void *), void *cbData, __callback_req *buffer) {
829
829
#ifdef __FREERTOS
830
830
if (buffer) {
831
- __callback_req *req = (__callback_req *)buffer;
832
- req->cb = cb;
833
- req->cbData = cbData;
834
- __lwip (__callback, req, true );
831
+ buffer->cb = cb;
832
+ buffer->cbData = cbData;
833
+ __lwip (__callback, buffer, true );
835
834
return ;
836
835
} else if (!__isLWIPThread ()) {
837
836
__callback_req req = { cb, cbData };
Original file line number Diff line number Diff line change @@ -569,14 +569,12 @@ typedef struct {
569
569
} __ethernet_input_req;
570
570
571
571
// Run a callback in the LWIP thread (i.e. for Ethernet device polling and packet reception)
572
- // When in an interrupt, need to pass in a heap-allocated buffer (i.e. class variable) of
573
- // size LWIP_CALLBACK_BUFFER_SIZE that will be used to store the request.
574
- extern void lwip_callback (void (*cb)(void *), void *cbData, void *buffer = nullptr);
572
+ // When in an interrupt, need to pass in a heap-allocated buffer
575
573
typedef struct {
576
574
void (*cb)(void *);
577
575
void *cbData;
578
576
} __callback_req;
579
- # define LWIP_CALLBACK_BUFFER_SIZE sizeof ( __callback_req)
577
+ extern void lwip_callback ( void (*cb)( void *), void *cbData, __callback_req *buffer = nullptr);
580
578
581
579
#ifdef __cplusplus
582
580
};
Original file line number Diff line number Diff line change @@ -194,8 +194,8 @@ class LwipIntfDev: public LwipIntf, public RawDev {
194
194
err_t handlePackets ();
195
195
#ifdef __FREERTOS
196
196
SemaphoreHandle_t _hwMutex;
197
+ __callback_req _irqBuffer;
197
198
#endif
198
- uint8_t _irqBuffer[LWIP_CALLBACK_BUFFER_SIZE] __attribute__ ((aligned (4 )));;
199
199
protected:
200
200
// members
201
201
SPIClass& _spiUnit;
@@ -490,7 +490,7 @@ template<class RawDev>
490
490
void LwipIntfDev<RawDev>::_irq(void *param) {
491
491
LwipIntfDev *d = static_cast <LwipIntfDev*>(param);
492
492
ethernet_arch_lwip_gpio_mask (); // Disable other IRQs until we're done processing this one
493
- lwip_callback (_lwipCallback, param, ( void *) d->_irqBuffer );
493
+ lwip_callback (_lwipCallback, param, & d->_irqBuffer );
494
494
// ethernet_arch_lwip_begin();
495
495
// d->handlePackets();
496
496
// sys_check_timeouts();
You can’t perform that action at this time.
0 commit comments