⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 buttonhandler.asm

📁 RFID功能中阅读器源代码,实现汽车的无钥匙进入功能
💻 ASM
字号:
#include Project.inc
#include PIC16F639.inc

#define Delay_Repeat_Trans    0x03
#define Repeat_Trans_Counter  0x03
Button_Handler_VAR udata
Counter res 1

    code
------------------------------------------------------------
;Button_Handler_Init用来初始化在Button_Handler中用到的寄存器
------------------------------------------------------------
Button_Handler_Init
    banksel Counter
    clrf Counter
    clrf Button_Delay
    return
------------------------------------------------------------;每一个开锁、关锁信号要传送Repeat_Trans_Counter次,相邻两次传送之间要延时Delay_Repeat_Trans*Timer1长时间
------------------------------------------------------------
Button_Handler
    banksel  Counter
    movf Counter,f
    btfss STATUS,Z
    goto Button_Count
    movlw Repeat_Trans_Counter
    movwf Counter
    movlw Delay_Repeat_Trans
    movwf Button_Delay
Button_Count
    btfss EVENT_REG,RF_Start
    goto End_Button_Handler
    decfsz Counter,f
    goto Button_Task_Disper
    movlw 0xCf
    andwf EVENT_REG,f;当已经传送完毕,清除所有的按键事件
    goto End_Button_Handler
Button_Task_Disper
    movlw Delay_Repeat_Trans
    movwf Button_Delay
    bcf EVENT_REG,RF_Start

LOCK_Button
    btfss EVENT_REG,LOCK
    goto UNLOCK_Button
    call RF_Send_Header

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -