;**************************************************************************** ; ; MCPOCSAG v0.2.2 - Firmware for Motorola mc micro trunking radio ; for use as an Amateur-Radio transceiver ; ; Copyright (C) 2004 - 2006 Felix Erckenbrecht, DG1YFE ; ; This program is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation; either version 2 of the License, or ; any later version. ; ; This program is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with this program; if not, write to the Free Software ; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ; ; ;**************************************************************************** ;***************** ; I S R I N I T ;***************** ;************************ ; I N I T O C I I N T ;************************ init_OCI pshb psha pshx clr irq_wd_reset ; IRQ Routine darf Watchdog zurücksetzen ldd FRC addd #1994 ; etwa alle 1ms einen Int auslösen std OCR1 ldab #%1000 stab TCSR1 ; enable Output Compare Interrupt ldx #0 stx tick_ms stx tick_hms inx stx next_hms pulx pula pulb rts ;************************************ ; ; ;******* ; I S R ;******* NMI_SR ; no NMI rti ;************************************ SWI_SR ; no SWI rti ;************************************ IRQ1_SR ; no IRQ1 rti ;************************************ ICI_SR ; no ICI rti ;************************************ OCI_SR tst irq_wd_reset ; währen I2C Zugriff, bne oci_no_wd_reset ; keinen Watchdog Reset durchführen jsr watchdog_toggle ; Watchdog Reset (Pseudo I2C Zugriff) oci_no_wd_reset ldab TCSR1 ldd FRC addd #1994 std OCR1H ; in 1ms wieder einen Int ausführen ; General Purpose Timer dec gp_timer ; Universalvtimer-- ; Basis Tick Counter ldx tick_ms inx ; 1ms Tick-Counter erhöhen stx tick_ms ; 100ms Tick Counter cpx next_hms ; schon 100ms vergangen? bne oci_no_hms xgdx addd #100 ; nächsten 100ms Tick Berechnen std next_hms ; und speichern ldx tick_hms inx ; 100ms Tick Counter erhöhen stx tick_hms bsr oci_hms_timer ; Alle 100ms Timer erhöhen oci_no_hms ; LCD Timeout Timer aktualisieren ldx lcd_timer ; lcd_timer holen beq oci_no_lcd_dec ; falls lcd_timer schon =0, kein decrement mehr dex ; ansonsten lcd_timer-- stx lcd_timer ; und speichern oci_no_lcd_dec ; Squelch Timer ldab sql_timer ; sql timer holen beq oci_no_sql_dec ; falls auf 0, nicht mehr runterzaehlen decb ; ansonsten timer-- stab sql_timer ; und speichern oci_no_sql_dec ; PLL Status check jsr pll_lock_chk ; returns B=0 if PLL is NOT locked ldaa pll_locked_flag anda #$7F cba ; hat sich PLL lock Status geändert? beq oci_pll_no_chg ; Nein, dann Ende orab #$80 ; "changed" Flag setzen stab pll_locked_flag ; und mit dem aktuellen Status speichern oci_pll_no_chg rti ;************************************ ; ; 100 MS Timer (menu, pll) ; oci_hms_timer ldx m_timer ; m_timer = 0 ? beq oci_pll_timer ; Dann kein decrement dex ; m_timer -- stx m_timer ; und sichern oci_pll_timer ldab pll_timer beq oci_rc_timer decb stab pll_timer ; Roundcount Timer oci_rc_timer dec rc_timer ; rc timer-- bne oci_hms_timer_end ; falls auf 0, nicht mehr runterzaehlen ldab #10 stab rc_timer ; RC Timer auf 1sek ldd roundcount ; Rundenzähler holen std rc_last_sec ; und Anzahl der Runden der letzten Sekunde speichern clr roundcount clr roundcount+1 ; Zähler auf 0 setzen oci_hms_timer_end rts ;************************************ TOI_SR ; no TOI rti ;************************************ SIO_SR ; no SIO rti ;************************************ CMI_SR ; no CMI rti ;************************************ IRQ2_SR ; no IRQ2 rti ;************************************ TRAP_SR ; no TRAP stuff rti ;************************************