From 714c7509d66afdacd8e9ce0cfe94ec8ae7f76883 Mon Sep 17 00:00:00 2001 From: J08nY Date: Tue, 3 Mar 2020 15:19:33 +0100 Subject: Add tests, for fixed Jacobian stuff. --- pyecsca/codegen/client.py | 4 +++- pyecsca/codegen/hal/stm32f3/stm32f3_hal_lowlevel.c | 26 +++++++++++----------- 2 files changed, 16 insertions(+), 14 deletions(-) (limited to 'pyecsca/codegen') diff --git a/pyecsca/codegen/client.py b/pyecsca/codegen/client.py index 07feb93..2b74f7a 100644 --- a/pyecsca/codegen/client.py +++ b/pyecsca/codegen/client.py @@ -234,8 +234,10 @@ class ImplTarget(SimpleSerialTarget): self.send_cmd(SMessage.from_raw(cmd_set_trigger(actions)), self.timeout) self.trigger = actions - def disconnect(self): + def quit(self): self.write(b"x\n") + + def disconnect(self): super().disconnect() diff --git a/pyecsca/codegen/hal/stm32f3/stm32f3_hal_lowlevel.c b/pyecsca/codegen/hal/stm32f3/stm32f3_hal_lowlevel.c index 6eb1999..362f3ab 100644 --- a/pyecsca/codegen/hal/stm32f3/stm32f3_hal_lowlevel.c +++ b/pyecsca/codegen/hal/stm32f3/stm32f3_hal_lowlevel.c @@ -113,6 +113,19 @@ uint32_t HAL_RCC_GetPCLK1Freq(void) return 7372800U; } +/** + * @brief Returns the PCLK2 frequency + * @note Each time PCLK2 changes, this function must be called to update the + * right PCLK2 value. Otherwise, any configuration based on this function will be incorrect. + * @retval PCLK2 frequency + */ +uint32_t HAL_RCC_GetPCLK2Freq(void) +{ + /* Get HCLK source and Compute PCLK2 frequency ---------------------------*/ + //return (HAL_RCC_GetHCLKFreq()>> APBPrescTable[(RCC->CFGR & RCC_CFGR_PPRE2)>> POSITION_VAL(RCC_CFGR_PPRE2)]); + return 7372800U; +} + /** * @brief Initializes the RCC Oscillators according to the specified parameters in the * RCC_OscInitTypeDef. @@ -617,19 +630,6 @@ HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, ui return HAL_OK; } -/** - * @brief Returns the PCLK2 frequency - * @note Each time PCLK2 changes, this function must be called to update the - * right PCLK2 value. Otherwise, any configuration based on this function will be incorrect. - * @retval PCLK2 frequency - */ -uint32_t HAL_RCC_GetPCLK2Freq(void) -{ - /* Get HCLK source and Compute PCLK2 frequency ---------------------------*/ - //return (HAL_RCC_GetHCLKFreq()>> APBPrescTable[(RCC->CFGR & RCC_CFGR_PPRE2)>> POSITION_VAL(RCC_CFGR_PPRE2)]); - return 7372800; -} - #define GPIO_MODE (0x00000003U) -- cgit v1.3.1