fix reboot

This commit is contained in:
merlokk 2019-08-22 15:49:33 +03:00 committed by Conor Patrick
parent a95e62e2ea
commit c972a13034
3 changed files with 8 additions and 3 deletions

View File

@ -30,6 +30,7 @@ void main_loop_delay();
void heartbeat(); void heartbeat();
void device_reboot();
void authenticator_read_state(AuthenticatorState * ); void authenticator_read_state(AuthenticatorState * );

View File

@ -43,7 +43,11 @@ void device_set_status(uint32_t status)
__device_status = status; __device_status = status;
} }
void device_reboot()
{
printf1(TAG_RED, "REBOOT command recieved!\r\n");
exit(100);
}
int udp_server() int udp_server()
{ {

View File

@ -757,10 +757,10 @@ void apdu_process(uint8_t buf0, uint8_t *apduptr, APDU_STRUCT *apdu)
break; break;
case APDU_SOLO_RESET: case APDU_SOLO_RESET:
if (apdu.lc == 18 && !memcmp(apdu.data, "Reset solo please>", 18)) { if (apdu.lc == 4 && !memcmp(apdu.data, "\x12\x56\xab\xf0", 4)) {
printf1(TAG_NFC, "Reset...\r\n"); printf1(TAG_NFC, "Reset...\r\n");
delay(10); delay(10);
NVIC_SystemReset(); device_reboot();
while(1); while(1);
} else { } else {
printf1(TAG_NFC, "Reset FAIL\r\n"); printf1(TAG_NFC, "Reset FAIL\r\n");