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/main.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'wirish/main.cxx') 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