From 70a18f96b6d55d23ce58ab40ffb61f172c8f6c73 Mon Sep 17 00:00:00 2001 From: xttocs Date: Mon, 21 Jun 2010 19:30:04 -0400 Subject: Support for Arduino's LiquidCrystal lib, which may help for a few other libs too. Signed-off-by: Perry Hung --- wirish/Print.h | 1 + wirish/main.cxx | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'wirish') diff --git a/wirish/Print.h b/wirish/Print.h index 72208b4..9c03978 100644 --- a/wirish/Print.h +++ b/wirish/Print.h @@ -20,6 +20,7 @@ #ifndef Print_h #define Print_h +#include #include // for size_t #define DEC 10 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) { -- cgit v1.2.3