1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-22 22:38:08 +00:00

firmware/main.c: simplify

This commit is contained in:
Jan Pochyla 2017-03-08 14:02:55 +01:00
parent 9fd5f05f1f
commit 1db09f88a1

View File

@ -50,16 +50,14 @@ int main(void) {
// Enable the CCM RAM
__HAL_RCC_CCMDATARAMEN_CLK_ENABLE();
// machine_init
if (PWR->CSR & PWR_CSR_SBF) {
// Clear the reset flags
PWR->CR |= PWR_CR_CSBF;
}
RCC->CSR |= RCC_CSR_RMVF;
// Enable CPU ticks
CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk;
DWT->CYCCNT = 0;
DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk;
CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; // Enable DWT
DWT->CYCCNT = 0; // Reset Cycle Count Register
DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk; // Enable Cycle Count Register
pendsv_init();