<commit_before># ATS programing on mbed [![Build Status](https://travis-ci.org/fpiot/mbed-ats.svg)](https://travis-ci.org/fpiot/mbed-ats)

## Hardware: [mbed LPC1768](http://mbed.org/platforms/mbed-LPC1768/)

[![](/img/mbed_LPC1768.jpg)](http://mbed.org/platforms/mbed-LPC1768/)

* CPU: NXP LPC1768 (ARM Cortex-M3 32-bit)
* Flash ROM: 512 KiB
* RAM: 32 KiB

Also you could get [compatible boards](http://mbed.org/platforms/Seeeduino-Arch-Pro/).

## How to build

Get your own [Debian GNU/Linux](https://www.debian.org/) PC.

Install summon-arm-toolchain.

```
$ git clone https://github.com/vedderb/summon-arm-toolchain.git
$ apt-get install flex bison libgmp3-dev libmpfr-dev libncurses5-dev \
  libmpc-dev autoconf texinfo build-essential libftdi-dev zlib1g-dev \
  git zlib1g-dev python-yaml
$ cd summon-arm-toolchain/
$ ./summon-arm-toolchain
$ export PATH=$HOME/sat/bin:$PATH
```

Install ATS2 http://www.ats-lang.org/.

```
$ sudo apt-get install libgmp-dev
$ wget http://downloads.sourceforge.net/project/ats2-lang/ats2-lang/ats2-postiats-0.0.8/ATS2-Postiats-0.0.8.tgz
$ tar xf ATS2-Postiats-0.0.8.tgz
$ cd ATS2-Postiats-0.0.8
$ ./configure
$ make
$ sudo make install
$ export PATSHOME=/usr/local/lib/ats2-postiats-0.0.8
```<commit_msg>Set up for Mac OS X<commit_after># ATS programing on mbed [![Build Status](https://travis-ci.org/fpiot/mbed-ats.svg)](https://travis-ci.org/fpiot/mbed-ats)

## Hardware: [mbed LPC1768](http://mbed.org/platforms/mbed-LPC1768/)

[![](/img/mbed_LPC1768.jpg)](http://mbed.org/platforms/mbed-LPC1768/)

* CPU: NXP LPC1768 (ARM Cortex-M3 32-bit)
* Flash ROM: 512 KiB
* RAM: 32 KiB

Also you could get [compatible boards](http://mbed.org/platforms/Seeeduino-Arch-Pro/).

## Setup environment

### [Debian GNU/Linux](https://www.debian.org/)

Install summon-arm-toolchain.

```
$ git clone https://github.com/vedderb/summon-arm-toolchain.git
$ apt-get install flex bison libgmp3-dev libmpfr-dev libncurses5-dev \
  libmpc-dev autoconf texinfo build-essential libftdi-dev zlib1g-dev \
  git zlib1g-dev python-yaml
$ cd summon-arm-toolchain/
$ ./summon-arm-toolchain
$ export PATH=$HOME/sat/bin:$PATH
```

### Mac OS X

Install gmp package.

```
$ brew install gmp
```

Install GNU toolchain from ARM Cortex-M & Cortex-R processors https://launchpad.net/gcc-arm-embedded.

```
$ wget https://launchpad.net/gcc-arm-embedded/4.8/4.8-2014-q1-update/+download/gcc-arm-none-eabi-4_8-2014q1-20140314-mac.tar.bz2
$ tar xf gcc-arm-none-eabi-4_8-2014q1-20140314-mac.tar.bz2
$ cp -a gcc-arm-none-eabi-4_8-2014q1 /usr/local/gcc-arm-none-eabi
$ export PATH=$PATH:/usr/local/gcc-arm-none-eabi/bin
$ which arm-none-eabi-gcc
/usr/local/gcc-arm-none-eabi/bin/arm-none-eabi-gcc
```

### Windows

T.B.D.


## How to build

Install ATS2 http://www.ats-lang.org/.

```
$ sudo apt-get install libgmp-dev
$ wget http://downloads.sourceforge.net/project/ats2-lang/ats2-lang/ats2-postiats-0.0.8/ATS2-Postiats-0.0.8.tgz
$ tar xf ATS2-Postiats-0.0.8.tgz
$ cd ATS2-Postiats-0.0.8
$ ./configure
$ make
$ sudo make install
$ export PATSHOME=/usr/local/lib/ats2-postiats-0.0.8
```
{'fraction_non_alphanumeric': 0.17710022705157313, 'fraction_numerical': 0.05124878365228673, 'mean_word_length': 3.7739938080495357, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6141497', 'n_tokens_mistral': 1424, 'n_tokens_neox': 1296, 'n_words': 209}