Skip to content

Commit

Permalink
* Updated cmsis files for KnR Coding Standards.
Browse files Browse the repository at this point in the history
  • Loading branch information
akhilpanayamparambil committed Sep 4, 2015
1 parent 0223afc commit 799d2d6
Show file tree
Hide file tree
Showing 121 changed files with 11,687 additions and 11,746 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,17 @@ OUTPUT_ARCH(arm)
SEARCH_DIR(.)

/* Memory Spaces Definitions */
MEMORY
{
rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000
}
MEMORY {
rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000
}

/* The stack size used by the application. NOTE: you need to adjust according to your application. */
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;

/* Section Definitions */
SECTIONS
{
.text :
/* Section Definitions */
SECTIONS {
.text :
{
. = ALIGN(4);
_sfixed = .;
Expand Down Expand Up @@ -66,23 +64,24 @@ SECTIONS

/* .ARM.exidx is sorted, so has to go in its own output section. */
PROVIDE_HIDDEN (__exidx_start = .);
.ARM.exidx :
.ARM.exidx :
{
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
} > rom
PROVIDE_HIDDEN (__exidx_end = .);

. = ALIGN(4);
_etext = .;

.dvectors (NOLOAD) :
{
_sdvectors = .;
. = . + 0xB0;
_edvectors = .;
} > ram

.relocate : AT (_etext)

.dvectors (NOLOAD) :
{
_sdvectors = .;
. = . + 0xB0;
_edvectors = .;
} > ram

.relocate :
AT (_etext)
{
. = ALIGN(4);
_srelocate = .;
Expand All @@ -105,12 +104,12 @@ SECTIONS
_ezero = .;
} > ram

.heap (NOLOAD) :
{
. = ALIGN(4);
__end__ = . ;
. = ORIGIN(ram) + LENGTH(ram) - STACK_SIZE;
} > ram
.heap (NOLOAD) :
{
. = ALIGN(4);
__end__ = . ;
. = ORIGIN(ram) + LENGTH(ram) - STACK_SIZE;
} > ram

/* stack section */
.stack (NOLOAD):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,17 @@ OUTPUT_ARCH(arm)
SEARCH_DIR(.)

/* Memory Spaces Definitions */
MEMORY
{
rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000
}
MEMORY {
rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000
}

/* The stack size used by the application. NOTE: you need to adjust according to your application. */
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;

/* Section Definitions */
SECTIONS
{
.text :
/* Section Definitions */
SECTIONS {
.text :
{
. = ALIGN(4);
_sfixed = .;
Expand Down Expand Up @@ -66,23 +64,24 @@ SECTIONS

/* .ARM.exidx is sorted, so has to go in its own output section. */
PROVIDE_HIDDEN (__exidx_start = .);
.ARM.exidx :
.ARM.exidx :
{
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
} > rom
PROVIDE_HIDDEN (__exidx_end = .);

. = ALIGN(4);
_etext = .;

.dvectors (NOLOAD) :
{
_sdvectors = .;
. = . + 0xB0;
_edvectors = .;
} > ram

.relocate : AT (_etext)

.dvectors (NOLOAD) :
{
_sdvectors = .;
. = . + 0xB0;
_edvectors = .;
} > ram

.relocate :
AT (_etext)
{
. = ALIGN(4);
_srelocate = .;
Expand All @@ -105,12 +104,12 @@ SECTIONS
_ezero = .;
} > ram

.heap (NOLOAD) :
{
. = ALIGN(4);
__end__ = . ;
. = ORIGIN(ram) + LENGTH(ram) - STACK_SIZE;
} > ram
.heap (NOLOAD) :
{
. = ALIGN(4);
__end__ = . ;
. = ORIGIN(ram) + LENGTH(ram) - STACK_SIZE;
} > ram

/* stack section */
.stack (NOLOAD):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@
#include "samr21.h"

typedef void (*intfunc) (void);
typedef union { intfunc __fun; void * __ptr; } intvec_elem;
typedef union {
intfunc __fun;
void * __ptr;
} intvec_elem;

void __iar_program_start(void);
int __low_level_init(void);
Expand Down Expand Up @@ -116,89 +119,89 @@ void Dummy_Handler(void);
#pragma section = ".intvec"
#pragma location = ".intvec"
const DeviceVectors __vector_table[] = {
__sfe("CSTACK"),
(void*) __iar_program_start,
(void*) NMI_Handler,
(void*) HardFault_Handler,
(void*) (0UL), /* Reserved */
(void*) (0UL), /* Reserved */
(void*) (0UL), /* Reserved */
(void*) (0UL), /* Reserved */
(void*) (0UL), /* Reserved */
(void*) (0UL), /* Reserved */
(void*) (0UL), /* Reserved */
(void*) SVC_Handler,
(void*) (0UL), /* Reserved */
(void*) (0UL), /* Reserved */
(void*) PendSV_Handler,
(void*) SysTick_Handler,

/* Configurable interrupts */
(void*) PM_Handler, /* 0 Power Manager */
(void*) SYSCTRL_Handler, /* 1 System Control */
(void*) WDT_Handler, /* 2 Watchdog Timer */
(void*) RTC_Handler, /* 3 Real-Time Counter */
(void*) EIC_Handler, /* 4 External Interrupt Controller */
(void*) NVMCTRL_Handler, /* 5 Non-Volatile Memory Controller */
(void*) DMAC_Handler, /* 6 Direct Memory Access Controller */
__sfe("CSTACK"),
(void*) __iar_program_start,
(void*) NMI_Handler,
(void*) HardFault_Handler,
(void*) (0UL), /* Reserved */
(void*) (0UL), /* Reserved */
(void*) (0UL), /* Reserved */
(void*) (0UL), /* Reserved */
(void*) (0UL), /* Reserved */
(void*) (0UL), /* Reserved */
(void*) (0UL), /* Reserved */
(void*) SVC_Handler,
(void*) (0UL), /* Reserved */
(void*) (0UL), /* Reserved */
(void*) PendSV_Handler,
(void*) SysTick_Handler,

/* Configurable interrupts */
(void*) PM_Handler, /* 0 Power Manager */
(void*) SYSCTRL_Handler, /* 1 System Control */
(void*) WDT_Handler, /* 2 Watchdog Timer */
(void*) RTC_Handler, /* 3 Real-Time Counter */
(void*) EIC_Handler, /* 4 External Interrupt Controller */
(void*) NVMCTRL_Handler, /* 5 Non-Volatile Memory Controller */
(void*) DMAC_Handler, /* 6 Direct Memory Access Controller */
#ifdef ID_USB
(void*) USB_Handler, /* 7 Universal Serial Bus */
(void*) USB_Handler, /* 7 Universal Serial Bus */
#else
(void*) (0UL), /* Reserved*/
(void*) (0UL), /* Reserved*/
#endif
(void*) EVSYS_Handler, /* 8 Event System Interface */
(void*) SERCOM0_Handler, /* 9 Serial Communication Interface 0 */
(void*) SERCOM1_Handler, /* 10 Serial Communication Interface 1 */
(void*) SERCOM2_Handler, /* 11 Serial Communication Interface 2 */
(void*) SERCOM3_Handler, /* 12 Serial Communication Interface 3 */
(void*) EVSYS_Handler, /* 8 Event System Interface */
(void*) SERCOM0_Handler, /* 9 Serial Communication Interface 0 */
(void*) SERCOM1_Handler, /* 10 Serial Communication Interface 1 */
(void*) SERCOM2_Handler, /* 11 Serial Communication Interface 2 */
(void*) SERCOM3_Handler, /* 12 Serial Communication Interface 3 */
#ifdef ID_SERCOM4
(void*) SERCOM4_Handler, /* 13 Serial Communication Interface 4 */
(void*) SERCOM4_Handler, /* 13 Serial Communication Interface 4 */
#else
(void*) (0UL), /* Reserved*/
(void*) (0UL), /* Reserved*/
#endif
#ifdef ID_SERCOM5
(void*) SERCOM5_Handler, /* 14 Serial Communication Interface 5 */
(void*) SERCOM5_Handler, /* 14 Serial Communication Interface 5 */
#else
(void*) (0UL), /* Reserved*/
#endif
(void*) TCC0_Handler, /* 15 Timer Counter Control 0 */
(void*) TCC1_Handler, /* 16 Timer Counter Control 1 */
(void*) TCC2_Handler, /* 17 Timer Counter Control 2 */
(void*) TC3_Handler, /* 18 Basic Timer Counter 0 */
(void*) TC4_Handler, /* 19 Basic Timer Counter 1 */
(void*) TC5_Handler, /* 20 Basic Timer Counter 2 */
(void*) (0UL), /* Reserved*/
#endif
(void*) TCC0_Handler, /* 15 Timer Counter Control 0 */
(void*) TCC1_Handler, /* 16 Timer Counter Control 1 */
(void*) TCC2_Handler, /* 17 Timer Counter Control 2 */
(void*) TC3_Handler, /* 18 Basic Timer Counter 0 */
(void*) TC4_Handler, /* 19 Basic Timer Counter 1 */
(void*) TC5_Handler, /* 20 Basic Timer Counter 2 */
#ifdef ID_TC6
(void*) TC6_Handler, /* 21 Basic Timer Counter 3 */
(void*) TC6_Handler, /* 21 Basic Timer Counter 3 */
#else
(void*) (0UL), /* Reserved*/
(void*) (0UL), /* Reserved*/
#endif
#ifdef ID_TC7
(void*) TC7_Handler, /* 22 Basic Timer Counter 4 */
(void*) TC7_Handler, /* 22 Basic Timer Counter 4 */
#else
(void*) (0UL), /* Reserved*/
(void*) (0UL), /* Reserved*/
#endif
#ifdef ID_ADC
(void*) ADC_Handler, /* 23 Analog Digital Converter */
(void*) ADC_Handler, /* 23 Analog Digital Converter */
#else
(void*) (0UL), /* Reserved*/
(void*) (0UL), /* Reserved*/
#endif
#ifdef ID_AC
(void*) AC_Handler, /* 24 Analog Comparators */
(void*) AC_Handler, /* 24 Analog Comparators */
#else
(void*) (0UL), /* Reserved*/
(void*) (0UL), /* Reserved*/
#endif
#ifdef ID_DAC
(void*) DAC_Handler, /* 25 Digital Analog Converter */
(void*) DAC_Handler, /* 25 Digital Analog Converter */
#else
(void*) (0UL), /* Reserved*/
(void*) (0UL), /* Reserved*/
#endif
#ifdef ID_PTC
(void*) PTC_Handler, /* 26 Peripheral Touch Controller */
(void*) PTC_Handler, /* 26 Peripheral Touch Controller */
#else
(void*) (0UL), /* Reserved*/
(void*) (0UL), /* Reserved*/
#endif
(void*) I2S_Handler, /* 27 Inter-IC Sound Interface */
(void*) (0UL), /* Reserved */
(void*) I2S_Handler, /* 27 Inter-IC Sound Interface */
(void*) (0UL), /* Reserved */
};

/**------------------------------------------------------------------------------
Expand All @@ -207,11 +210,11 @@ const DeviceVectors __vector_table[] = {
*------------------------------------------------------------------------------*/
int __low_level_init(void)
{
uint32_t *pSrc = __section_begin(".intvec");
uint32_t *pSrc = __section_begin(".intvec");

SCB->VTOR = ((uint32_t) pSrc & SCB_VTOR_TBLOFF_Msk);
SCB->VTOR = ((uint32_t) pSrc & SCB_VTOR_TBLOFF_Msk);

return 1; /* if return 0, the data sections will not be initialized */
return 1; /* if return 0, the data sections will not be initialized */
}

/**------------------------------------------------------------------------------
Expand All @@ -220,27 +223,27 @@ int __low_level_init(void)
*------------------------------------------------------------------------------*/
void Reset_Handler(void)
{
/* Change default QOS values to have the best performance and correct USB behaviour */
SBMATRIX->SFR[SBMATRIX_SLAVE_HMCRAMC0].reg = 2;
/* Change default QOS values to have the best performance and correct USB behaviour */
SBMATRIX->SFR[SBMATRIX_SLAVE_HMCRAMC0].reg = 2;
#if defined(ID_USB)
USB->DEVICE.QOSCTRL.bit.CQOS = 2;
USB->DEVICE.QOSCTRL.bit.DQOS = 2;
USB->DEVICE.QOSCTRL.bit.CQOS = 2;
USB->DEVICE.QOSCTRL.bit.DQOS = 2;
#endif
DMAC->QOSCTRL.bit.DQOS = 2;
DMAC->QOSCTRL.bit.FQOS = 2;
DMAC->QOSCTRL.bit.WRBQOS = 2;
DMAC->QOSCTRL.bit.DQOS = 2;
DMAC->QOSCTRL.bit.FQOS = 2;
DMAC->QOSCTRL.bit.WRBQOS = 2;

/* Overwriting the default value of the NVMCTRL.CTRLB.MANW bit (errata reference 13134) */
NVMCTRL->CTRLB.bit.MANW = 1;
/* Overwriting the default value of the NVMCTRL.CTRLB.MANW bit (errata reference 13134) */
NVMCTRL->CTRLB.bit.MANW = 1;

__iar_program_start();
__iar_program_start();
}

/**
* \brief Default interrupt handler for unused IRQs.
*/
void Dummy_Handler(void)
{
while (1) {
}
while (1) {
}
}
Loading

0 comments on commit 799d2d6

Please sign in to comment.