Ignore:
Timestamp:
Dec 12, 2024, 10:25:26 AM (5 weeks ago)
Author:
Zed
Message:

FileX is working.

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  
    2828#include <stdio.h>
    2929
    30 #include "MainThread.h"
     30#include "keys_thread.h"
    3131
    3232/* USER CODE END Includes */
     
    4040/* USER CODE BEGIN PD */
    4141
    42 #define MEMORY_BLOCK_SIZE_BYTES                 (8192U)
    4342#define MAIN_THREAD_STACK_SIZE_BYTES    (1024U)
    4443
     
    5352/* USER CODE BEGIN PV */
    5453
    55 _Alignas(ULONG)   uint8_t                 memoryBlock[MEMORY_BLOCK_SIZE_BYTES];
    56                                   TX_THREAD               thread_ptr;
    57                                   TX_BYTE_POOL    byte_pool_0;
     54TX_THREAD       scan_keys_thread_ptr;
    5855
    5956/* USER CODE END PV */
     
    7471  /* USER CODE BEGIN App_ThreadX_MEM_POOL */
    7572
    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;
    8375
    8476  /* USER CODE END App_ThreadX_MEM_POOL */
     
    8779
    8880  // 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);
    9083  if (ret != TX_SUCCESS) { printf("Cannot allocate bytes of memory!\n"); return ret; }
    9184
    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);
    9388  if (ret != TX_SUCCESS) { printf("Cannot create MainThread!\n"); return ret; }
    9489
  • ctrl/firmware/Main/CubeMX/FileX/App/app_filex.c

    r54 r57  
    2525/* Private includes ----------------------------------------------------------*/
    2626/* USER CODE BEGIN Includes */
     27
     28#include "stdio.h"
     29#include "main_thread.h"
    2730
    2831/* USER CODE END Includes */
     
    140143  {
    141144    /* USER CODE BEGIN SD open error */
     145        printf("Cannot mout SD card!\n");
    142146    while(1);
    143147    /* USER CODE END SD open error */
     
    145149
    146150  /* USER CODE BEGIN fx_app_thread_entry 1 */
     151
     152  startMainThread(&sdio_disk);
    147153
    148154  /* USER CODE END fx_app_thread_entry 1 */
  • ctrl/firmware/Main/CubeMX/charger.ioc

    r56 r57  
    321321STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.InterfacesCcFileOoSystemJjFileXOoSDOointerface=true
    322322STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.RTOSJjThreadX_Checked=true
    323 STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.TX_APP_CREATION=1
     323STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.TX_APP_CREATION=0
    324324STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.TX_APP_GENERATE_INIT_CODE=false
    325325STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0.TX_APP_MEM_POOL_SIZE=8192
Note: See TracChangeset for help on using the changeset viewer.