Changeset 66 for ctrl/firmware/Main/CubeMX/Core
- Timestamp:
- Jan 22, 2025, 11:40:26 AM (5 days ago)
- Location:
- ctrl/firmware/Main/CubeMX/Core
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
ctrl/firmware/Main/CubeMX/Core/Inc/main.h
r62 r66 82 82 #define GSM_STATUS_Pin GPIO_PIN_13 83 83 #define GSM_STATUS_GPIO_Port GPIOD 84 #define FAN_TACHO_Pin GPIO_PIN_6 85 #define FAN_TACHO_GPIO_Port GPIOC 86 #define FAN_PWM_Pin GPIO_PIN_7 87 #define FAN_PWM_GPIO_Port GPIOC 84 88 #define SD_DETECT_Pin GPIO_PIN_8 85 89 #define SD_DETECT_GPIO_Port GPIOA -
ctrl/firmware/Main/CubeMX/Core/Inc/stm32h7xx_it.h
r64 r66 56 56 void DMA1_Stream1_IRQHandler(void); 57 57 void DMA1_Stream2_IRQHandler(void); 58 void TIM3_IRQHandler(void); 58 59 void USART3_IRQHandler(void); 60 void TIM8_CC_IRQHandler(void); 59 61 void SDMMC1_IRQHandler(void); 60 62 void TIM7_IRQHandler(void); -
ctrl/firmware/Main/CubeMX/Core/Src/app_threadx.c
r65 r66 33 33 #include "gsm_thread.h" 34 34 #include "gsm_rx_thread.h" 35 #include "fan_thread.h" 35 36 36 37 /* USER CODE END Includes */ … … 47 48 #define GSM_THREAD_STACK_SIZE_BYTES (1024U) 48 49 #define GSM_RX_THREAD_STACK_SIZE_BYTES (1024U) 50 #define FAN_THREAD_STACK_SIZE_BYTES (512U) 49 51 50 52 /* USER CODE END PD */ … … 61 63 TX_THREAD gsm_thread_ptr; 62 64 TX_THREAD gsm_rx_thread_ptr; 65 TX_THREAD fan_thread_ptr; 63 66 64 67 /* USER CODE END PV */ … … 83 86 VOID *gsm_thread_pointer; 84 87 VOID *gsm_rx_thread_pointer; 88 VOID *fan_thread_pointer; 85 89 86 90 /* USER CODE END App_ThreadX_MEM_POOL */ … … 97 101 98 102 99 // Allocate the stack for gsm thread103 // Allocate the stack for gsm send thread 100 104 ret = tx_byte_allocate(byte_pool, &gsm_thread_pointer, GSM_THREAD_STACK_SIZE_BYTES, TX_NO_WAIT); 101 105 if (ret != TX_SUCCESS) { printf("Cannot allocate bytes of memory!\n"); return ret; } … … 105 109 if (ret != TX_SUCCESS) { printf("Cannot create %s!\n", gsm_thread_name); return ret; } 106 110 107 // Allocate the stack for gsm sendthread111 // Allocate the stack for gsm rx thread 108 112 ret = tx_byte_allocate(byte_pool, &gsm_rx_thread_pointer, GSM_RX_THREAD_STACK_SIZE_BYTES, TX_NO_WAIT); 109 113 if (ret != TX_SUCCESS) { printf("Cannot allocate bytes of memory!\n"); return ret; } 110 114 111 115 char* gsm_rx_thread_name = "GSM RX Thread"; 112 ret = tx_thread_create(&gsm_rx_thread_ptr, gsm_rx_thread_name, gsmRxThread, 0x0001, 116 ret = tx_thread_create(&gsm_rx_thread_ptr, gsm_rx_thread_name, gsmRxThread, 0x0001, gsm_rx_thread_pointer, GSM_RX_THREAD_STACK_SIZE_BYTES, TX_MAX_PRIORITIES-1, TX_MAX_PRIORITIES-1, TX_NO_TIME_SLICE, TX_AUTO_START); 113 117 if (ret != TX_SUCCESS) { printf("Cannot create %s!\n", gsm_rx_thread_name); return ret; } 114 118 119 // Allocate the stack for fan control thread 120 ret = tx_byte_allocate(byte_pool, &fan_thread_pointer, FAN_THREAD_STACK_SIZE_BYTES, TX_NO_WAIT); 121 if (ret != TX_SUCCESS) { printf("Cannot allocate bytes of memory!\n"); return ret; } 122 123 char* fan_thread_name = "FAN Thread"; 124 ret = tx_thread_create(&fan_thread_ptr, fan_thread_name, fanThread, 0x0001, fan_thread_pointer, FAN_THREAD_STACK_SIZE_BYTES, TX_MAX_PRIORITIES-1, TX_MAX_PRIORITIES-1, TX_NO_TIME_SLICE, TX_AUTO_START); 125 if (ret != TX_SUCCESS) { printf("Cannot create %s!\n", fan_thread_name); return ret; } 115 126 116 127 -
ctrl/firmware/Main/CubeMX/Core/Src/gpio.c
r63 r66 88 88 89 89 /*Configure GPIO pins : PC13 PC0 PC1 PC2 90 PC3 PC4 PC5 PC6 91 PC7 */ 90 PC3 PC4 PC5 */ 92 91 GPIO_InitStruct.Pin = GPIO_PIN_13|GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2 93 |GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6 94 |GPIO_PIN_7; 92 |GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_5; 95 93 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; 96 94 GPIO_InitStruct.Pull = GPIO_NOPULL; -
ctrl/firmware/Main/CubeMX/Core/Src/main.c
r61 r66 25 25 #include "sdmmc.h" 26 26 #include "spi.h" 27 #include "tim.h" 27 28 #include "usart.h" 28 29 #include "gpio.h" … … 120 121 MX_SDMMC1_SD_Init(); 121 122 MX_USART3_UART_Init(); 123 MX_TIM3_Init(); 124 MX_TIM8_Init(); 122 125 /* USER CODE BEGIN 2 */ 123 126 #undef MX_SDMMC1_SD_Init -
ctrl/firmware/Main/CubeMX/Core/Src/stm32h7xx_it.c
r65 r66 25 25 26 26 #include "gsm_rx_thread.h" 27 #include "fan_thread.h" 27 28 28 29 /* USER CODE END Includes */ … … 62 63 extern DMA_HandleTypeDef hdma_spi4_tx; 63 64 extern SPI_HandleTypeDef hspi4; 65 extern TIM_HandleTypeDef htim3; 66 extern TIM_HandleTypeDef htim8; 64 67 extern DMA_HandleTypeDef hdma_usart3_rx; 65 68 extern DMA_HandleTypeDef hdma_usart3_tx; … … 212 215 213 216 /** 217 * @brief This function handles TIM3 global interrupt. 218 */ 219 void TIM3_IRQHandler(void) 220 { 221 /* USER CODE BEGIN TIM3_IRQn 0 */ 222 223 /* USER CODE END TIM3_IRQn 0 */ 224 HAL_TIM_IRQHandler(&htim3); 225 /* USER CODE BEGIN TIM3_IRQn 1 */ 226 227 /* USER CODE END TIM3_IRQn 1 */ 228 } 229 230 /** 214 231 * @brief This function handles USART3 global interrupt. 215 232 */ … … 226 243 227 244 /** 245 * @brief This function handles TIM8 capture compare interrupt. 246 */ 247 void TIM8_CC_IRQHandler(void) 248 { 249 /* USER CODE BEGIN TIM8_CC_IRQn 0 */ 250 251 /* USER CODE END TIM8_CC_IRQn 0 */ 252 HAL_TIM_IRQHandler(&htim8); 253 /* USER CODE BEGIN TIM8_CC_IRQn 1 */ 254 255 /* USER CODE END TIM8_CC_IRQn 1 */ 256 } 257 258 /** 228 259 * @brief This function handles SDMMC1 global interrupt. 229 260 */ … … 278 309 //------------------------------------------------------------------------------ 279 310 280 /*void HAL_UART_RxCpltCallback(UART_HandleTypeDef * huart)281 { 282 //if (huart->Instance == USART3) gsmUnitSentData();283 } */311 void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim) 312 { 313 if (htim->Instance == TIM8) pulseMeasured(); 314 } 284 315 285 316 //------------------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.