From 6675070e3620c7fa447e0adbb693970c36dffd48 Mon Sep 17 00:00:00 2001
From: Terraneo Federico <fede.tft@miosix.org>
Date: Sat, 21 Aug 2021 18:27:49 +0200
Subject: [PATCH] removed needless includes, bumped MIOSIX_SETTINGS_VERSION

---
 .../interfaces-impl/portability.cpp                 |  1 -
 miosix/arch/common/drivers/serial_atsam4l.h         |  1 -
 miosix/arch/common/drivers/serial_efm32.h           |  1 -
 miosix/arch/common/drivers/stm32_sgm.cpp            |  1 -
 miosix/arch/common/drivers/stm32_sgm.h              |  6 +-----
 .../interfaces-impl/hwmapping.h                     |  6 +-----
 .../interfaces-impl/hwmapping.h                     |  6 +-----
 miosix/config/miosix_settings.h                     | 12 ++++--------
 miosix/kernel/kernel.cpp                            |  3 +--
 miosix/kernel/kernel.h                              | 13 +++----------
 miosix/stdlib_integration/libc_integration.cpp      |  1 -
 miosix/util/util.cpp                                |  3 +--
 miosix/util/version.cpp                             |  3 +--
 13 files changed, 13 insertions(+), 44 deletions(-)

diff --git a/miosix/arch/arm7_lpc2000/lpc2138_miosix_board/interfaces-impl/portability.cpp b/miosix/arch/arm7_lpc2000/lpc2138_miosix_board/interfaces-impl/portability.cpp
index 9335dde5..2948c7f6 100644
--- a/miosix/arch/arm7_lpc2000/lpc2138_miosix_board/interfaces-impl/portability.cpp
+++ b/miosix/arch/arm7_lpc2000/lpc2138_miosix_board/interfaces-impl/portability.cpp
@@ -35,7 +35,6 @@
 #include "portability_impl.h"
 #include "kernel/scheduler/scheduler.h"
 #include "kernel/scheduler/timer_interrupt.h"
-#include "board_settings.h"
 #include <algorithm>
 
 using namespace std;
diff --git a/miosix/arch/common/drivers/serial_atsam4l.h b/miosix/arch/common/drivers/serial_atsam4l.h
index 620a7077..4fd480f5 100644
--- a/miosix/arch/common/drivers/serial_atsam4l.h
+++ b/miosix/arch/common/drivers/serial_atsam4l.h
@@ -30,7 +30,6 @@
 #include "filesystem/console/console_device.h"
 #include "kernel/sync.h"
 #include "kernel/queue.h"
-#include "board_settings.h"
 
 namespace miosix {
 
diff --git a/miosix/arch/common/drivers/serial_efm32.h b/miosix/arch/common/drivers/serial_efm32.h
index 05733eaf..7b28d25b 100644
--- a/miosix/arch/common/drivers/serial_efm32.h
+++ b/miosix/arch/common/drivers/serial_efm32.h
@@ -31,7 +31,6 @@
 #include "filesystem/console/console_device.h"
 #include "kernel/sync.h"
 #include "kernel/queue.h"
-#include "board_settings.h"
 
 namespace miosix {
 
diff --git a/miosix/arch/common/drivers/stm32_sgm.cpp b/miosix/arch/common/drivers/stm32_sgm.cpp
index 64849679..342e4543 100644
--- a/miosix/arch/common/drivers/stm32_sgm.cpp
+++ b/miosix/arch/common/drivers/stm32_sgm.cpp
@@ -25,7 +25,6 @@
  *   along with this program; if not, see <http://www.gnu.org/licenses/>   *
  ***************************************************************************/ 
 
-#include "board_settings.h"
 #include "stm32_sgm.h"
 #include <string.h>
 #include "miosix.h"
diff --git a/miosix/arch/common/drivers/stm32_sgm.h b/miosix/arch/common/drivers/stm32_sgm.h
index 10cc6dc9..d2e8db0f 100644
--- a/miosix/arch/common/drivers/stm32_sgm.h
+++ b/miosix/arch/common/drivers/stm32_sgm.h
@@ -24,8 +24,6 @@
  *   You should have received a copy of the GNU General Public License     *
  *   along with this program; if not, see <http://www.gnu.org/licenses/>   *
  ***************************************************************************/ 
- 
-#include "board_settings.h"
 
 #define PRESERVE __attribute__((section(".preserve"))) 
 
@@ -84,8 +82,6 @@ private:
     SGM();
     void readResetRegister();
     void clearResetFlag();
-
 };
 
-
-}
\ No newline at end of file
+}
diff --git a/miosix/arch/cortexM3_stm32/stm32f100c8_microboard/interfaces-impl/hwmapping.h b/miosix/arch/cortexM3_stm32/stm32f100c8_microboard/interfaces-impl/hwmapping.h
index 7205e783..cb518ed9 100644
--- a/miosix/arch/cortexM3_stm32/stm32f100c8_microboard/interfaces-impl/hwmapping.h
+++ b/miosix/arch/cortexM3_stm32/stm32f100c8_microboard/interfaces-impl/hwmapping.h
@@ -25,11 +25,9 @@
  *   along with this program; if not, see <http://www.gnu.org/licenses/>   *
  ***************************************************************************/
 
