-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstartup_samd10.c
More file actions
37 lines (30 loc) · 912 Bytes
/
Copy pathstartup_samd10.c
File metadata and controls
37 lines (30 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//-----------------------------------------------------------------------------
void irq_handler_reset(void);
extern int main(void);
extern void _stack_top(void);
extern unsigned int _etext;
extern unsigned int _data;
extern unsigned int _edata;
extern unsigned int _bss;
extern unsigned int _ebss;
//-----------------------------------------------------------------------------
__attribute__ ((used, section(".vectors")))
void (* const vectors[])(void) =
{
&_stack_top, // 0 - Initial Stack Pointer Value
irq_handler_reset, // 1 - Reset
};
//-----------------------------------------------------------------------------
__attribute__ ((noinline, section(".romfunc")))
void irq_handler_reset(void)
{
unsigned int *src, *dst;
src = &_etext;
dst = &_data;
while (dst < &_edata)
*dst++ = *src++;
dst = &_bss;
while (dst < &_ebss)
*dst++ = 0;
main();
}