2022-02-28 14:13:31 +01:00
|
|
|
#include "libxiphos.h"
|
2022-03-01 15:06:59 +01:00
|
|
|
|
2022-02-28 19:52:43 +01:00
|
|
|
#include "CoreController.h"
|
|
|
|
|
|
|
|
bool rebootWasCalled = false;
|
|
|
|
xsc_libnor_chip_t lastChip;
|
|
|
|
xsc_libnor_copy_t lastCopy;
|
|
|
|
|
2022-03-01 15:06:59 +01:00
|
|
|
bool getRebootWasCalled(xsc_libnor_chip_t& tgtChip, xsc_libnor_copy_t& tgtCopy) {
|
2022-02-28 19:52:43 +01:00
|
|
|
tgtChip = lastChip;
|
|
|
|
tgtCopy = lastCopy;
|
|
|
|
bool tmp = rebootWasCalled;
|
2022-03-01 15:06:59 +01:00
|
|
|
if (rebootWasCalled) {
|
2022-02-28 19:52:43 +01:00
|
|
|
rebootWasCalled = false;
|
|
|
|
}
|
|
|
|
return tmp;
|
|
|
|
}
|
2022-02-28 14:13:31 +01:00
|
|
|
|
|
|
|
void xsc_boot_copy(xsc_libnor_chip_t boot_chip, xsc_libnor_copy_t boot_copy) {
|
2022-02-28 19:52:43 +01:00
|
|
|
rebootWasCalled = true;
|
|
|
|
lastChip = boot_chip;
|
|
|
|
lastCopy = boot_copy;
|
2022-03-01 15:06:59 +01:00
|
|
|
CoreController::setCurrentBootCopy(static_cast<xsc::Chip>(boot_chip),
|
|
|
|
static_cast<xsc::Copy>(boot_copy));
|
2022-02-28 14:13:31 +01:00
|
|
|
}
|