Move CHIP specific things to mcu/
This commit is contained in:
8
entry.c
8
entry.c
@@ -33,13 +33,17 @@
|
||||
|
||||
#ifdef HAVE_SYS_H
|
||||
#define INLINE __attribute__ ((used))
|
||||
#include "sys.h"
|
||||
#include "board.h"
|
||||
#ifdef MCU_KINETIS_L
|
||||
#include "mcu/sys-mkl27z.h"
|
||||
#else
|
||||
#include "mcu/sys-stm32.h"
|
||||
#undef STM32F10X_MD /* Prepare for high density device, too. */
|
||||
#endif
|
||||
#else
|
||||
#include "board.h"
|
||||
#if defined (MCU_KINETIS_L)
|
||||
#include "mcu/clk_gpio_init-kl.c"
|
||||
#include "mcu/clk_gpio_init-mkl27z.c"
|
||||
#else
|
||||
#include "mcu/clk_gpio_init-stm32.c"
|
||||
#endif
|
||||
|
||||
@@ -6,7 +6,12 @@ PROJECT = sample
|
||||
|
||||
CHOPSTX = ..
|
||||
LDSCRIPT= sample.ld
|
||||
CSRC = sample.c sys.c usb_kl27z.c usb-cdc.c adc_kl27z.c command.c
|
||||
CSRC = sample.c usb-cdc.c command.c
|
||||
CHIP=mkl27z
|
||||
|
||||
USE_SYS = yes
|
||||
USE_USB = yes
|
||||
USE_ADC = yes
|
||||
|
||||
###################################
|
||||
CROSS = arm-none-eabi-
|
||||
|
||||
@@ -7,8 +7,13 @@
|
||||
#include "adc.h"
|
||||
static int adc_initialized = 0;
|
||||
#endif
|
||||
#include "sys.h"
|
||||
#include "board.h"
|
||||
#ifdef MCU_KINETIS_L
|
||||
#include "mcu/sys-mkl27z.h"
|
||||
#else
|
||||
#include "mcu/sys-stm32.h"
|
||||
#undef STM32F10X_MD /* Prepare for high density device, too. */
|
||||
#endif
|
||||
|
||||
struct command_table
|
||||
{
|
||||
|
||||
@@ -29,10 +29,10 @@ SECTIONS
|
||||
KEEP(*(.sys.version))
|
||||
KEEP(*(.sys.board_info))
|
||||
KEEP(*(.sys.vectors))
|
||||
build/sys.o(.text)
|
||||
build/sys.o(.text.*)
|
||||
build/sys.o(.rodata)
|
||||
build/sys.o(.rodata.*)
|
||||
build/sys-*.o(.text)
|
||||
build/sys-*.o(.text.*)
|
||||
build/sys-*.o(.rodata)
|
||||
build/sys-*.o(.rodata.*)
|
||||
. = ALIGN(1024);
|
||||
KEEP(*(.flash_config))
|
||||
KEEP(*(.fixed_function.reset))
|
||||
|
||||
@@ -10,12 +10,6 @@
|
||||
#define ENDP6 ((uint8_t)6)
|
||||
#define ENDP7 ((uint8_t)7)
|
||||
|
||||
/* EP_TYPE[1:0] EndPoint TYPE */
|
||||
#define EP_BULK (0x0000) /* EndPoint BULK */
|
||||
#define EP_CONTROL (0x0200) /* EndPoint CONTROL */
|
||||
#define EP_ISOCHRONOUS (0x0400) /* EndPoint ISOCHRONOUS */
|
||||
#define EP_INTERRUPT (0x0600) /* EndPoint INTERRUPT */
|
||||
|
||||
enum RECIPIENT_TYPE
|
||||
{
|
||||
DEVICE_RECIPIENT, /* Recipient device */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* adc_kl27z.c - ADC driver for KL27Z
|
||||
* adc-mkl27z.c - ADC driver for MKL27Z
|
||||
* In this ADC driver, there are NeuG specific parts.
|
||||
* It only records lower 8-bit of 16-bit data.
|
||||
* You need to modify to use this as generic ADC driver.
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <chopstx.h>
|
||||
#include <mcu/kl_sim.h>
|
||||
#include <mcu/mkl27z.h>
|
||||
|
||||
struct DMAMUX {
|
||||
volatile uint32_t CHCFG0;
|
||||
@@ -26,7 +26,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <mcu/kl_sim.h>
|
||||
#include <mcu/mkl27z.h>
|
||||
|
||||
struct MCG {
|
||||
volatile uint8_t C1; /* MCG Control Register 1 */
|
||||
@@ -51,7 +51,7 @@ stack_entry[] __attribute__ ((section(".first_page.first_words"),used)) = {
|
||||
(uint32_t)reset,
|
||||
};
|
||||
|
||||
#include "mcu/clk_gpio_init-kl.c"
|
||||
#include "mcu/clk_gpio_init-mkl27z.c"
|
||||
|
||||
static void
|
||||
set_led (int on)
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* usb_kl27z.c - USB driver for KL27Z
|
||||
* usb-mkl27z.c - USB driver for MKL27Z
|
||||
*
|
||||
* Copyright (C) 2016 Flying Stone Technology
|
||||
* Author: NIIBE Yutaka <gniibe@fsij.org>
|
||||
10
rules.mk
10
rules.mk
@@ -6,6 +6,16 @@ ifneq ($(USE_EVENTFLAG),)
|
||||
CSRC += $(CHOPSTX)/eventflag.c
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SYS),)
|
||||
CSRC += $(CHOPSTX)/mcu/sys-$(CHIP).c
|
||||
endif
|
||||
ifneq ($(USE_USB),)
|
||||
CSRC += $(CHOPSTX)/mcu/usb-$(CHIP).c
|
||||
endif
|
||||
ifneq ($(USE_ADC),)
|
||||
CSRC += $(CHOPSTX)/mcu/adc-$(CHIP).c
|
||||
endif
|
||||
|
||||
INCDIR += $(CHOPSTX)
|
||||
|
||||
BUILDDIR = build
|
||||
|
||||
Reference in New Issue
Block a user