aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2011-02-27 11:42:56 -0500
committerMarti Bolivar <mbolivar@leaflabs.com>2011-02-27 11:42:56 -0500
commit076f42c1650f78797d8fba59b375d28bd26dea82 (patch)
treea78267bebee601f781bb6fbbb2c892491cd04940
parent01c3eb389e314b4363eb670940b5bf7978b1678e (diff)
downloadlibrambutan-076f42c1650f78797d8fba59b375d28bd26dea82.tar.gz
librambutan-076f42c1650f78797d8fba59b375d28bd26dea82.zip
Cleaned out libmaple.h; this had wide-ranging implications.
Many of the #defines in libmaple.h were board-specific, not MCU-specific. Most of these were only used by code under libmaple/usb/. These were moved into usb_config.h, and are clearly marked as being terrible hacks. I'm going to treat the USB stack as a black box that we'll deal with later. Further, instead of having a variety of #defines like "How many USARTS do I have?", we decide that based on the density of the chip. This is determined by testing for STM32_MEDIUM_DENSITY or STM32_HIGH_DENSITY defines. libmaple currently doesn't support low-density chips, so that suffices. The Makefile will set these automatically based on the MCU. Other offending #defines are ERROR_LED_PORT and ERROR_LED_PIN; these were made optional, but they're set in the Makefile as a hack to keep things working.
-rw-r--r--source/language.rst57
1 files changed, 27 insertions, 30 deletions
diff --git a/source/language.rst b/source/language.rst
index 2ebe03c..b2f4650 100644
--- a/source/language.rst
+++ b/source/language.rst
@@ -17,36 +17,6 @@ language and C++ may wish to skip to the
.. contents:: Contents
:local:
-Unique Maple Additions
-----------------------
-
-.. _language-assert:
-
-``ASSERT(...)``
- The ``ASSERT()`` function can be very useful for basic program
- debugging. The function accepts a boolean; for example::
-
- ASSERT(state == WAIT);
-
- zero is false and any other number is true. If the boolean is true
- the assertion passes and the program continues as usual. If it is
- false, the assertion fails: the program is halted, debug
- information is printed to USART2, and the status LED begins to
- throb in intensity (it's noticeably different from blinking). The
- debug information is printed at 9600 baud and consists of the
- filename and line number where the particular assertion failed.
-
- Including assertions in a program increases the program size. When
- using libmaple **from the command line only**, they can be
- disabled by making the definition ::
-
- #define DEBUG_LEVEL DEBUG_NONE
-
- before including either wirish.h or libmaple.h. In this case, all
- assertions will pass without any lost clock cycles. Note that
- this will **not work in the IDE**; even with this definition,
- assertions will still be enabled.
-
.. _language-lang-docs:
Maple Language Reference
@@ -217,6 +187,33 @@ A more exhaustive index is available at the :ref:`language-index`.
| | | |
+--------------------------------------------+----------------------------------------------+---------------------------------------------------+
+``ASSERT(...)``
+---------------
+
+The ``ASSERT()`` function can be very useful for basic program
+debugging. The function accepts a boolean; for example::
+
+ ASSERT(state == WAIT);
+
+Zero is false and any other number is true. If the boolean is true, the
+assertion passes and the program continues as usual. If it is false,
+the assertion fails: the program is halted, debug information is
+printed to USART2, and the status LED begins to throb in intensity
+(it's noticeably different from blinking). The debug information is
+printed at 9600 baud and consists of the filename and line number
+where the particular assertion failed.
+
+Including assertions in a program increases the program size. When
+using libmaple **from the command line only**, they can be disabled by
+making the definition ::
+
+ #define DEBUG_LEVEL DEBUG_NONE
+
+before including either wirish.h or libmaple.h. In this case, all
+assertions will pass without any lost clock cycles. Note that this
+will **not work in the IDE**; even with this definition, assertions
+will still be enabled.
+
.. _language-missing-features:
Missing Arduino Features