aboutsummaryrefslogtreecommitdiffstats
path: root/src/lpc176x
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-10-24 11:07:52 -0400
committerKevin O'Connor <kevin@koconnor.net>2019-10-24 11:16:10 -0400
commitfaeaa54925e0a6fa197c48faf6317a86824f64d7 (patch)
treee8679d9af4998068d5fc721c0fc9d2f1e55145f4 /src/lpc176x
parent632ff9e55adced3f055b0926a32cff0b53a7bd0e (diff)
downloadkutter-faeaa54925e0a6fa197c48faf6317a86824f64d7.tar.gz
kutter-faeaa54925e0a6fa197c48faf6317a86824f64d7.tar.xz
kutter-faeaa54925e0a6fa197c48faf6317a86824f64d7.zip
armcm_boot: Use armcm_main() instead of main() to start board code
The main() function has a special meaning to gcc and using it can result in different code generation. Use armcm_main() to avoid that. Also, invoke SystemInit() from the board specific armcm_main() code. This gives the board code more control over board initialization. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/lpc176x')
-rw-r--r--src/lpc176x/main.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lpc176x/main.c b/src/lpc176x/main.c
index 79001e72..7f19f8c0 100644
--- a/src/lpc176x/main.c
+++ b/src/lpc176x/main.c
@@ -4,6 +4,7 @@
//
// This file may be distributed under the terms of the GNU GPLv3 license.
+#include "board/armcm_boot.h" // armcm_main
#include "internal.h" // enable_pclock
#include "sched.h" // sched_main
@@ -56,10 +57,10 @@ enable_pclock(uint32_t pclk)
}
}
-// Main entry point
-int
-main(void)
+// Main entry point - called from armcm_boot.c:ResetHandler()
+void
+armcm_main(void)
{
+ SystemInit();
sched_main();
- return 0;
}