rename home

This commit is contained in:
matthias@arch 2023-12-08 00:02:22 +01:00
parent c85d849ee3
commit 81feb2306c
2 changed files with 62 additions and 37 deletions

View File

@ -2,6 +2,7 @@
.code
.macro DEBUG_LED_OFF nr
pha
lda IO1 + IO::RA
.if nr = 0
and #%11111110
@ -9,9 +10,11 @@
and #%11111101
.endif
sta IO1 + IO::RA
pla
.endmacro
.macro DEBUG_LED_ON nr
pha
lda IO1 + IO::RA
.if nr = 0
ora #%00000001
@ -19,6 +22,7 @@
ora #%00000010
.endif
sta IO1 + IO::RA
pla
.endmacro
;********************************************************************************
@ -37,6 +41,7 @@ SPI_IO = IO2
; Printer
.include "programs/printer.s65"
.include "programs/print_slow.s65"
.include "programs/spi-menu.s65"
; Digital Humidity and Temerature Sensor
; .include "dht.s65"
@ -61,8 +66,8 @@ irq:
lda IO2+IO::IFR
sta IRQ_VAR
bbr7 IRQ_VAR,@irq_return
bbs1 IRQ_VAR,@irq_keypad ; check CB1
bbs2 IRQ_VAR,@irq_spi_p ; check SR
bbs1 IRQ_VAR,@irq_keypad ; check CA1
; this should never be reached
jsr lcd_clear
Print str_irq_unknown
@ -75,7 +80,7 @@ irq:
jsr kp_read_on_irq
bra @irq_return
@irq_spi_p:
jsr spi_p_read
jsr spi_p::read
bra @irq_return
; @irq_dht:
; lda IO1 + IO::T1CL ;T1L2 ; clear interrupt flag
@ -89,14 +94,15 @@ irq:
reset:
jsr lcd_init
; TODO debug stuff
stz IO2 + IO::DDRB
lda #$ff
sta IO1 + IO::DDRA
DEBUG_LED_OFF 0
DEBUG_LED_OFF 1
jsr kp_init
jsr spi_p_init
jsr kp_init
; ; INIT DHT
@ -112,48 +118,61 @@ reset:
; enable interrupts
cli
.proc return_home
Print message_menu
.endproc
bra home
.proc home
jsr rb_keypad_read
beq home
Print message_menu
; jsr rb_keypad_read
@loop:
lda _KP_DEBUG_VAL
beq @loop
; TODO debug
sta 0
stz _KP_DEBUG_VAL
lda 0
; beq home
cmp #'A'
jeq printer
cmp #'B'
jeq SPI_CODE_START
; jeq dht_request
jeq spi_menu::spi_menu
cmp #'C'
jeq print_1
cmp #'D'
jeq print_2
cmp #'0'
bne @l1
DEBUG_LED_OFF 0
jmp home
@l1:
cmp #'#'
bne @l2
DEBUG_LED_ON 0
jmp home
@l2:
cmp #'8'
bne @l3
DEBUG_LED_OFF 1
jmp home
@l3:
cmp #'9'
bne @l4
DEBUG_LED_ON 1
jmp home
@l4:
cmp #'1'
beq @debug0_on
cmp #'2'
beq @debug0_off
cmp #'4'
beq @debug1_on
cmp #'5'
beq @debug1_off
cmp #'7'
beq @print_rb
cmp #'*' ; print home menu again if not visible (message 1 and 2 jmp to home)
jeq return_home
beq home
jmp @loop
jmp home
@debug0_off:
DEBUG_LED_OFF 0
jmp @loop
@debug0_on:
DEBUG_LED_ON 0
jmp @loop
@debug1_off:
DEBUG_LED_OFF 1
jmp @loop
@debug1_on:
DEBUG_LED_ON 1
jmp @loop
@print_rb:
jsr lcd_clear
Print str_io2
lda IO2 + IO::RB
jsr lcd_char
lda #'''
jsr lcd_char
jmp @loop
.endproc
@ -181,13 +200,19 @@ message_2:
message_menu:
.byte "<A> Printer "
; .byte "<B> Temperatur "
.byte "<B> Run from SPI"
.byte "<B> SPI-Menu "
.byte "<C> Text 1 "
.asciiz "<D> Text 2 "
str_spi_begin:
.asciiz "---BEGIN SPI---"
str_spi_start:
.asciiz "---START SPI---"
str_irq:
.asciiz "IRQ detected! "
str_irq_unknown:
.asciiz "Unknown IRQ src!"
str_io2:
.asciiz "IO2::RB='"
;********************************************************************************
; reset vector

View File

@ -10,7 +10,7 @@ printer:
jsr rb_keypad_read
beq @printer_loop
cmp #'*'
jeq return_home
jeq home
jsr lcd_char
bra @printer_loop
.endif ; guard