aboutsummaryrefslogtreecommitdiffstats
path: root/wirish/main.cxx
diff options
context:
space:
mode:
authorxttocs <andy.g.scott@gmail.com>2010-06-21 19:30:04 -0400
committerPerry Hung <iperry@alum.mit.edu>2010-06-23 19:23:45 -0400
commit70a18f96b6d55d23ce58ab40ffb61f172c8f6c73 (patch)
tree2744db4b1bdcf6a936e881ba172dfeca8d33de78 /wirish/main.cxx
parentd7d3dfe1a9ba483047d7a9835d526f540e00c417 (diff)
downloadlibrambutan-70a18f96b6d55d23ce58ab40ffb61f172c8f6c73.tar.gz
librambutan-70a18f96b6d55d23ce58ab40ffb61f172c8f6c73.zip
Support for Arduino's LiquidCrystal lib, which may help for a few other libs too.
Signed-off-by: Perry Hung <iperry@alum.mit.edu>
Diffstat (limited to 'wirish/main.cxx')
-rw-r--r--wirish/main.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/wirish/main.cxx b/wirish/main.cxx
index d13e2eb..f0158f8 100644
--- a/wirish/main.cxx
+++ b/wirish/main.cxx
@@ -22,9 +22,14 @@
* THE SOFTWARE.
* ****************************************************************************/
+// Force init to be called *first*, i.e. before static object allocation.
+// Otherwise, statically allocated object that need libmaple may fail.
+ __attribute__(( constructor )) void premain() {
+ init();
+}
+
int main(void)
{
- init();
setup();
while (1) {