From 2acfa0ebe7a8c80e028673138a05ac548a0c9d5c Mon Sep 17 00:00:00 2001 From: Dirk Ziegelmeier Date: Sat, 6 Aug 2016 20:28:01 +0200 Subject: [PATCH] Update NO_SYS_SampleCode.c: Don't access heap in IRQ --- doc/NO_SYS_SampleCode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/NO_SYS_SampleCode.c b/doc/NO_SYS_SampleCode.c index 83d3be57..fea32d67 100644 --- a/doc/NO_SYS_SampleCode.c +++ b/doc/NO_SYS_SampleCode.c @@ -2,8 +2,8 @@ void eth_mac_irq() { /* Service MAC IRQ here */ - /* Allocate pbuf */ - struct pbuf* p = pbuf_alloc(PBUF_RAW, eth_data_count, PBUF_RAM); + /* Allocate pbuf from pool (avoid using heap in interrupts) */ + struct pbuf* p = pbuf_alloc(PBUF_RAW, eth_data_count, PBUF_POOL); if(p != NULL) { /* Copy ethernet frame into pbuf */