Mike's Bootloader integrated

This commit is contained in:
bsongis
2014-05-12 19:17:28 +02:00
parent 1f87ce75bf
commit 9860bb1a46
7 changed files with 137 additions and 28 deletions
+11
View File
@@ -556,8 +556,19 @@ void i2cInit()
NVIC_EnableIRQ(TWI0_IRQn) ;
}
extern const uint8_t BootCode[];
void boardInit()
{
// TODO this is not clean, completely unuseful, but prevents the bootloader from being optimized away...
uint8_t dummy[3];
memcpy(&dummy, BootCode, sizeof(dummy));
for (unsigned int i=0; i<sizeof(dummy); i++) {
if (dummy[i] == 0) {
__asm("nop");
}
}
register Pio *pioptr ;
ResetReason = RSTC->RSTC_SR;