打印
[MCU]

Hercules DIY 五:对中断的疑感

[复制链接]
489|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
laocuo1142|  楼主 | 2020-11-12 17:14 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Hercules DIY 五:对中断的疑感                                按照计划这周应是解决程序,由于我的项目是报警器我想用管脚中断最好,但是我找遍了例程,也没看到一个中断的例程。

而我想让管脚中断,在HAL里已经设完并生成代码。但我用仿真无论如何也进入不了中断。而且生产的中断函数的定义让我感到疑感

我的主函数如下:

/* Include Files */

#include "sys_common.h"
#include "system.h"

/* USER CODE BEGIN (1) */

/* USER CODE BEGIN (1) */
#include "gio.h"
#include "het.h"
/* USER CODE END */


/** @fn void main(void)
*   @brief Application main function
*   @NOTE This function is empty by default.
*
*   This function is called after startup.
*   The user can use this function to implement the application.
*/

/* USER CODE BEGIN (2) */
/* USER CODE END */

void main(void)
{
/* USER CODE BEGIN (3) */
    gioInit();
   
    gioEnableNotification(1);
     _enable_IRQ();

    while(1);

/* USER CODE END */
}


生成的中断函数如下:

/** @file notification.c
*   @brief User Notification Definition File
*   @date 15.Aug.2012
*   @version 03.01.02
*
*   This file  defines  empty  notification  routines to avoid
*   linker errors, Driver expects user to define the notification.
*   The user needs to either remove this file and use their custom
*   notification function or place their code sequence in this file
*   between the provided USER CODE BEGIN and USER CODE END.
*
*/

/* Include Files */

#include "esm.h"
#include "gio.h"
#include "het.h"

/* USER CODE BEGIN (0) */
/* USER CODE END */

void esmGroup1Notification(uint32_t channel)
{
/*  enter user code between the USER CODE BEGIN and USER CODE END. */
/* USER CODE BEGIN (1) */
/* USER CODE END */
}

/* USER CODE BEGIN (2) */
/* USER CODE END */

void esmGroup2Notification(uint32_t channel)
{
/*  enter user code between the USER CODE BEGIN and USER CODE END. */
/* USER CODE BEGIN (3) */
/* USER CODE END */
}

/* USER CODE BEGIN (4) */
/* USER CODE END */
void gioNotification(int bit)
{
/*  enter user code between the USER CODE BEGIN and USER CODE END. */
/* USER CODE BEGIN (13) */
    return;
/* USER CODE END */
}

/* USER CODE BEGIN (14) */
/* USER CODE END */
void pwmNotification(unsigned pwm, unsigned notification)
{
/*  enter user code between the USER CODE BEGIN and USER CODE END. */
/* USER CODE BEGIN (23) */
/* USER CODE END */
}

/* USER CODE BEGIN (24) */
/* USER CODE END */

void edgeNotification(unsigned edge)
{
/*  enter user code between the USER CODE BEGIN and USER CODE END. */
/* USER CODE BEGIN (25) */
    return;
/* USER CODE END */
}

/* USER CODE BEGIN (26) */
/* USER CODE END */

void hetNotification(hetBASE_t *het, uint32_t offset)
{
/*  enter user code between the USER CODE BEGIN and USER CODE END. */
/* USER CODE BEGIN (27) */
    return;
/* USER CODE END */
}

/* USER CODE BEGIN (28) */
/* USER CODE END */

/* USER CODE BEGIN (29) */
/* USER CODE END */

我在中断函数里打个断点但无论如何也进不去。大家遇到过中断的问题么???                           


这个后来解决了,确实是因为图形配置时没有配全。

使用特权

评论回复

相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

1171

主题

5128

帖子

12

粉丝