mirror of
https://github.com/Polprzewodnikowy/SummerCart64.git
synced 2024-11-25 23:24:15 +01:00
23 lines
475 B
C
23 lines
475 B
C
#include "btldr.h"
|
|
|
|
int reset_handler (void) {
|
|
io8_t pointer = &RAM;
|
|
uint32_t length = 0;
|
|
|
|
while (!(USB_SR & USB_SR_TXE));
|
|
USB_DR = '>';
|
|
|
|
for (int i = 0; i < 4; i++) {
|
|
while (!(USB_SR & USB_SR_RXNE));
|
|
length |= (USB_DR << (i * 8));
|
|
}
|
|
|
|
while (1) {
|
|
while (!(USB_SR & USB_SR_RXNE));
|
|
*pointer++ = USB_DR;
|
|
if ((uint32_t)pointer == length) {
|
|
__asm__("call 0");
|
|
}
|
|
}
|
|
}
|