aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-09-18 11:37:48 -0400
committerKevin O'Connor <kevin@koconnor.net>2019-09-18 11:59:43 -0400
commit9b70c052ccc7e9b28e8e935ba4fccb888a4889da (patch)
treeb0e9fed7b22214ca1f6e3c1fdaebf5613e3e34ba /src
parent1c6a8267f9514ee5d02948719acab7bae4407311 (diff)
downloadkutter-9b70c052ccc7e9b28e8e935ba4fccb888a4889da.tar.gz
kutter-9b70c052ccc7e9b28e8e935ba4fccb888a4889da.tar.xz
kutter-9b70c052ccc7e9b28e8e935ba4fccb888a4889da.zip
armcm_boot: Export MCU definition from armcm_boot
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src')
-rw-r--r--src/atsam/main.c4
-rw-r--r--src/atsamd/main.c4
-rw-r--r--src/generic/armcm_boot.c5
-rw-r--r--src/lpc176x/Kconfig5
-rw-r--r--src/lpc176x/main.c6
-rw-r--r--src/stm32/main.c4
6 files changed, 12 insertions, 16 deletions
diff --git a/src/atsam/main.c b/src/atsam/main.c
index 0bb9ff83..33ee2d88 100644
--- a/src/atsam/main.c
+++ b/src/atsam/main.c
@@ -6,12 +6,10 @@
#include "board/irq.h" // irq_disable
#include "board/usb_cdc.h" // usb_request_bootloader
-#include "command.h" // DECL_CONSTANT
+#include "command.h" // DECL_COMMAND_FLAGS
#include "internal.h" // WDT
#include "sched.h" // sched_main
-DECL_CONSTANT_STR("MCU", CONFIG_MCU);
-
/****************************************************************
* watchdog handler
diff --git a/src/atsamd/main.c b/src/atsamd/main.c
index bc0a1c4c..a5b7196b 100644
--- a/src/atsamd/main.c
+++ b/src/atsamd/main.c
@@ -4,12 +4,8 @@
//
// This file may be distributed under the terms of the GNU GPLv3 license.
-#include "command.h" // DECL_CONSTANT_STR
-#include "internal.h" // NVIC_SystemReset
#include "sched.h" // sched_main
-DECL_CONSTANT_STR("MCU", CONFIG_MCU);
-
// Main entry point
int
main(void)
diff --git a/src/generic/armcm_boot.c b/src/generic/armcm_boot.c
index e11e2412..ad7461ca 100644
--- a/src/generic/armcm_boot.c
+++ b/src/generic/armcm_boot.c
@@ -5,7 +5,12 @@
// This file may be distributed under the terms of the GNU GPLv3 license.
#include "armcm_boot.h" // DECL_ARMCM_IRQ
+#include "autoconf.h" // CONFIG_MCU
#include "board/internal.h" // SystemInit
+#include "command.h" // DECL_CONSTANT_STR
+
+// Export MCU type
+DECL_CONSTANT_STR("MCU", CONFIG_MCU);
// Symbols created by armcm_link.lds.S linker script
extern uint32_t _data_start, _data_end, _data_flash;
diff --git a/src/lpc176x/Kconfig b/src/lpc176x/Kconfig
index 9c09d46e..2df9419f 100644
--- a/src/lpc176x/Kconfig
+++ b/src/lpc176x/Kconfig
@@ -23,6 +23,11 @@ choice
bool "lpc1769 (120 Mhz)"
endchoice
+config MCU
+ string
+ default "lpc1768" if MACH_LPC1768
+ default "lpc1769" if MACH_LPC1769
+
config CLOCK_FREQ
int
default 100000000 if MACH_LPC1768
diff --git a/src/lpc176x/main.c b/src/lpc176x/main.c
index 7fddde5a..79001e72 100644
--- a/src/lpc176x/main.c
+++ b/src/lpc176x/main.c
@@ -4,13 +4,9 @@
//
// This file may be distributed under the terms of the GNU GPLv3 license.
-#include "board/misc.h" // timer_read_time
-#include "command.h" // DECL_CONSTANT
-#include "internal.h" // NVIC_SystemReset
+#include "internal.h" // enable_pclock
#include "sched.h" // sched_main
-DECL_CONSTANT_STR("MCU", "lpc176x");
-
/****************************************************************
* watchdog handler
diff --git a/src/stm32/main.c b/src/stm32/main.c
index 56da9718..7c46d4b5 100644
--- a/src/stm32/main.c
+++ b/src/stm32/main.c
@@ -4,13 +4,9 @@
//
// This file may be distributed under the terms of the GNU GPLv3 license.
-#include "autoconf.h" // CONFIG_MCU
-#include "command.h" // DECL_CONSTANT_STR
#include "internal.h" // clock_setup
#include "sched.h" // sched_main
-DECL_CONSTANT_STR("MCU", CONFIG_MCU);
-
// Main entry point
int
main(void)