Merge pull request #45 from guoweilkd/guoweilkd

Update port.c
This commit is contained in:
朱天龙 (Armink) 2019-06-18 15:00:01 +08:00 committed by GitHub
commit 49375ebf5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -24,15 +24,15 @@
/* ----------------------- Modbus includes ----------------------------------*/ /* ----------------------- Modbus includes ----------------------------------*/
#include "port.h" #include "port.h"
/* ----------------------- Variables ----------------------------------------*/ /* ----------------------- Variables ----------------------------------------*/
static rt_base_t level;
/* ----------------------- Start implementation -----------------------------*/ /* ----------------------- Start implementation -----------------------------*/
void EnterCriticalSection(void) void EnterCriticalSection(void)
{ {
level = rt_hw_interrupt_disable(); rt_enter_critical();
} }
void ExitCriticalSection(void) void ExitCriticalSection(void)
{ {
rt_hw_interrupt_enable(level); rt_exit_critical();
} }