added feature for recording break

This commit is contained in:
unknown 2025-04-11 16:55:28 +05:30
parent 937b19d131
commit 441cc1c516
27 changed files with 474520 additions and 27 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -571,6 +571,8 @@ static void MX_GPIO_Init(void)
}
/* USER CODE BEGIN 4 */
extern RTC_TimeTypeDef cur_time;
extern RTC_DateTypeDef cur_date;
/* USER CODE END 4 */
@ -589,7 +591,14 @@ void StartDefaultTask(void const * argument)
/* Infinite loop */
for(;;)
{
osDelay(10000);
HAL_RTC_GetTime(RTC_HDL, &cur_time, RTC_FORMAT_BIN);
HAL_RTC_GetDate(RTC_HDL, &cur_date, RTC_FORMAT_BIN);
LOG(LOG_INFO, "looping Current Minute: %d", cur_time.Minutes);
LOG(LOG_INFO, "looping Current seconds: %d", cur_time.Seconds);
osDelay(5000);
}
/* USER CODE END 5 */
}

View File

@ -36,7 +36,7 @@
/* FES Common Lib Headers.*/
#include <sw_version.h>
#include <Log.h>
#include <stm32_reset.h>
#include <keyhdl_api.h>
@ -85,9 +85,11 @@ RTC_DateTypeDef cur_date = {0};
uint8_t record_key_press_evt = 0;
uint8_t record_started=0;
uint8_t record_stoped=0;
char FileName[100];
uint8_t pre_sec = 0;
typedef struct
{
uint8_t Brkot_Hours;
@ -235,6 +237,10 @@ void App_Task(uint16_t call_rate)
// char FileName[100];
App_AudioRec_State_t rec_state;
rec_state = App_AudioRec_GetState();
if(rec_state == AUDIO_REC_STATE_RECORDING)
{
Recording_breakout();
}
if(record_key_press_evt)
{
record_key_press_evt = 0;
@ -257,6 +263,8 @@ void App_Task(uint16_t call_rate)
}
else if(rec_state == AUDIO_REC_STATE_RECORDING)
{
record_stoped = 1;
if(App_AudioRec_Stop() != 0)
{
LOG(LOG_ERROR,"App_AudioRec_Stop Error!!!");
@ -269,9 +277,6 @@ void App_Task(uint16_t call_rate)
}
}
}
if(rec_state == AUDIO_REC_STATE_RECORDING){
Recording_breakout();
}
/* Health Led Blinking */
App_HealthLed(call_rate);
// App_HWTest(call_rate);
@ -325,24 +330,27 @@ void get_audio_file_name(char *file_name, uint8_t rec_break_hr, uint8_t rec_brea
cur_date.Year,cur_date.Month,cur_date.Date,
cur_time.Hours,cur_time.Minutes,cur_time.Seconds );
uint8_t target_minutes = cur_time.Minutes + rec_break_min;
uint8_t target_hours = cur_time.Hours + rec_break_hr;
if (target_minutes >= 60)
{
target_minutes -= 60;
target_hours += 1;
}
if (target_hours >= 24)
{
target_hours -= 24;
}
Brkot_time.Brkot_Hours = target_hours;
Brkot_time.Brkot_Minutes = target_minutes;
LOG(LOG_INFO,"File: %s",file_name);
LOG(LOG_INFO, "Current Hour: %d", cur_time.Hours);
LOG(LOG_INFO, "Current Minute: %d", cur_time.Minutes);
uint8_t target_minutes = cur_time.Minutes + rec_break_min;
uint8_t target_hours = cur_time.Hours + rec_break_hr;
if (target_minutes >= 60) {
target_minutes -= 60;
target_hours += 1;
}
if (target_hours >= 24) {
target_hours -= 24;
}
Brkot_time.Brkot_Hours = target_hours;
Brkot_time.Brkot_Minutes = target_minutes;
LOG(LOG_INFO, "BreakOut Hour: %d", Brkot_time.Brkot_Hours);
LOG(LOG_INFO, "BreakOut Minute: %d", Brkot_time.Brkot_Minutes);
}
time_t getUnixTimeStamp()
@ -371,7 +379,20 @@ time_t getUnixTimeStamp()
void Recording_breakout(){
HAL_RTC_GetTime(RTC_HDL, &cur_time, RTC_FORMAT_BIN);
// HAL_RTC_GetTime(RTC_HDL, &cur_time, RTC_FORMAT_BIN);
// if(cur_time.Seconds != pre_sec){
//
//// LOG(LOG_INFO, "looping Current Minute: %d", cur_time.Minutes);
//// LOG(LOG_INFO, "looping Current seconds: %d", cur_time.Seconds);
//
// pre_sec = cur_time.Seconds;
// }
// LOG(LOG_INFO, "looping Current Minute: %d", cur_time.Minutes);
// LOG(LOG_INFO, "looping Current seconds: %d", cur_time.Seconds);
if(cur_time.Hours == Brkot_time.Brkot_Hours && cur_time.Minutes == Brkot_time.Brkot_Minutes)
{
@ -388,7 +409,7 @@ void Recording_breakout(){
LOG(LOG_ERROR, "Recording_breakout_App_AudioRec_Start Error!!!");
MX_USB_DEVICE_Init();
} else {
record_started = 1;
// record_started = 1;
LOG(LOG_INFO, "Recording_breakout_App_AudioRec_Started !!!");
}
}
@ -466,9 +487,10 @@ void App_AudioRecCallbackFnc(App_AudioRec_State_t state)
{
LOG(LOG_INFO,"App_AudioRecCallbackFnc Recorder State : %d ", state);
if(record_started && ((AUDIO_REC_STATE_STOPPED == state)))
if(record_started && record_stoped/*((AUDIO_REC_STATE_STOPPED == state))*/)
{
record_started = 0 ;
record_stoped = 0;
/* init code for USB_DEVICE */
MX_USB_DEVICE_Init();
}

View File

@ -35,6 +35,7 @@
/*****************************************************************************/
#include "system.h"
#include <Log.h>
#include "App_Flash_conf.h"

View File

@ -31,7 +31,7 @@
MAJOR_VERSION "." MINOR_VERSION "." BUG_FIX_VERSION "." BUILD_VERSION
*/
#define APP_SW_VER_STR "00.00.00.0859"
#define APP_SW_VER_STR "00.00.00.0888"
/*****************************************************************************/
/* E N D O F F I L E */