mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2025-08-08 06:32:25 -04:00
fpga: Only allow system reset in firmware mode and syscalls
This commit is contained in:
parent
9e317666d3
commit
77fc5cf578
4 changed files with 58 additions and 2 deletions
|
@ -17,6 +17,7 @@ volatile uint32_t *uds = (volatile uint32_t *)TK1_MMIO_UDS_FIRST;
|
|||
volatile uint32_t *cdi = (volatile uint32_t *)TK1_MMIO_TK1_CDI_FIRST;
|
||||
volatile uint32_t *udi = (volatile uint32_t *)TK1_MMIO_TK1_UDI_FIRST;
|
||||
volatile uint8_t *fw_ram = (volatile uint8_t *)TK1_MMIO_FW_RAM_BASE;
|
||||
volatile uint32_t *system_reset = (volatile uint32_t *)TK1_MMIO_TK1_SYSTEM_RESET;
|
||||
volatile uint32_t *timer = (volatile uint32_t *)TK1_MMIO_TIMER_TIMER;
|
||||
volatile uint32_t *timer_prescaler = (volatile uint32_t *)TK1_MMIO_TIMER_PRESCALER;
|
||||
volatile uint32_t *timer_status = (volatile uint32_t *)TK1_MMIO_TIMER_STATUS;
|
||||
|
@ -355,9 +356,12 @@ int main(void)
|
|||
}
|
||||
puts("\r\n");
|
||||
|
||||
puts("Now echoing what you type...\r\n");
|
||||
puts("Now echoing what you type...Type + to reset device\r\n");
|
||||
for (;;) {
|
||||
in = readbyte(&mode, &mode_bytes_left);
|
||||
if (in == '+') {
|
||||
*system_reset = 1;
|
||||
}
|
||||
|
||||
writebyte(MODE_CDC);
|
||||
writebyte(1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue