File and macro modifications for supporting Teensy 3.1
This commit is contained in:
		
							parent
							
								
									25304734af
								
							
						
					
					
						commit
						3fa9c16c04
					
				
					 15 changed files with 190 additions and 31 deletions
				
			
		| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
/* Copyright (C) 2013 by Jacob Alexander
 | 
			
		||||
/* Copyright (C) 2013-2014 by Jacob Alexander
 | 
			
		||||
 * 
 | 
			
		||||
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 | 
			
		||||
 * of this software and associated documentation files (the "Software"), to deal
 | 
			
		||||
| 
						 | 
				
			
			@ -29,9 +29,9 @@
 | 
			
		|||
#define __INTERRUPTS_H
 | 
			
		||||
 | 
			
		||||
// ARM
 | 
			
		||||
#if defined(_mk20dx128_)
 | 
			
		||||
#if defined(_mk20dx128_) || defined(_mk20dx256_)
 | 
			
		||||
 | 
			
		||||
#include <Lib/mk20dx128.h>
 | 
			
		||||
#include <Lib/mk20dx.h>
 | 
			
		||||
 | 
			
		||||
// AVR
 | 
			
		||||
#elif defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_)
 | 
			
		||||
| 
						 | 
				
			
			@ -45,7 +45,7 @@
 | 
			
		|||
// ----- Defines -----
 | 
			
		||||
 | 
			
		||||
// ARM
 | 
			
		||||
#if defined(_mk20dx128_)
 | 
			
		||||
#if defined(_mk20dx128_) || defined(_mk20dx256_)
 | 
			
		||||
 | 
			
		||||
// Map the Interrupt Enable/Disable to the AVR names
 | 
			
		||||
#define cli() __disable_irq()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
/* Copyright (C) 2013 by Jacob Alexander
 | 
			
		||||
/* Copyright (C) 2013-2014 by Jacob Alexander
 | 
			
		||||
 * 
 | 
			
		||||
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 | 
			
		||||
 * of this software and associated documentation files (the "Software"), to deal
 | 
			
		||||
| 
						 | 
				
			
			@ -34,9 +34,9 @@
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
// ARM
 | 
			
		||||
#if defined(_mk20dx128_)
 | 
			
		||||
#if defined(_mk20dx128_) || defined(_mk20dx256_)
 | 
			
		||||
 | 
			
		||||
#include <Lib/mk20dx128.h>
 | 
			
		||||
#include <Lib/mk20dx.h>
 | 
			
		||||
#include <Lib/aliased_bitband.h>
 | 
			
		||||
#include <Lib/delay.h>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
/* Copyright (C) 2013 by Jacob Alexander
 | 
			
		||||
/* Copyright (C) 2013-2014 by Jacob Alexander
 | 
			
		||||
 * 
 | 
			
		||||
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 | 
			
		||||
 * of this software and associated documentation files (the "Software"), to deal
 | 
			
		||||
| 
						 | 
				
			
			@ -34,9 +34,9 @@
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
// ARM
 | 
			
		||||
#if defined(_mk20dx128_)
 | 
			
		||||
#if defined(_mk20dx128_) || defined(_mk20dx256_)
 | 
			
		||||
 | 
			
		||||
#include <Lib/mk20dx128.h>
 | 
			
		||||
#include <Lib/mk20dx.h>
 | 
			
		||||
#include <Lib/aliased_bitband.h>
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
/* Copyright (C) 2013 by Jacob Alexander
 | 
			
		||||
/* Copyright (C) 2013-2014 by Jacob Alexander
 | 
			
		||||
 * 
 | 
			
		||||
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 | 
			
		||||
 * of this software and associated documentation files (the "Software"), to deal
 | 
			
		||||
| 
						 | 
				
			
			@ -24,15 +24,15 @@
 | 
			
		|||
// Additional includes should only be added to this file if they should be added to *all* Scan modules.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifndef __USBLIB_H
 | 
			
		||||
#define __USBLIB_H
 | 
			
		||||
#ifndef __OUTPUTLIB_H
 | 
			
		||||
#define __OUTPUTLIB_H
 | 
			
		||||
 | 
			
		||||
// ----- Includes -----
 | 
			
		||||
 | 
			
		||||
// ARM
 | 
			
		||||
#if defined(_mk20dx128_)
 | 
			
		||||
#if defined(_mk20dx128_) || defined(_mk20dx256_)
 | 
			
		||||
 | 
			
		||||
#include <Lib/mk20dx128.h>
 | 
			
		||||
#include <Lib/mk20dx.h>
 | 
			
		||||
#include <Lib/delay.h>
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
/* Copyright (C) 2013 by Jacob Alexander
 | 
			
		||||
/* Copyright (C) 2013-2014 by Jacob Alexander
 | 
			
		||||
 * 
 | 
			
		||||
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 | 
			
		||||
 * of this software and associated documentation files (the "Software"), to deal
 | 
			
		||||
| 
						 | 
				
			
			@ -34,9 +34,9 @@
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
// ARM
 | 
			
		||||
#if defined(_mk20dx128_)
 | 
			
		||||
#if defined(_mk20dx128_) || defined(_mk20dx256_)
 | 
			
		||||
 | 
			
		||||
#include <Lib/mk20dx128.h>
 | 
			
		||||
#include <Lib/mk20dx.h>
 | 
			
		||||
#include <Lib/aliased_bitband.h>
 | 
			
		||||
#include <Lib/delay.h>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
 | 
			
		||||
#include "delay.h"
 | 
			
		||||
#include "mk20dx128.h"
 | 
			
		||||
#include "mk20dx.h"
 | 
			
		||||
 | 
			
		||||
// the systick interrupt is supposed to increment this at 1 kHz rate
 | 
			
		||||
volatile uint32_t systick_millis_count = 0;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -28,7 +28,7 @@
 | 
			
		|||
 * SOFTWARE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "mk20dx128.h"
 | 
			
		||||
#include "mk20dx.h"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
extern unsigned long _stext;
 | 
			
		||||
| 
						 | 
				
			
			@ -28,8 +28,8 @@
 | 
			
		|||
 * SOFTWARE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _mk20dx128_h_
 | 
			
		||||
#define _mk20dx128_h_
 | 
			
		||||
#ifndef _mk20dx_h_
 | 
			
		||||
#define _mk20dx_h_
 | 
			
		||||
 | 
			
		||||
//#define F_CPU 96000000
 | 
			
		||||
//#define F_CPU 48000000
 | 
			
		||||
							
								
								
									
										146
									
								
								Lib/mk20dx256.ld
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										146
									
								
								Lib/mk20dx256.ld
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,146 @@
 | 
			
		|||
/* Teensyduino Core Library
 | 
			
		||||
 * http://www.pjrc.com/teensy/
 | 
			
		||||
 * Copyright (c) 2013 PJRC.COM, LLC.
 | 
			
		||||
 *
 | 
			
		||||
 * Permission is hereby granted, free of charge, to any person obtaining
 | 
			
		||||
 * a copy of this software and associated documentation files (the
 | 
			
		||||
 * "Software"), to deal in the Software without restriction, including
 | 
			
		||||
 * without limitation the rights to use, copy, modify, merge, publish,
 | 
			
		||||
 * distribute, sublicense, and/or sell copies of the Software, and to
 | 
			
		||||
 * permit persons to whom the Software is furnished to do so, subject to
 | 
			
		||||
 * the following conditions:
 | 
			
		||||
 *
 | 
			
		||||
 * 1. The above copyright notice and this permission notice shall be 
 | 
			
		||||
 * included in all copies or substantial portions of the Software.
 | 
			
		||||
 *
 | 
			
		||||
 * 2. If the Software is incorporated into a build system that allows 
 | 
			
		||||
 * selection among a list of target devices, then similar target
 | 
			
		||||
 * devices manufactured by PJRC.COM must be included in the list of
 | 
			
		||||
 * target devices and selectable in the same manner.
 | 
			
		||||
 *
 | 
			
		||||
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 | 
			
		||||
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 | 
			
		||||
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 | 
			
		||||
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 | 
			
		||||
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 | 
			
		||||
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 | 
			
		||||
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 | 
			
		||||
 * SOFTWARE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
MEMORY
 | 
			
		||||
{
 | 
			
		||||
	FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 256K
 | 
			
		||||
	RAM  (rwx) : ORIGIN = 0x1FFF8000, LENGTH = 64K
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* INCLUDE common.ld */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Teensyduino Core Library
 | 
			
		||||
 * http://www.pjrc.com/teensy/
 | 
			
		||||
 * Copyright (c) 2013 PJRC.COM, LLC.
 | 
			
		||||
 *
 | 
			
		||||
 * Permission is hereby granted, free of charge, to any person obtaining
 | 
			
		||||
 * a copy of this software and associated documentation files (the
 | 
			
		||||
 * "Software"), to deal in the Software without restriction, including
 | 
			
		||||
 * without limitation the rights to use, copy, modify, merge, publish,
 | 
			
		||||
 * distribute, sublicense, and/or sell copies of the Software, and to
 | 
			
		||||
 * permit persons to whom the Software is furnished to do so, subject to
 | 
			
		||||
 * the following conditions:
 | 
			
		||||
 *
 | 
			
		||||
 * 1. The above copyright notice and this permission notice shall be 
 | 
			
		||||
 * included in all copies or substantial portions of the Software.
 | 
			
		||||
 *
 | 
			
		||||
 * 2. If the Software is incorporated into a build system that allows 
 | 
			
		||||
 * selection among a list of target devices, then similar target
 | 
			
		||||
 * devices manufactured by PJRC.COM must be included in the list of
 | 
			
		||||
 * target devices and selectable in the same manner.
 | 
			
		||||
 *
 | 
			
		||||
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 | 
			
		||||
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 | 
			
		||||
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 | 
			
		||||
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 | 
			
		||||
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 | 
			
		||||
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 | 
			
		||||
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 | 
			
		||||
 * SOFTWARE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
