IOsetting / FwLib_STC8

A lite firmware library for STC8G/STC8H series MCU
Apache License 2.0
122 stars 32 forks source link

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

Open perseverance51 opened 1 year ago

perseverance51 commented 1 year ago

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

`

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 commented 1 year ago

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