                                   _         _     _      
             _ __ ___   __ _ _ __ | | ___   (_) __| | ___ 
            | '_ ` _ \ / _` | '_ \| |/ _ \  | |/ _` |/ _ \
            | | | | | | (_| | |_) | |  __/  | | (_| |  __/
            |_| |_| |_|\__,_| .__/|_|\___|  |_|\__,_|\___|
                            |_|                              
                                                by leaflabs!


maple-ide is a graphical programming environment for the Maple development
board developed by LeafLabs. It is a modified version of the popular open
source Arduino environment targeted towards the ARM Cortex-M3 microcontroller
in the Maple; the regular arduino toolchain is only targeted towards the Atmel
series of AVR microcontrollers. 

This is the source code repository for the maple-ide; if you just want to
program your Maple board you probably want to download a binary release package
for your particular platform. Binaries are linked from
http://leaflabs.com/docs/maple-ide/install/; the latest version of this
repository can be found at http://github.com/leaflabs/maple-ide/

This IDE includes a full ARM compiler toolchain ("arm-none-eabi-gcc") and a low
level library for the STM32 Cortex-M3 platform called libmaple. The toolchain
binaries are fetched from the leaflabs server as a repackaged (and sometimes
recompiled) .tar.gz of CodeSourcery's modifications to the GCC toolchain.
libmaple is developed separately and can be used straight from the command
line; it is available at: http://github.com/leaflabs/libmaple

If you are a "power hacker" just looking to modify the Maple IDE compilation
process or get at libmaple directly we strongly recommend that you check out
the alternative workflow described at
http://leaflabs.com/docs/libmaple/unix-toolchain/
 
Arduino Compatibility Disclaimer
------------------------------------------------------------------------------
We make no claims that we "preserve" any design or strategy behind Arduino,
which is why this being released as a separate branch of Arduino and not as a
patch. Arduino is clearly organized around compiling to AVR, and compiling to
ARM is a hack. In the future we hope that the Arduino compilation and upload
infrastructure will be generalized so that boards like the Maple which require
a non-AVR compiler can be developed for in the regular IDE by installing a
plugin or library.


Build Requirements
------------------------------------------------------------------------------
NOTE: there are separate requirements to actually compile and upload
      sketches using the environment; these are just the tools needed
      to build the Java user interface.

The toolchain archives for each platform are quite large and don't change
often so they are mirrored separately from this repository. The appropriate
.tar.gz file will be downloaded as part of the make.sh/dist.sh process.

Linux build requirements:
 - a reasonable development environment (tar, perl, gzip, etc)
 - A java 1.5+ environment with javac on the path 

Mac OSX build requirements:
 - Xcode? Might work without it...

Windows build requirements:
 - a cygwin build environment (see the Arduino build docs)
 - A java compiler on your PATH

Build Instructions
------------------------------------------------------------------------------

From the build/ directory, select the appropriate subdirectory based
on your target platform.  Run make.sh from within that directory.

Linux:
    $ cd build/linux
    $ ./make.sh

OS X:
    $ cd build/macosx
    $ ./make.sh

Windows (Cygwin):
    $ cd build/windows
    $ ./make.sh

After compilation, you can run the appropriate build/<platform>/run.sh
script to run the IDE.

Notes on RXTX
------------------------------------------------------------------------------
We have recompiled the RXTX Java libraries for linux so that they will detect
ACM devices. We took the rxtx-2.2pre2 source code and simply added a "ttyACM"
prefix entry everywhere we found a "ttyUSB" entry. We also disabled printer
port support (this reduces the jar file size?):

    $ ./configure  --disable-PRINTER
    $ make

Changes from stock Arduino codebase (partial?)
------------------------------------------------------------------------------
 * removed all Eclipse project cruft
 * hardware/leaflabs directory, including bootloader/ and core/
 * app/src/processing/app/Base.java: add getArmBasePath
 * app/src/processing/app/Sketch.java: imports, compiler/uploader selection
 * app/src/processing/app/Serial.java: added support for setRTS()
 * app/src/processing/app/debug/Sizer.java: don't try to size make builds
 * app/src/processing/app/debug/DFUUploader.java: new dfu-util uploader
 * app/src/processing/app/debug/Compiler.java: expose a couple methods
 * app/src/processing/app/debug/ArmCompiler.java: new, extends Compiler
 * build/macosx/dist/Arduino.app/Contents/Resources/processing.icns,
   build/shared/lib: UI skin and preferences
 * build/*/dist/*: dist files broken out into external zip downloads
 * build/*/*sh: make files are heavily modified
 * build/shared/examples/Maple: Maple-specific examples and porting
 * added a "program delay" to the preferences, delay between reset and dfu-util
   app/src/processing/app/Preferences.java
 * build/shared/reference: completely replaced for Maple

