Ignore:
Timestamp:
Dec 13, 2024, 8:38:16 AM (5 weeks ago)
Author:
Zed
Message:

POWER_ENABLE lines for 4V, 5V, 10V and 15V were tested.

Location:
ctrl/firmware/Main/SES/Core/Src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ctrl/firmware/Main/SES/Core/Src/keys_thread.cpp

    r57 r58  
     1#include <cstdio>
     2
    13#include "main.h"
    24#include "keys_thread.h"
    35
    4 static uint16_t delay_ms = 500; // Must be greater than 10ms
     6static const char* const TAG = "KEYS";
     7static uint16_t delay_ms = 2000U;
     8
     9//------------------------------------------------------------------------------
    510
    611VOID scanKeysThread(ULONG initial_input)
    712{
    813        (void)initial_input;
     14
     15        HAL_GPIO_WritePin(POWER_4V_EN_GPIO_Port, POWER_4V_EN_Pin, GPIO_PIN_SET);
     16        HAL_GPIO_WritePin(POWER_5V_EN_GPIO_Port, POWER_5V_EN_Pin, GPIO_PIN_SET);
     17        HAL_GPIO_WritePin(POWER_10V_EN_GPIO_Port, POWER_10V_EN_Pin, GPIO_PIN_SET);
    918
    1019        while(1)
     
    1928                //HAL_GPIO_WritePin(RX2_LED_GPIO_Port, RX2_LED_Pin, GPIO_PIN_SET);
    2029
    21                 //tx_thread_sleep((TX_TIMER_TICKS_PER_SECOND * delay_ms)/1000);
     30                // Calculating worse stack allocation
     31                TX_THREAD* current_thread = tx_thread_identify();
     32                printf("%s: Stack size: %lu, used: %u, free: %u\n", TAG, current_thread->tx_thread_stack_size,
     33                           (uint8_t*)current_thread->tx_thread_stack_ptr - (uint8_t*)current_thread->tx_thread_stack_start,
     34                           (uint8_t*)current_thread->tx_thread_stack_end - (uint8_t*)current_thread->tx_thread_stack_ptr);
    2235        }
    2336}
     37
     38//------------------------------------------------------------------------------
  • ctrl/firmware/Main/SES/Core/Src/main_thread.cpp

    r57 r58  
    44#include "tx_api.h"
    55#include "fx_api.h"
    6 //#include "main.h"
    76#include "main_thread.h"
    87
    9 static constexpr uint16_t delay_ms = 500;       // Must be greater than 10ms
     8
     9static const char* const TAG = "MAIN";
     10static constexpr uint16_t delay_ms = 5000;
    1011static constexpr unsigned MAX_CHARS_IN_VOLUME_NAME = 12U;
    1112static CHAR volumeName[MAX_CHARS_IN_VOLUME_NAME];
    1213static CHAR entry[FX_MAX_LONG_NAME_LEN];
    1314UINT ret;
     15
     16//------------------------------------------------------------------------------
    1417
    1518void startMainThread(FX_MEDIA* sdio_disk)
     
    6467        {
    6568                tx_thread_sleep(delay_ms);
     69
     70                // Calculating worse stack allocation
     71                TX_THREAD* current_thread = tx_thread_identify();
     72                printf("%s: Stack size: %lu, used: %u, free: %u\n", TAG, current_thread->tx_thread_stack_size,
     73                           (uint8_t*)current_thread->tx_thread_stack_ptr - (uint8_t*)current_thread->tx_thread_stack_start,
     74                           (uint8_t*)current_thread->tx_thread_stack_end - (uint8_t*)current_thread->tx_thread_stack_ptr);
     75
    6676        }
    6777}
Note: See TracChangeset for help on using the changeset viewer.