\
\    Mecrisp-Across - A Forth cross compiler for small MSP430 microcontrollers
\    Copyright (C) 2016  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/>.
\

\ A small blinky example for a MSP430F2012 conquered by a Tiva Connected Launchpad.

new \ Das Dictionary des Crosscompilers zurücksetzen

+jtag \ Mit dem Zielchip verbinden





\ <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
    TARGET
\ <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>

: us 0 ?do i i + drop i i + drop loop inline ; \ Für 8 MHz bemessen
: ms 0 ?do 998 us loop ;

$10 constant blue
$20 constant green
$40 constant gnd
$80 constant red

: blinky ( -- )
  8MHz
  $F0 p1dir c!
  begin
    red p1out c!
    1000 ms
    
    red green or p1out c!
    1000 ms
    
    green p1out c!
    1000 ms
    
    green blue or p1out c!
    1000 ms    
    
    blue p1out c!
    1000 ms
    
    blue red or p1out c!
    1000 ms
  again
;

\ <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
    HOST
\ <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>

$FFFE vector blinky   crosscompile flashtarget -jtag run  \ Vektortabelle füllen, Einsprungpunkte definieren, Crosscompilation, Flashen des Zielchips

