summaryrefslogtreecommitdiffstats
path: root/app/lwip_glue.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/lwip_glue.c')
-rw-r--r--app/lwip_glue.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/app/lwip_glue.c b/app/lwip_glue.c
index 065c297..7f63ada 100644
--- a/app/lwip_glue.c
+++ b/app/lwip_glue.c
@@ -33,6 +33,30 @@ void start_lwip (void)
}
+static sys_prot_t ethernet_irq_enabled = 1;
+
+sys_prot_t sys_arch_protect (void)
+{
+ sys_prot_t ret;
+
+ nvic_disable_irq (NVIC_ETH_IRQ);
+ compiler_mb();
+
+ ret = ethernet_irq_enabled;
+ ethernet_irq_enabled = 0;
+
+ return ret;
+}
+
+void sys_arch_unprotect (sys_prot_t lev)
+{
+ if (lev) {
+ ethernet_irq_enabled = 1;
+ compiler_mb();
+ nvic_enable_irq (NVIC_ETH_IRQ);
+ }
+}
+