Skip to content

Commit

Permalink
armcm_boot: Export MCU definition from armcm_boot
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin O'Connor <[email protected]>
  • Loading branch information
KevinOConnor committed Sep 18, 2019
1 parent 1c6a826 commit 9b70c05
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 16 deletions.
4 changes: 1 addition & 3 deletions src/atsam/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions src/atsamd/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions src/generic/armcm_boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions src/lpc176x/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions src/lpc176x/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions src/stm32/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9b70c05

Please sign in to comment.