Critical section implementation

#1

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

#2

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.

#3

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

#4

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().

#5

OK, thanks.