aboutsummaryrefslogtreecommitdiffstats
path: root/examples/spi_master.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/spi_master.cpp')
-rw-r--r--examples/spi_master.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/spi_master.cpp b/examples/spi_master.cpp
index 06cad02..9f6d81b 100644
--- a/examples/spi_master.cpp
+++ b/examples/spi_master.cpp
@@ -60,12 +60,13 @@ void loop() {
}
// Force init to be called *first*, i.e. before static object allocation.
-// Otherwise, statically allocated objects that need libmaple may fail.
-__attribute__((constructor)) void premain() {
+// Otherwise, statically allocated object that need libmaple may fail.
+ __attribute__(( constructor )) void premain() {
init();
}
-int main(void) {
+int main(void)
+{
setup();
while (1) {