-#ifndef HWMAPPING_H
-#define	HWMAPPING_H
+#pragma once
 
 #include "interfaces/gpio.h"
-#include "board_settings.h"
 
 namespace miosix {
 
@@ -52,5 +50,3 @@ typedef Gpio<GPIOB_BASE,11> io11;
 }
 
 } //namespace miosix
-
-#endif //HWMAPPING_H
\ No newline at end of file
diff --git a/miosix/arch/cortexM3_stm32/stm32f100c8_vaisala_rs41/interfaces-impl/hwmapping.h b/miosix/arch/cortexM3_stm32/stm32f100c8_vaisala_rs41/interfaces-impl/hwmapping.h
index e2a27585..a4ef7233 100644
--- a/miosix/arch/cortexM3_stm32/stm32f100c8_vaisala_rs41/interfaces-impl/hwmapping.h
+++ b/miosix/arch/cortexM3_stm32/stm32f100c8_vaisala_rs41/interfaces-impl/hwmapping.h
@@ -25,11 +25,9 @@
  *   along with this program; if not, see <http://www.gnu.org/licenses/>   *
  ***************************************************************************/
 
-#ifndef HWMAPPING_H
-#define	HWMAPPING_H
+#pragma once
 
 #include "interfaces/gpio.h"
-#include "board_settings.h"
 
 namespace miosix {
 
@@ -87,5 +85,3 @@ namespace spi
 };
 
 } //namespace miosix
-
-#endif //HWMAPPING_H
diff --git a/miosix/config/miosix_settings.h b/miosix/config/miosix_settings.h
index 763d2a02..710ad06c 100644
--- a/miosix/config/miosix_settings.h
+++ b/miosix/config/miosix_settings.h
@@ -1,6 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015          *
- *   by Terraneo Federico                                                  *
+ *   Copyright (C) 2008-2021 by Terraneo Federico                          *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
@@ -26,8 +25,7 @@
  *   along with this program; if not, see <http://www.gnu.org/licenses/>   *
  ***************************************************************************/ 
 
-#ifndef MIOSIX_SETTINGS_H
-#define MIOSIX_SETTINGS_H
+#pragma once
 
 // Before you can compile the kernel you have to configure it by editing this
 // file. After that, comment out this line to disable the reminder error.
@@ -43,7 +41,7 @@
  * on architecture specific details. The other options are in the following
  * files which are included here:
  * miosix/arch/architecture name/common/arch_settings.h
- * miosix/arch/architecture name/board name/board_settings.h
+ * miosix/config/arch/architecture name/board name/board_settings.h
  */
 #include "arch_settings.h"
 #include "board_settings.h"
@@ -53,7 +51,7 @@
  * \internal
  * Versioning for miosix_settings.h for out of git tree projects
  */
