Ignore:
Timestamp:
Feb 11, 2025, 1:59:45 PM (3 months ago)
Author:
Zed
Message:

RTC is working.

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

Legend:

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

    r82 r87  
    99#include "main_task.h"
    1010#include "utils.h"
     11#include "rtc.h"
    1112
    1213
    1314static const char* const TAG = "MAIN";
    1415
    15 static constexpr uint16_t delay_ms = 5000;
     16static constexpr uint16_t delay_ms = 5000U;
    1617
    1718static constexpr unsigned MAX_CHARS_IN_VOLUME_NAME = 12U;
     
    4950        while(1)
    5051        {
    51                 vTaskDelay(pdMS_TO_TICKS(delay_ms));
    52 
    5352                //DHCP_run();
    5453                //printThreadStackInfo(TAG);
     54                RTC_TimeTypeDef sTime;
     55                RTC_DateTypeDef sDate;
     56                HAL_RTC_GetTime(&hrtc, &sTime, RTC_FORMAT_BIN);
     57                HAL_RTC_GetDate(&hrtc, &sDate, RTC_FORMAT_BIN);
     58                printf("%u:%u:%u\n", sTime.Hours, sTime.Minutes, sTime.Seconds);
     59
     60                vTaskDelay(pdMS_TO_TICKS(delay_ms));
    5561        }
    5662}
  • ctrl/firmware/Main/SES/Core/Src/sysdata.c

    r83 r87  
    1313        sys_data.s.lb_parity_mode = MODBUS_UART_PARITY_EVEN;
    1414        sys_data.s.lb_stopbit_mode = 1;
     15
     16        //sys_data.s.fw_sub_revision
    1517}
Note: See TracChangeset for help on using the changeset viewer.