xref: /nrf52832-nimble/rt-thread/components/net/freemodbus/port/port.c (revision 104654410c56c573564690304ae786df310c91fc)
1*10465441SEvalZero  /*
2*10465441SEvalZero   * FreeModbus Libary: RT-Thread Port
3*10465441SEvalZero   * Copyright (C) 2013 Armink <[email protected]>
4*10465441SEvalZero   *
5*10465441SEvalZero   * This library is free software; you can redistribute it and/or
6*10465441SEvalZero   * modify it under the terms of the GNU Lesser General Public
7*10465441SEvalZero   * License as published by the Free Software Foundation; either
8*10465441SEvalZero   * version 2.1 of the License, or (at your option) any later version.
9*10465441SEvalZero   *
10*10465441SEvalZero   * This library is distributed in the hope that it will be useful,
11*10465441SEvalZero   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12*10465441SEvalZero   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13*10465441SEvalZero   * Lesser General Public License for more details.
14*10465441SEvalZero   *
15*10465441SEvalZero   * You should have received a copy of the GNU Lesser General Public
16*10465441SEvalZero   * License along with this library; if not, write to the Free Software
17*10465441SEvalZero   * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18*10465441SEvalZero   *
19*10465441SEvalZero   * File: $Id: port.c,v 1.60 2015/02/01 9:18:05 Armink $
20*10465441SEvalZero   */
21*10465441SEvalZero 
22*10465441SEvalZero /* ----------------------- System includes --------------------------------*/
23*10465441SEvalZero 
24*10465441SEvalZero /* ----------------------- Modbus includes ----------------------------------*/
25*10465441SEvalZero #include "port.h"
26*10465441SEvalZero /* ----------------------- Variables ----------------------------------------*/
27*10465441SEvalZero static rt_base_t level;
28*10465441SEvalZero /* ----------------------- Start implementation -----------------------------*/
EnterCriticalSection(void)29*10465441SEvalZero void EnterCriticalSection(void)
30*10465441SEvalZero {
31*10465441SEvalZero     level = rt_hw_interrupt_disable();
32*10465441SEvalZero }
33*10465441SEvalZero 
ExitCriticalSection(void)34*10465441SEvalZero void ExitCriticalSection(void)
35*10465441SEvalZero {
36*10465441SEvalZero     rt_hw_interrupt_enable(level);
37*10465441SEvalZero }
38*10465441SEvalZero 
39