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

FileX is working.

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.