|
|
|
|
|
|
|
|
__enable_irq(); |
|
|
__enable_irq(); |
|
|
|
|
|
|
|
|
_init_Teensyduino_internal_(); |
|
|
_init_Teensyduino_internal_(); |
|
|
if (RTC_SR & RTC_SR_TIF) rtc_set(TIME_T); |
|
|
|
|
|
|
|
|
if (RTC_SR & RTC_SR_TIF) { |
|
|
|
|
|
// TODO: this should probably set the time more agressively, if |
|
|
|
|
|
// we could reliably detect the first reboot after programming. |
|
|
|
|
|
rtc_set(TIME_T); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
__libc_init_array(); |
|
|
__libc_init_array(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (1) ; |
|
|
while (1) ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// TODO: is this needed for c++ and where does it come from? |
|
|
|
|
|
/* |
|
|
|
|
|
void _init(void) |
|
|
|
|
|
{ |
|
|
|
|
|
} |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
char *__brkval = (char *)&_ebss; |
|
|
char *__brkval = (char *)&_ebss; |
|
|
|
|
|
|
|
|
void * _sbrk(int incr) |
|
|
void * _sbrk(int incr) |
|
|
{ |
|
|
{ |
|
|
//static char *heap_end = (char *)&_ebss; |
|
|
|
|
|
//char *prev = heap_end; |
|
|
|
|
|
//heap_end += incr; |
|
|
|
|
|
|
|
|
|
|
|
char *prev = __brkval; |
|
|
char *prev = __brkval; |
|
|
__brkval += incr; |
|
|
__brkval += incr; |
|
|
return prev; |
|
|
return prev; |
|
|
|
|
|
|
|
|
return 0; |
|
|
return 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/* moved to Print.cpp, to support Print::printf() |
|
|
|
|
|
__attribute__((weak)) |
|
|
|
|
|
int _write(int file, char *ptr, int len) |
|
|
|
|
|
{ |
|
|
|
|
|
return 0; |
|
|
|
|
|
} |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
__attribute__((weak)) |
|
|
__attribute__((weak)) |
|
|
int _close(int fd) |
|
|
int _close(int fd) |
|
|
{ |
|
|
{ |