SECTIONS
 | 
			
		||||
{
 | 
			
		||||
	.text : {
 | 
			
		||||
		. = 0;
 | 
			
		||||
		KEEP(*(.vectors))
 | 
			
		||||
		*(.startup*)
 | 
			
		||||
		/* TODO: does linker detect startup overflow onto flashconfig? */
 | 
			
		||||
		. = 0x400;
 | 
			
		||||
		KEEP(*(.flashconfig*))
 | 
			
		||||
		*(.text*)
 | 
			
		||||
		*(.rodata*)
 | 
			
		||||
		. = ALIGN(4);
 | 
			
		||||
		KEEP(*(.init))
 | 
			
		||||
		. = ALIGN(4);
 | 
			
		||||
		__preinit_array_start = .;
 | 
			
		||||
		KEEP (*(.preinit_array))
 | 
			
		||||
		__preinit_array_end = .;
 | 
			
		||||
		__init_array_start = .;
 | 
			
		||||
		KEEP (*(SORT(.init_array.*)))
 | 
			
		||||
		KEEP (*(.init_array))
 | 
			
		||||
		__init_array_end = .;
 | 
			
		||||
	} > FLASH = 0xFF
 | 
			
		||||
 | 
			
		||||
	.ARM.exidx : {
 | 
			
		||||
		__exidx_start = .;
 | 
			
		||||
		*(.ARM.exidx* .gnu.linkonce.armexidx.*)
 | 
			
		||||
		__exidx_end = .;
 | 
			
		||||
	} > FLASH
 | 
			
		||||
	_etext = .;
 | 
			
		||||
 | 
			
		||||
	.usbdescriptortable (NOLOAD) : {
 | 
			
		||||
		/* . = ORIGIN(RAM); */
 | 
			
		||||
		. = ALIGN(512);
 | 
			
		||||
		*(.usbdescriptortable*)
 | 
			
		||||
	} > RAM
 | 
			
		||||
 | 
			
		||||
	.dmabuffers (NOLOAD) : {
 | 
			
		||||
		. = ALIGN(4);
 | 
			
		||||
		*(.dmabuffers*)
 | 
			
		||||
	} > RAM
 | 
			
		||||
 | 
			
		||||
	.usbbuffers (NOLOAD) : {
 | 
			
		||||
		. = ALIGN(4);
 | 
			
		||||
		*(.usbbuffers*)
 | 
			
		||||
	} > RAM
 | 
			
		||||
 | 
			
		||||
	.data : AT (_etext) {
 | 
			
		||||
		. = ALIGN(4);
 | 
			
		||||
		_sdata = .; 
 | 
			
		||||
		*(.data*)
 | 
			
		||||
		. = ALIGN(4);
 | 
			
		||||
		_edata = .; 
 | 
			
		||||
	} > RAM
 | 
			
		||||
 | 
			
		||||
	.noinit (NOLOAD) : {
 | 
			
		||||
		*(.noinit*)
 | 
			
		||||
	} > RAM
 | 
			
		||||
 | 
			
		||||
	.bss : {
 | 
			
		||||
		. = ALIGN(4);
 | 
			
		||||
		_sbss = .; 
 | 
			
		||||
		*(.bss*)
 | 
			
		||||
		*(COMMON)
 | 
			
		||||
		. = ALIGN(4);
 | 
			
		||||
		_ebss = .;
 | 
			
		||||
		__bss_end = .;
 | 
			
		||||
	} > RAM
 | 
			
		||||
 | 
			
		||||
	_estack = ORIGIN(RAM) + LENGTH(RAM);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue