PROGRAMS= program
OBJS_program= vectors.o panic.o routines-led.o i2clib.o \
misc.o detect.o variables.o points.o \
- syncwrite.o reverse.o
+ syncwrite.o reverse.o nmra-stream.o
XCODEN_program= morse
XCODE1_program= blank2 ours+pindata
include panic.inc
include morse+auto.inc
include ../iwjpictest/insn-aliases.inc
-clock equ -1
include ../iwjpictest/clockvaries.inc
include variables+vars.inc
include pindata.inc
- extern test_sofar_slave_startup_hook
- extern trackpower_decide
- extern serial_interrupt
-
include vectors.fin
include i2clib.inc
include panic.fin
include program.fin
include nmra-stream.fin
include power.fin
+ include mascan.fin
end
--- /dev/null
+;======================================================================
+; MASTER - SCANNING ETC.
+
+;----------
+i2cm_intrl
+; handles i2c interrupt using i2cm_interrupt[_definite],
+; according to the rules for <something>_intrl.
+ bt_f_if0 PIR1, SSPIF
+ return
+ call i2cm_interrupt_definite
+ intrl_handled_nostack
+
+;--------------------
+i2cmu_done
+i2cmu_read_got_byte
+i2cmu_write_next_byte
+ panic morse_UI
--- /dev/null
+ extern i2cm_intrl
UL
UM
UE
+UC
+UI
# Messages for i2clib, S*
SM i2clib:st,:sspstat,:sspcon1,:sspcon2 ; m.,i., ctrlr bad state
movlw_movwf_spbrg
mov_lw ~((1<<RCIP) | (1<<TXIP))
- and_wf IPR1 ; serial interrupts: low priority
+ and_wff IPR1 ; serial interrupts: low priority
mov_lw (1<<RCIE) | (1<<TXIE)
- ior_wf PIE1 ; serial interrupt: interrupt enable
+ ior_wff PIE1 ; serial interrupt: interrupt enable
return
;****************************************************************************
nmra_serialrx_intrl
- bt_f_if0 PIR1,5,0 ; check whether serial recv interrupt bit set
+ bt_f_if0 PIR1,RCIF ; check whether serial recv interrupt bit set
return
-fixme need to check both interrupt handlers here and look for refies too
-
; serial_receive:
; debug 'h' ; write 'h' to serial port
bra serial_receive_done
;****************************************************************************
- fixme reviewed up to here for inclusion in bigger program
master_interrupt_high
- bt_f_if0 INTCON,2,0 ; check whether timer0 interrupt set
+ bt_f_if0 INTCON,TMR0IF ; check whether timer0 interrupt set
bra master_interrupt_high_notnmra
; timer0 interrupt
debug ',' ; write 'j' to serial port
- bc_fa INTCON,2 ; clear interrupt-set bit
+ bc_fa INTCON,TMR0IF ; clear interrupt-set bit
ifdef SLOW_VERSION
mov_lw 0x01 ; (testing)
call idlocs_init
- tst_f_ifnz picno
+ bt_f_if0 idloc1,idloc1_master
call slave_init
- tst_f_ifz picno
+ bt_f_if1 idloc1,idloc1_master
call master_init
bs_f INTCON, GIEH
goto backgroundloop_reversers
;----------
-general_local_init
+common_local_init
; called by {master,slave}_init immediately after they've init'd i2c.
clr_f PCLATU
call bitnum2bit_init
call detect_local_init
return
-;----------
-i2cm_intrl
-; handles i2c interrupt using i2cm_interrupt[_definite],
-; according to the rules for <something>_intrl.
- bt_f_if0 PIR1, SSPIF
- return
- call i2cm_interrupt_definite
- intrl_handled_nostack
+;----------------------------------------
+panic_kill_hook
;----------
intrl_handled_routine
;--------------------
command_ping
+command_power
+command_point
+command_crashed
panic morse_UC
- code
+code2 code
;======================================================================
; SLAVE
- extern i2cm_intrl
+ extern serialrx_generalmsg
extern message_for_master
+ extern master_interrupt_high_notnmra