mirror of
https://github.com/mist-devel/mist-firmware.git
synced 2026-04-29 05:26:02 +00:00
Properly re-initialize firmware when core loaded by USB Blaster (with DIP SW1=OFF).
This commit is contained in:
@@ -26,8 +26,8 @@
|
||||
MEMORY
|
||||
{
|
||||
FLASH (rx) : ORIGIN = 0x00100000, LENGTH = 0x00040000
|
||||
DATA (rw) : ORIGIN = 0x00200000, LENGTH = 0x00010000
|
||||
STACK (rw) : ORIGIN = 0x00210000, LENGTH = 0x00000000
|
||||
DATA (rw) : ORIGIN = 0x00200000, LENGTH = 0x0000FF00
|
||||
STACK (rw) : ORIGIN = 0x0020FF00, LENGTH = 0x00000000
|
||||
}
|
||||
|
||||
|
||||
|
||||
6
fpga.c
6
fpga.c
@@ -846,8 +846,12 @@ unsigned char GetFPGAStatus(void)
|
||||
|
||||
void fpga_init(char *name) {
|
||||
unsigned long time = GetTimer(0);
|
||||
int loaded_from_usb = USB_LOAD_VAR;
|
||||
|
||||
if(!user_io_dip_switch1() || name) {
|
||||
iprintf("loaded_from_usb = %d\n", USB_LOAD_VAR == USB_LOAD_VALUE);
|
||||
USB_LOAD_VAR = 0;
|
||||
|
||||
if(loaded_from_usb != USB_LOAD_VALUE) {
|
||||
unsigned char ct;
|
||||
|
||||
if (ConfigureFpga(name)) {
|
||||
|
||||
@@ -656,7 +656,6 @@ void user_io_send_buttons(char force) {
|
||||
|
||||
void user_io_poll() {
|
||||
|
||||
if(user_io_dip_switch1()) {
|
||||
// check of core has changed from a good one to a not supported on
|
||||
// as this likely means that the user is reloading the core via jtag
|
||||
unsigned char ct;
|
||||
@@ -672,6 +671,7 @@ void user_io_poll() {
|
||||
else {
|
||||
// core type has changed
|
||||
if(++ct_cnt == 255) {
|
||||
USB_LOAD_VAR = USB_LOAD_VALUE;
|
||||
// wait for a new valid core id to appear
|
||||
while((ct & 0xf0) != 0xa0) {
|
||||
EnableIO();
|
||||
@@ -685,7 +685,6 @@ void user_io_poll() {
|
||||
for(;;);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if((core_type != CORE_TYPE_MINIMIG) &&
|
||||
(core_type != CORE_TYPE_MINIMIG2) &&
|
||||
|
||||
Reference in New Issue
Block a user