📄 boot.tpl
字号:
IF (C_LANGUAGE_SUPPORT)
InitCRunTime:
;-----------------------------
; clear bss segment
;-----------------------------
mov A,0
mov [__r0],<__bss_start
BssLoop:
cmp [__r0],<__bss_end
jz BssDone
mvi [__r0],A
jmp BssLoop
BssDone:
;----------------------------
; copy idata to data segment
;----------------------------
mov A,>__idata_start
mov X,<__idata_start
mov [__r0],<__data_start
IDataLoop:
cmp [__r0],<__data_end
jz IDataDone
push A
romx
mvi [__r0],A
pop A
inc X
adc A,0
jmp IDataLoop
IDataDone:
ret
ENDIF ;(C_LANGUAGE_SUPPORT)
;-----------------------------------------------------------------------------
; RAM segments for C CONST, static & global items
;-----------------------------------------------------------------------------
AREA lit
__lit_start:
AREA idata
__idata_start:
AREA func_lit
__func_lit_start:
AREA psoc_config(ROM,REL,CON)
__psoc_config_start:
AREA UserModules(ROM,REL,CON)
__usermodules_start:
AREA gpio_isr(ROM,REL,CON)
__gpio_isr_start:
;---------------------------------------------
; CODE segment for general use
;---------------------------------------------
AREA text(ROM,REL,CON)
__text_start:
;---------------------------------------------
; Begin RAM area usage
;---------------------------------------------
AREA data (RAM, REL, CON) ; initialized RAM
__data_start:
AREA virtual_registers (RAM, REL, CON) ; Temp vars of C compiler
AREA InterruptRAM (RAM, REL, CON) ; Interrupts, on Page 0
AREA bss (RAM, REL, CON) ; general use
__bss_start:
;-----------------------------------------------------------------------------
; End of the boot code
;-----------------------------------------------------------------------------
;-----------------------------------------------------------------------------
; GPIO Interrupt Service Routines
;-----------------------------------------------------------------------------
AREA gpio_isr(ROM,REL,CON)
;-----------------------------------------------------------------------------
; FUNCTION NAME: INT0_ISR
;
; DESCRIPTION: This is the ISR for the the INT0 GPIO interrupt
;
;-----------------------------------------------------------------------------
INT0_ISR:
;@PSoC_UserCode_BODY_1@ (Do not change this line.)
;---------------------------------------------------
; Insert your custom code below this banner
;---------------------------------------------------
; NOTE: interrupt service routines must preserve
; the values of the A and X CPU registers.
;---------------------------------------------------
; Insert your custom code above this banner
;---------------------------------------------------
;@PSoC_UserCode_END@ (Do not change this line.)
RETI
;-----------------------------------------------------------------------------
; FUNCTION NAME: INT1_ISR
;
; DESCRIPTION: This is the ISR for the the INT1 GPIO interrupt
;
;-----------------------------------------------------------------------------
INT1_ISR:
;@PSoC_UserCode_BODY_2@ (Do not change this line.)
;---------------------------------------------------
; Insert your custom code below this banner
;---------------------------------------------------
; NOTE: interrupt service routines must preserve
; the values of the A and X CPU registers.
;---------------------------------------------------
; Insert your custom code above this banner
;---------------------------------------------------
;@PSoC_UserCode_END@ (Do not change this line.)
RETI
;-----------------------------------------------------------------------------
; FUNCTION NAME: INT2_ISR
;
; DESCRIPTION: This is the ISR for the the INT2 GPIO interrupt
;
;-----------------------------------------------------------------------------
INT2_ISR:
;@PSoC_UserCode_BODY_3@ (Do not change this line.)
;---------------------------------------------------
; Insert your custom code below this banner
;---------------------------------------------------
; NOTE: interrupt service routines must preserve
; the values of the A and X CPU registers.
;---------------------------------------------------
; Insert your custom code above this banner
;---------------------------------------------------
;@PSoC_UserCode_END@ (Do not change this line.)
RETI
;-----------------------------------------------------------------------------
; FUNCTION NAME: PORT0_ISR
;
; DESCRIPTION: This is the ISR for the the PORT0 GPIO interrupt
; Note: Interrupts for GPIO P0.2, P0.3, and P0.4 are
; not dispatched through this ISR. Those interrupts
; are dipatched through INT0, INT1 and INT2 respectively.
;
;-----------------------------------------------------------------------------
PORT0_ISR:
;@PSoC_UserCode_BODY_4@ (Do not change this line.)
;---------------------------------------------------
; Insert your custom code below this banner
;---------------------------------------------------
; NOTE: interrupt service routines must preserve
; the values of the A and X CPU registers.
;---------------------------------------------------
; Insert your custom code above this banner
;---------------------------------------------------
;@PSoC_UserCode_END@ (Do not change this line.)
RETI
;-----------------------------------------------------------------------------
; FUNCTION NAME: PORT1_ISR
;
; DESCRIPTION: This is the ISR for the the PORT1 GPIO interrupt
;
;-----------------------------------------------------------------------------
PORT1_ISR:
;@PSoC_UserCode_BODY_5@ (Do not change this line.)
;---------------------------------------------------
; Insert your custom code below this banner
;---------------------------------------------------
; NOTE: interrupt service routines must preserve
; the values of the A and X CPU registers.
;---------------------------------------------------
; Insert your custom code above this banner
;---------------------------------------------------
;@PSoC_UserCode_END@ (Do not change this line.)
RETI
;-----------------------------------------------------------------------------
; FUNCTION NAME: PORT2_ISR
;
; DESCRIPTION: This is the ISR for the the PORT2 GPIO interrupt
;
;-----------------------------------------------------------------------------
PORT2_ISR:
;@PSoC_UserCode_BODY_5@ (Do not change this line.)
;---------------------------------------------------
; Insert your custom code below this banner
;---------------------------------------------------
; NOTE: interrupt service routines must preserve
; the values of the A and X CPU registers.
;---------------------------------------------------
; Insert your custom code above this banner
;---------------------------------------------------
;@PSoC_UserCode_END@ (Do not change this line.)
RETI
;-----------------------------------------------------------------------------
; FUNCTION NAME: PORT3_ISR
;
; DESCRIPTION: This is the ISR for the the PORT3 GPIO interrupt
;
;-----------------------------------------------------------------------------
PORT3_ISR:
;@PSoC_UserCode_BODY_6@ (Do not change this line.)
;---------------------------------------------------
; Insert your custom code below this banner
;---------------------------------------------------
; NOTE: interrupt service routines must preserve
; the values of the A and X CPU registers.
;---------------------------------------------------
; Insert your custom code above this banner
;---------------------------------------------------
;@PSoC_UserCode_END@ (Do not change this line.)
RETI
;-----------------------------------------------------------------------------
; FUNCTION NAME: PORT4_ISR
;
; DESCRIPTION: This is the ISR for the the PORT4 GPIO interrupt
;
;-----------------------------------------------------------------------------
PORT4_ISR:
;@PSoC_UserCode_BODY_7@ (Do not change this line.)
;---------------------------------------------------
; Insert your custom code below this banner
;---------------------------------------------------
; NOTE: interrupt service routines must preserve
; the values of the A and X CPU registers.
;---------------------------------------------------
; Insert your custom code above this banner
;---------------------------------------------------
;@PSoC_UserCode_END@ (Do not change this line.)
RETI
;-----------------------------------------------------------------------------
; End GPIO Interrupt Service Routines
;-----------------------------------------------------------------------------
;end of file
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -