]> git.leonardobizzoni.com Git - pioneer-stm32/commitdiff
change transmission frequency to 10Hz
authorFederica Di Lauro <federicadilauro1998@gmail.com>
Wed, 12 Feb 2020 15:43:59 +0000 (16:43 +0100)
committerFederica Di Lauro <federicadilauro1998@gmail.com>
Wed, 12 Feb 2020 15:43:59 +0000 (16:43 +0100)
otto_controller/.mxproject
otto_controller/Core/Src/main.cpp
otto_controller/Core/Src/tim.c
otto_controller/otto_controller.ioc

index b4aeebb2202657102d37f309f8ee12e378b315a7..68ed7a12fb3dbf32b9c71532404e712a0889a145 100644 (file)
@@ -20,8 +20,6 @@ SourceFiles#4=/home/fdila/Projects/otto/otto_controller/Core/Src/stm32f7xx_it.c
 SourceFiles#5=/home/fdila/Projects/otto/otto_controller/Core/Src/stm32f7xx_hal_msp.c\r
 HeaderFiles#6=/home/fdila/Projects/otto/otto_controller/Core/Inc/main.h\r
 SourceFiles#6=/home/fdila/Projects/otto/otto_controller/Core/Src/main.c\r
-HeaderFiles=;\r
-SourceFiles=;\r
 \r
 [PreviousLibFiles]\r
 LibFiles=Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_cortex.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_tim.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_tim_ex.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_rcc.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_rcc_ex.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_flash.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_flash_ex.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_gpio.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_gpio_ex.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_dma.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_dma_ex.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_pwr.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_pwr_ex.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_def.h;Drivers/STM32F7xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_i2c.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_i2c_ex.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_exti.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_uart.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_uart_ex.h;Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_cortex.c;Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_tim.c;Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_tim_ex.c;Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_rcc.c;Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_rcc_ex.c;Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_flash.c;Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_flash_ex.c;Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_gpio.c;Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_dma.c;Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_dma_ex.c;Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_pwr.c;Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_pwr_ex.c;Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal.c;Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_i2c.c;Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_i2c_ex.c;Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_exti.c;Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_uart.c;Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_uart_ex.c;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_cortex.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_tim.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_tim_ex.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_rcc.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_rcc_ex.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_flash.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_flash_ex.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_gpio.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_gpio_ex.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_dma.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_dma_ex.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_pwr.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_pwr_ex.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_def.h;Drivers/STM32F7xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_i2c.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_i2c_ex.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_exti.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_uart.h;Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_uart_ex.h;Drivers/CMSIS/Device/ST/STM32F7xx/Include/stm32f767xx.h;Drivers/CMSIS/Device/ST/STM32F7xx/Include/stm32f7xx.h;Drivers/CMSIS/Device/ST/STM32F7xx/Include/system_stm32f7xx.h;Drivers/CMSIS/Device/ST/STM32F7xx/Source/Templates/system_stm32f7xx.c;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/core_cm3.h;Drivers/CMSIS/Include/core_armv8mml.h;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/core_sc300.h;Drivers/CMSIS/Include/core_cm33.h;Drivers/CMSIS/Include/core_cm0.h;Drivers/CMSIS/Include/core_cm1.h;Drivers/CMSIS/Include/tz_context.h;Drivers/CMSIS/Include/cmsis_armclang.h;Drivers/CMSIS/Include/core_cm7.h;Drivers/CMSIS/Include/cmsis_compiler.h;Drivers/CMSIS/Include/cmsis_iccarm.h;Drivers/CMSIS/Include/core_cm23.h;Drivers/CMSIS/Include/core_armv8mbl.h;Drivers/CMSIS/Include/core_cm0plus.h;Drivers/CMSIS/Include/mpu_armv7.h;Drivers/CMSIS/Include/mpu_armv8.h;Drivers/CMSIS/Include/cmsis_version.h;Drivers/CMSIS/Include/core_sc000.h;Drivers/CMSIS/Include/core_cm4.h;\r
index 485ec55ad49322898cedccc63ae472ac3e32066d..c06dc1016c5af844392f51add9752041129ced41 100644 (file)
@@ -136,12 +136,14 @@ static void MX_NVIC_Init(void);
 /* USER CODE END 0 */\r
 \r
 /**\r
- * @brief  The application entry point.\r
- * @retval int\r
- */\r
-int main(void) {\r
+  * @brief  The application entry point.\r
+  * @retval int\r
+  */\r
+int main(void)\r
+{\r
   /* USER CODE BEGIN 1 */\r
   /* USER CODE END 1 */\r
+  \r
 \r
   /* MCU Configuration--------------------------------------------------------*/\r
 \r
@@ -214,6 +216,8 @@ int main(void) {
                        velocity_cmd_length);\r
 \r
   /* USER CODE END 2 */\r
\r
\r
 \r
   /* Infinite loop */\r
   /* USER CODE BEGIN WHILE */\r
@@ -226,51 +230,56 @@ int main(void) {
 }\r
 \r
 /**\r
- * @brief System Clock Configuration\r
- * @retval None\r
- */\r
-void SystemClock_Config(void) {\r
-  RCC_OscInitTypeDef RCC_OscInitStruct = { 0 };\r
-  RCC_ClkInitTypeDef RCC_ClkInitStruct = { 0 };\r
-  RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 };\r
+  * @brief System Clock Configuration\r
+  * @retval None\r
+  */\r
+void SystemClock_Config(void)\r
+{\r
+  RCC_OscInitTypeDef RCC_OscInitStruct = {0};\r
+  RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};\r
+  RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};\r
 \r
   /** Configure the main internal regulator output voltage \r
-   */\r
+  */\r
   __HAL_RCC_PWR_CLK_ENABLE();\r
   __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE3);\r
   /** Initializes the CPU, AHB and APB busses clocks \r
-   */\r
+  */\r
   RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;\r
   RCC_OscInitStruct.HSIState = RCC_HSI_ON;\r
   RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;\r
   RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;\r
-  if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {\r
+  if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)\r
+  {\r
     Error_Handler();\r
   }\r
   /** Initializes the CPU, AHB and APB busses clocks \r
-   */\r
-  RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK\r
-      | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;\r
+  */\r
+  RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK\r
+                              |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;\r
   RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI;\r
   RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;\r
   RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;\r
   RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;\r
 \r
-  if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_0) != HAL_OK) {\r
+  if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_0) != HAL_OK)\r
+  {\r
     Error_Handler();\r
   }\r
   PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USART6;\r
   PeriphClkInitStruct.Usart6ClockSelection = RCC_USART6CLKSOURCE_PCLK2;\r
-  if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) {\r
+  if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)\r
+  {\r
     Error_Handler();\r
   }\r
 }\r
 \r
 /**\r
- * @brief NVIC Configuration.\r
- * @retval None\r
- */\r
-static void MX_NVIC_Init(void) {\r
+  * @brief NVIC Configuration.\r
+  * @retval None\r
+  */\r
+static void MX_NVIC_Init(void)\r
+{\r
   /* TIM3_IRQn interrupt configuration */\r
   HAL_NVIC_SetPriority(TIM3_IRQn, 2, 1);\r
   HAL_NVIC_EnableIRQ(TIM3_IRQn);\r
@@ -378,10 +387,11 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) {
 /* USER CODE END 4 */\r
 \r
 /**\r
- * @brief  This function is executed in case of error occurrence.\r
- * @retval None\r
- */\r
-void Error_Handler(void) {\r
+  * @brief  This function is executed in case of error occurrence.\r
+  * @retval None\r
+  */\r
+void Error_Handler(void)\r
+{\r
   /* USER CODE BEGIN Error_Handler_Debug */\r
   /* User can add his own implementation to report the HAL error return state */\r
 \r
index c9de2cdbe4dab048933287a1123fad196e55fe3e..77effbf17e0f93dd6287268c9f49f8d44d8075c4 100644 (file)
@@ -180,7 +180,7 @@ void MX_TIM6_Init(void)
   htim6.Instance = TIM6;\r
   htim6.Init.Prescaler = 9999;\r
   htim6.Init.CounterMode = TIM_COUNTERMODE_UP;\r
-  htim6.Init.Period = 799;\r
+  htim6.Init.Period = 159;\r
   htim6.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;\r
   if (HAL_TIM_Base_Init(&htim6) != HAL_OK)\r
   {\r
index 1568395dd937a4e549bca95377c1a5a008d2859b..cdba5b7d8a2caec749d88e1f6bf2c73087849507 100644 (file)
@@ -251,7 +251,7 @@ TIM5.EncoderMode=TIM_ENCODERMODE_TI12
 TIM5.IPParameters=Period,EncoderMode
 TIM5.Period=4294967295
 TIM6.IPParameters=Prescaler,Period
-TIM6.Period=799
+TIM6.Period=159
 TIM6.Prescaler=9999
 USART6.IPParameters=VirtualMode-Asynchronous,WordLength,Parity
 USART6.Parity=PARITY_NONE