对外隐藏中断头文件,普通用户无需操作中断
This commit is contained in:
parent
7429f4ce2c
commit
ce317f2fdc
|
@ -4,9 +4,6 @@
|
|||
#include "Sys.h"
|
||||
#include "Config.h"
|
||||
|
||||
/* 引脚定义 */
|
||||
#include "Platform\Pin.h"
|
||||
|
||||
#pragma pack(push)
|
||||
#pragma pack(1)
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef __CAN_H__
|
||||
#define __CAN_H__
|
||||
|
||||
#include "Platform\Pin.h"
|
||||
#include "Sys.h"
|
||||
|
||||
// CAN类
|
||||
class Can
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
#ifndef _Port_H_
|
||||
#define _Port_H_
|
||||
|
||||
#include "Core\Type.h"
|
||||
#include "Core\Delegate.h"
|
||||
|
||||
/* 引脚定义 */
|
||||
#include "Platform\Pin.h"
|
||||
#include "Sys.h"
|
||||
|
||||
#ifdef STM32F4
|
||||
#define GPIO_MAX_SPEED 100
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "Core\Type.h"
|
||||
#include "Sys.h"
|
||||
#include "Interrupt.h"
|
||||
|
||||
#include "Heap.h"
|
||||
|
|
|
@ -71,18 +71,6 @@ extern TInterrupt Interrupt;
|
|||
// 初始化函数 Interrupt.Init() 在 Sys.cpp 内 TSys::TSys() 中被调用
|
||||
// <TSys::TSys()也是构造函数 Sys.TSys()函数 在main()函数之前被执行>
|
||||
|
||||
// 智能IRQ,初始化时备份,销毁时还原
|
||||
// SmartIRQ相当霸道,它直接关闭所有中断,再也没有别的任务可以跟当前任务争夺MCU
|
||||
class SmartIRQ
|
||||
{
|
||||
public:
|
||||
SmartIRQ(bool enable = false);
|
||||
~SmartIRQ();
|
||||
|
||||
private:
|
||||
uint _state;
|
||||
};
|
||||
|
||||
// 智能锁。初始化时锁定一个整数,销毁时解锁
|
||||
class Lock
|
||||
{
|
||||
|
@ -108,26 +96,6 @@ extern "C"
|
|||
#endif
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
// 函数栈。
|
||||
// 进入函数时压栈函数名,离开时弹出。便于异常时获取主线程调用列表
|
||||
class TraceStack
|
||||
{
|
||||
public:
|
||||
TraceStack(cstring name);
|
||||
~TraceStack();
|
||||
|
||||
static void Show();
|
||||
};
|
||||
|
||||
#define TS(name) TraceStack __ts(name)
|
||||
|
||||
#else
|
||||
|
||||
#define TS(name) ((void)0)
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "Sys.h"
|
||||
|
||||
#include "Interrupt.h"
|
||||
#include "TTime.h"
|
||||
|
||||
TSys Sys;
|
||||
|
|
38
Kernel/Sys.h
38
Kernel/Sys.h
|
@ -17,6 +17,9 @@
|
|||
#include "Core\Dictionary.h"
|
||||
#include "Core\Delegate.h"
|
||||
|
||||
/* 引脚定义 */
|
||||
#include "Platform\Pin.h"
|
||||
|
||||
// 强迫内联
|
||||
#define _force_inline __attribute__( ( always_inline ) ) __INLINE
|
||||
|
||||
|
@ -155,9 +158,6 @@ public:
|
|||
ushort Checksum; // 校验
|
||||
};
|
||||
|
||||
//#include "Time.h"
|
||||
#include "Interrupt.h"
|
||||
|
||||
void EnterCritical();
|
||||
void ExitCritical();
|
||||
|
||||
|
@ -167,6 +167,38 @@ void ExitCritical();
|
|||
uint _REV(uint value);
|
||||
ushort _REV16(ushort value);
|
||||
|
||||
// 智能IRQ,初始化时备份,销毁时还原
|
||||
// SmartIRQ相当霸道,它直接关闭所有中断,再也没有别的任务可以跟当前任务争夺MCU
|
||||
class SmartIRQ
|
||||
{
|
||||
public:
|
||||
SmartIRQ(bool enable = false);
|
||||
~SmartIRQ();
|
||||
|
||||
private:
|
||||
uint _state;
|
||||
};
|
||||
|
||||
#if DEBUG
|
||||
// 函数栈。
|
||||
// 进入函数时压栈函数名,离开时弹出。便于异常时获取主线程调用列表
|
||||
class TraceStack
|
||||
{
|
||||
public:
|
||||
TraceStack(cstring name);
|
||||
~TraceStack();
|
||||
|
||||
static void Show();
|
||||
};
|
||||
|
||||
#define TS(name) TraceStack __ts(name)
|
||||
|
||||
#else
|
||||
|
||||
#define TS(name) ((void)0)
|
||||
|
||||
#endif
|
||||
|
||||
#endif //_Sys_H_
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#include "Thread.h"
|
||||
#include "Task.h"
|
||||
|
||||
//#include "Platform\stm32.h"
|
||||
#include "Interrupt.h"
|
||||
|
||||
//#define TH_DEBUG DEBUG
|
||||
#define TH_DEBUG 0
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "Sys.h"
|
||||
|
||||
//#include "Platform\stm32.h"
|
||||
#include "Interrupt.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
|
Loading…
Reference in New Issue