Changeset 57 for ctrl/firmware/Main/CubeMX
- Timestamp:
- Dec 12, 2024, 10:25:26 AM (5 weeks ago)
- Location:
- ctrl/firmware/Main/CubeMX
- Files:
-
- 21 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
ctrl/firmware/Main/CubeMX/Core/Src/app_threadx.c
r55 r57 28 28 #include <stdio.h> 29 29 30 #include " MainThread.h"30 #include "keys_thread.h" 31 31 32 32 /* USER CODE END Includes */ … … 40 40 /* USER CODE BEGIN PD */ 41 41 42 #define MEMORY_BLOCK_SIZE_BYTES (8192U)43 42 #define MAIN_THREAD_STACK_SIZE_BYTES (1024U) 44 43 … … 53 52 /* USER CODE BEGIN PV */ 54 53 55 _Alignas(ULONG) uint8_t memoryBlock[MEMORY_BLOCK_SIZE_BYTES]; 56 TX_THREAD thread_ptr; 57 TX_BYTE_POOL byte_pool_0; 54 TX_THREAD scan_keys_thread_ptr; 58 55 59 56 /* USER CODE END PV */ … … 74 71 /* USER CODE BEGIN App_ThreadX_MEM_POOL */ 75 72 76 (void)memory_ptr; 77 78 /* Create a byte memory pool from which to allocate the thread stacks. */ 79 ret = tx_byte_pool_create(&byte_pool_0, "byte pool 0", memoryBlock, MEMORY_BLOCK_SIZE_BYTES); 80 if (ret != TX_SUCCESS) { printf("Cannot create BYTE POOL 0!\n"); return ret; } 81 82 uint8_t* ptr = TX_NULL; 73 TX_BYTE_POOL *byte_pool = (TX_BYTE_POOL*)memory_ptr; 74 VOID *pointer; 83 75 84 76 /* USER CODE END App_ThreadX_MEM_POOL */ … … 87 79 88 80 // Allocate the stack for main thread 89 ret = tx_byte_allocate(&byte_pool_0, (VOID**) &ptr, MAIN_THREAD_STACK_SIZE_BYTES, TX_NO_WAIT); 81 ret = tx_byte_allocate(byte_pool, &pointer, MAIN_THREAD_STACK_SIZE_BYTES, 82 TX_NO_WAIT); 90 83 if (ret != TX_SUCCESS) { printf("Cannot allocate bytes of memory!\n"); return ret; } 91 84 92 ret = tx_thread_create(&thread_ptr, "MainThread", MainThread, 0x0001, ptr, MAIN_THREAD_STACK_SIZE_BYTES, TX_MAX_PRIORITIES-1, TX_MAX_PRIORITIES-1, TX_NO_TIME_SLICE, TX_AUTO_START); 85 ret = tx_thread_create(&scan_keys_thread_ptr, "Scan Keys Thread", scanKeysThread, 0x0001, 86 pointer, MAIN_THREAD_STACK_SIZE_BYTES, TX_MAX_PRIORITIES-1, TX_MAX_PRIORITIES-1, 87 TX_NO_TIME_SLICE, TX_AUTO_START); 93 88 if (ret != TX_SUCCESS) { printf("Cannot create MainThread!\n"); return ret; } 94 89 -
ctrl/firmware/Main/CubeMX/FileX/App/app_filex.c
r54 r57 25 25 /* Private includes ----------------------------------------------------------*/ 26 26 /* USER CODE BEGIN Includes */ 27 28 #include "stdio.h" 29 #include "main_thread.h" 27 30 28 31 /* USER CODE END Includes */ … … 140 143 { 141 144 /* USER CODE BEGIN SD open error */ 145 printf("Cannot mout SD card!\n"); 142 146 while(1); 143 147 /* USER CODE END SD open error */ … … 145 149 146 150 /* USER CODE BEGIN fx_app_thread_entry 1 */ 151 152 startMainThread(&sdio_disk); 147 153 148 154 /* USER CODE END fx_app_thread_entry 1 */ -
ctrl/firmware/Main/CubeMX/charger.ioc
r56 r57 321 321 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.InterfacesCcFileOoSystemJjFileXOoSDOointerface=true 322 322 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.RTOSJjThreadX_Checked=true 323 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.TX_APP_CREATION= 1323 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.TX_APP_CREATION=0 324 324 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.TX_APP_GENERATE_INIT_CODE=false 325 325 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.TX_APP_MEM_POOL_SIZE=8192
Note: See TracChangeset
for help on using the changeset viewer.