;
;    Mecrisp - A native code Forth implementation for MSP430 microcontrollers
;    Copyright (C) 2011  Matthias Koch
;
;    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 3 of the License, or
;    (at your option) 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, see <http://www.gnu.org/licenses/>.
;

; Routinen für die Interrupthandler, die zur Laufzeit neu gesetzt werden können.

;------------------------------------------------------------------------------
  Wortbirne Flag_visible_inline, "dint"
;------------------------------------------------------------------------------
  dint
  ret

;------------------------------------------------------------------------------
  Wortbirne Flag_visible_inline, "eint"
;------------------------------------------------------------------------------
  eint
  ret

;------------------------------------------------------------------------------
  Wortbirne Flag_visible, "nop"
nop_vektor:
;------------------------------------------------------------------------------
  ret

;------------------------------------------------------------------------------
  Wortbirne Flag_visible|Flag_Variable, "irq-port1"
  CoreVariable irq_hook_port1
;------------------------------------------------------------------------------
  pushda #irq_hook_port1
  ret
  .word nop_vektor  ; Startwert für unbelegte Interrupts

irq_vektor_port1:
  call &irq_hook_port1
  reti

;------------------------------------------------------------------------------
  Wortbirne Flag_visible|Flag_Variable, "irq-port2"
  CoreVariable irq_hook_port2
;------------------------------------------------------------------------------
  pushda #irq_hook_port2
  ret
  .word nop_vektor  ; Startwert für unbelegte Interrupts

irq_vektor_port2:
  call &irq_hook_port2
  reti

;------------------------------------------------------------------------------
  Wortbirne Flag_visible|Flag_Variable, "irq-adc"
  CoreVariable irq_hook_adc
;------------------------------------------------------------------------------
  pushda #irq_hook_adc
  ret
  .word nop_vektor  ; Startwert für unbelegte Interrupts

irq_vektor_adc:
  call &irq_hook_adc
  reti

;------------------------------------------------------------------------------
  Wortbirne Flag_visible|Flag_Variable, "irq-timera1" ; 34 Bytes.
  CoreVariable irq_hook_timera1
;------------------------------------------------------------------------------
  pushda #irq_hook_timera1
  ret
  .word nop_vektor  ; Startwert für unbelegte Interrupts

irq_vektor_timera1:
  call &irq_hook_timera1
  reti

;------------------------------------------------------------------------------
  Wortbirne Flag_visible|Flag_Variable, "irq-timera0"
  CoreVariable irq_hook_timera0
;------------------------------------------------------------------------------
  pushda #irq_hook_timera0
  ret
  .word nop_vektor  ; Startwert für unbelegte Interrupts

irq_vektor_timera0:
  call &irq_hook_timera0
  reti

;------------------------------------------------------------------------------
  Wortbirne Flag_visible|Flag_Variable, "irq-watchdog"
  CoreVariable irq_hook_watchdog
;------------------------------------------------------------------------------
  pushda #irq_hook_watchdog
  ret
  .word nop_vektor  ; Startwert für unbelegte Interrupts

irq_vektor_watchdog:
  call &irq_hook_watchdog
  reti

;------------------------------------------------------------------------------
  Wortbirne Flag_visible|Flag_Variable, "irq-timerb1"
  CoreVariable irq_hook_timerb1
;------------------------------------------------------------------------------
  pushda #irq_hook_timerb1
  ret
  .word nop_vektor  ; Startwert für unbelegte Interrupts

irq_vektor_timerb1:
  call &irq_hook_timerb1
  reti

;------------------------------------------------------------------------------
  Wortbirne Flag_visible|Flag_Variable, "irq-timerb0"
  CoreVariable irq_hook_timerb0
;------------------------------------------------------------------------------
  pushda #irq_hook_timerb0
  ret
  .word nop_vektor  ; Startwert für unbelegte Interrupts

irq_vektor_timerb0:
  call &irq_hook_timerb0
  reti


  ; Spezialitäten für die Sonderausstattung der einzelnen Chips:

  ifdef msp430g2553 ; Nur dieser Chip hat den Komparantor !
;------------------------------------------------------------------------------
  Wortbirne Flag_visible|Flag_Variable, "irq-comp"
  CoreVariable irq_hook_comp
;------------------------------------------------------------------------------
  pushda #irq_hook_comp
  ret
  .word nop_vektor  ; Startwert für unbelegte Interrupts

irq_vektor_comp:
  call &irq_hook_comp
  reti
  endif ; msp430f2553


  ifdef msp430g2x55 ; Komparantor + dritter Timer

;------------------------------------------------------------------------------
  Wortbirne Flag_visible|Flag_Variable, "irq-comp"
  CoreVariable irq_hook_comp
;------------------------------------------------------------------------------
  pushda #irq_hook_comp
  ret
  .word nop_vektor  ; Startwert für unbelegte Interrupts

irq_vektor_comp:
  call &irq_hook_comp
  reti

;------------------------------------------------------------------------------
  Wortbirne Flag_visible|Flag_Variable, "irq-timerc1"
  CoreVariable irq_hook_timerc1
;------------------------------------------------------------------------------
  pushda #irq_hook_timerc1
  ret
  .word nop_vektor  ; Startwert für unbelegte Interrupts

irq_vektor_timerc1:
  call &irq_hook_timerc1
  reti

;------------------------------------------------------------------------------
  Wortbirne Flag_visible|Flag_Variable, "irq-timerc0"
  CoreVariable irq_hook_timerc0
;------------------------------------------------------------------------------
  pushda #irq_hook_timerc0
  ret
  .word nop_vektor  ; Startwert für unbelegte Interrupts

irq_vektor_timerc0:
  call &irq_hook_timerc0
  reti

  endif ; msp430g2955


  ifdef msp430f1612 ; +Komparantor +DAC

;------------------------------------------------------------------------------
  Wortbirne Flag_visible|Flag_Variable, "irq-comp"
  CoreVariable irq_hook_comp
;------------------------------------------------------------------------------
  pushda #irq_hook_comp
  ret
  .word nop_vektor  ; Startwert für unbelegte Interrupts

irq_vektor_comp:
  call &irq_hook_comp
  reti

;------------------------------------------------------------------------------
  Wortbirne Flag_visible|Flag_Variable, "irq-dac"
  CoreVariable irq_hook_dac
;------------------------------------------------------------------------------
  pushda #irq_hook_dac
  ret
  .word nop_vektor  ; Startwert für unbelegte Interrupts

irq_vektor_dac:
  call &irq_hook_dac
  reti

  endif ; msp430f1612
