增加内核目录

This commit is contained in:
Stone 2016-06-13 03:24:08 +00:00
parent 771a34275a
commit 5de683990a
4 changed files with 12 additions and 10 deletions

View File

@ -2,13 +2,13 @@
#include "Port.h"
#if defined(STM32F1) || defined(STM32F4)
static const int PORT_IRQns[] = {
static const byte PORT_IRQns[] = {
EXTI0_IRQn, EXTI1_IRQn, EXTI2_IRQn, EXTI3_IRQn, EXTI4_IRQn, // 5个基础的
EXTI9_5_IRQn, EXTI9_5_IRQn, EXTI9_5_IRQn, EXTI9_5_IRQn, EXTI9_5_IRQn, // EXTI9_5
EXTI15_10_IRQn, EXTI15_10_IRQn, EXTI15_10_IRQn, EXTI15_10_IRQn, EXTI15_10_IRQn, EXTI15_10_IRQn // EXTI15_10
};
#elif defined(STM32F0) || defined(GD32F150)
static const int PORT_IRQns[] = {
static const byte PORT_IRQns[] = {
EXTI0_1_IRQn, EXTI0_1_IRQn, // 基础
EXTI2_3_IRQn, EXTI2_3_IRQn, // 基础
EXTI4_15_IRQn, EXTI4_15_IRQn, EXTI4_15_IRQn, EXTI4_15_IRQn, EXTI4_15_IRQn, EXTI4_15_IRQn,

View File

@ -391,7 +391,7 @@ void TSys::ShowInfo() const
debug_printf("Time : ");
DateTime::Now().Show(true);
debug_printf("Support: http://www.NewLifeX.com\r\n");
debug_printf("Support: http://www.WsLink.cn\r\n");
debug_printf("\r\n");
#endif

View File

@ -107,9 +107,10 @@ void TTime::Init()
// 清除标志位 必须要有!! 否则 开启中断立马中断给你看
TIM_ClearFlag(tim, TIM_FLAG_Update);
const int irqs[] = TIM_IRQns;
Interrupt.SetPriority(irqs[Index], 0);
Interrupt.Activate(irqs[Index], OnHandler, tim);
const byte irqs[] = TIM_IRQns;
byte irq = irqs[Index];
Interrupt.SetPriority(irq, 0);
Interrupt.Activate(irq, OnHandler, tim);
// 打开计数
TIM_Cmd(tim, ENABLE);

View File

@ -245,18 +245,19 @@ void Timer::SetCounter(uint cnt)
void Timer::SetHandler(bool set)
{
int irqs[] = TIM_IRQns;
const byte irqs[] = TIM_IRQns;
byte irq = irqs[_index];
if(set)
{
// 打开中断
//TIM_ITConfig((TIM_TypeDef*)_Timer, TIM_IT_Update, ENABLE);
Interrupt.SetPriority(irqs[_index], 1);
Interrupt.Activate(irqs[_index], OnHandler, this);
Interrupt.SetPriority(irq, 1);
Interrupt.Activate(irq, OnHandler, this);
}
else
{
TIM_ITConfig((TIM_TypeDef*)_Timer, TIM_IT_Update, DISABLE);
Interrupt.Deactivate(irqs[_index]);
Interrupt.Deactivate(irq);
}
}