-#define MIOSIX_SETTINGS_VERSION 100
+#define MIOSIX_SETTINGS_VERSION 300
 
 namespace miosix {
 
@@ -235,5 +233,3 @@ const unsigned int STACK_FILL=0xbbbbbbbb;
  */
 
 } //namespace miosix
-
-#endif //MIOSIX_SETTINGS_H
diff --git a/miosix/kernel/kernel.cpp b/miosix/kernel/kernel.cpp
index 570dcbf1..6584e4a7 100755
--- a/miosix/kernel/kernel.cpp
+++ b/miosix/kernel/kernel.cpp
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013 by Terraneo Federico *
+ *   Copyright (C) 2008-2021 by Terraneo Federico                          *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
@@ -31,7 +31,6 @@
 #include "interfaces/atomic_ops.h"
 #include "error.h"
 #include "logging.h"
-#include "arch_settings.h"
 #include "sync.h"
 #include "stage_2_boot.h"
 #include "process.h"
diff --git a/miosix/kernel/kernel.h b/miosix/kernel/kernel.h
index c98a8067..b29fb476 100755
--- a/miosix/kernel/kernel.h
+++ b/miosix/kernel/kernel.h
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013 by Terraneo Federico *
+ *   Copyright (C) 2008-2021 by Terraneo Federico                          *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
@@ -24,12 +24,9 @@
  *   You should have received a copy of the GNU General Public License     *
  *   along with this program; if not, see <http://www.gnu.org/licenses/>   *
  ***************************************************************************/ 
- //Miosix kernel
 
-#ifndef KERNEL_H
-#define KERNEL_H
+#pragma once
 
-//Include settings.
 #include "config/miosix_settings.h"
 #include "interfaces/portability.h"
 #include "kernel/scheduler/sched_types.h"
@@ -38,9 +35,7 @@
 #include <cstdlib>
 #include <new>
 #include <functional>
-
-// some pthread functions are friends of Thread
-#include <pthread.h>
+#include <pthread.h> // some pthread functions are friends of Thread
 
 /**
  * \namespace miosix
@@ -1100,5 +1095,3 @@ struct SleepData : public IntrusiveListItem
  */
 
 } //namespace miosix
-
-#endif //KERNEL_H
diff --git a/miosix/stdlib_integration/libc_integration.cpp b/miosix/stdlib_integration/libc_integration.cpp
index 51f8a121..09a8d742 100644
--- a/miosix/stdlib_integration/libc_integration.cpp
+++ b/miosix/stdlib_integration/libc_integration.cpp
@@ -48,7 +48,6 @@
 #include "kernel/kernel.h"
 #include "interfaces/bsp.h"
 #include "interfaces/cstimer.h"
-#include "board_settings.h"
 
 using namespace std;
 
diff --git a/miosix/util/util.cpp b/miosix/util/util.cpp
index ebf246d7..20ca4de9 100644
--- a/miosix/util/util.cpp
+++ b/miosix/util/util.cpp
@@ -34,8 +34,7 @@
 #include "util.h"
 #include "kernel/kernel.h"
 #include "stdlib_integration/libc_integration.h"
-#include "config/miosix_settings.h"
-#include "arch_settings.h" //For WATERMARK_FILL and STACK_FILL
+#include "config/miosix_settings.h" //For WATERMARK_FILL and STACK_FILL
 
 using namespace std;
 
diff --git a/miosix/util/version.cpp b/miosix/util/version.cpp
index 63e5dd40..ba684058 100644
--- a/miosix/util/version.cpp
+++ b/miosix/util/version.cpp
@@ -26,12 +26,11 @@
  ***************************************************************************/
 
 #include "config/miosix_settings.h"
-#include "board_settings.h"
 
 // These two #if are here because version checking for config files in
 // out-of-git-tree projects has to be done somewhere.
 
-#if MIOSIX_SETTINGS_VERSION != 100
+#if MIOSIX_SETTINGS_VERSION != 300
 #error You need to update miosix_settings.h to match the version in the kernel.
 #endif
 
-- 
GitLab