Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keil环境下RTC demo编译问题 #14

Open
perseverance51 opened this issue Mar 8, 2023 · 1 comment
Open

Keil环境下RTC demo编译问题 #14

perseverance51 opened this issue Mar 8, 2023 · 1 comment

Comments

@perseverance51
Copy link

FwLib_STC8\FwLib_STC8\demo\rtcrtc_interrupt.c中定义的中断服务函数:
INTERRUPT(RTC_Routine, EXTI_VectRTC) { .............. }

  • 📝目前Keil各个版本的C51和C251编译器均只支持32个中断号(0~31),后面的中断需要经过添加汇编调整指令跳转实现。

🛠调整方法:

  • 🌿将中断号指向13号中断:EXTI_VectUser
    INTERRUPT(RTC_Routine, EXTI_VectUser) { .............. }
  • 🌿在fw_exti.h头文件中修改限定宏
    `
    //#if (__CONF_MCU_TYPE == 1 )
    #define EXTI_VectUser 13
    //#endif

`

  • 🌿新建Isr.asm汇编文件,内容如下:
    `
    CSEG AT 0123H ;36号RTC中断入口地址
    LJMP 006BH ;借用 13 号006BH中断的入口地址

END

`

✨以上是对该demo工程的完善,已经在STC8H8K64U B版本单片机上验证。

  • 🌴Keil项目结构树:
    `
    Project:RTC
    Target 1
    ├ Source Group 1
    + rtc_interrupt.c
    + fw_util.c
    + fw_uart.c
    + fw_sys.c
    + fw_tim.c
    - Isr.asm

`

@IOsetting
Copy link
Owner

Thank you for the bug report, I will add this fix.

IOsetting added a commit that referenced this issue Mar 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants