---
title: "Critical section implementation"
url: "https://maker.wiznet.io/forum/10669"
markdown_url: "https://maker.wiznet.io/forum/10669/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "avivf"
created: "2014-11-16T15:11:00+09:00"
last_activity: "2017-05-04T08:34:22+09:00"
language: "en"
views: 892
replies: 4
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# Critical section implementation

## Question

Asked by avivf on 2014-11-16 in Ethernet Chips.

Hello,
I would lie your advice for the wizchip_cris_enter() and wizchip_cris_exit() implementation.
What should I enable/disable upon entering these funcs?

Thanks

## Replies

### Reply 1 by hjjeon0608, 2014-11-17

These functions are for enable/disable interrupt.
So, place disable interrupt function to wizchip_cris_enter and place enable interrupt function to wizchip_cris_exit.

### Reply 2 by avivf, 2014-11-17

Hi, thanks a lot for quick reply.
Can you please help me understanding what interrupts should I disable?

Are we talking about SPI TX interrupts?
(I guess SPI Rx interrupts should NOT be disabled, as the host waits for receiving answers from Wiznet.)

Please elaborate, if you can.

Thanks

### Reply 3 by hjjeon0608, 2014-11-17

Not about SPI.
Interrupt in MCU. If MCU receives interrupt signal, MCU stop current command and then jump to interrupt routine.
So, there are wizchip_cris_enter() and wizchip_cris_exit().

### Reply 4 by avivf, 2014-11-19

OK, thanks.

---

Source: https://maker.wiznet.io/forum/10669
