Commit 0a99ded1 authored by hu's avatar hu

调整声音

parent c0d5bb03
......@@ -856,7 +856,7 @@ static void SEG_Tacho_Display(uint8_t Value, uint8_t Valid, uint8_t seg_status)
}
else
{
mSEG[i] = 1;
mSEG[i] = 0;
}
}
}
......@@ -932,7 +932,7 @@ static void SEG_VehicleSpeed_Display(uint8_t Value, uint8_t Valid, uint8_t seg_s
}
else
{
mSEG[i] = 1;
mSEG[i] = 0;
}
}
}
......
This diff is collapsed.
......@@ -23,5 +23,6 @@ void Popups_Management_Service ( void );
void Popups_Polling ( void );
void Popups_Displaying ( uint8_t PopupID );
void Popups_Sound_Playing ( uint8_t PopupID );
void Popup_Alone_Sound_Server(void);
#endif
\ No newline at end of file
......@@ -14,9 +14,9 @@
#define FState_COilTimeOutNum 60u /*3S*/
#define SystemSupplierECUHardwareVersionNumberApp ((uint16_t)(10000)) /*硬件版本号01.00.00*/
#define SystemSupplierECUSoftwareInformationApp ((uint16_t)(10100)) /*软件版本号01.01.00*/
#define systemSupplierECUFlashInformationApp ((uint16_t)(8)) /*FLASH版本号FV00.08*/
#define SystemSupplierECUHardwareVersionNumberApp ((uint16_t)(10000)) /*硬件版本号 HV:01.00.00*/
#define SystemSupplierECUSoftwareInformationApp ((uint16_t)(10101)) /*软件版本号 SV:01.01.00*/
#define systemSupplierECUFlashInformationApp ((uint16_t)(8)) /*FLASH版本号 FV:00.08*/
typedef struct
{
......
......@@ -10,16 +10,16 @@
typedef enum
{
PCM_Track_Index_Crash = 0U,
PCM_Track_Index_DoorOpen,
PCM_Track_Index_Key,
PCM_Track_Index_Crash = 0U,
PCM_Track_Index_DoorOpen,
PCM_Track_Index_Key,
PCM_Track_Index_OverSpeed,
PCM_Track_Index_OverSpeed_2S,
PCM_Track_Index_Seatbelta,
PCM_Track_Index_Warrning,
PCM_Track_Index_TICK,
PCM_Track_Index_OverSpeed_2S,
PCM_Track_Index_Seatbelta,
PCM_Track_Index_Warrning,
PCM_Track_Index_TICK,
PCM_Track_Index_TOCK,
PCM_Track_Index_MAX,
} PCM_Track_Index_en_t;
......
......@@ -26,10 +26,13 @@ typedef enum SoundName
SND_ROWS_SPEED , /*12 ROWS 警报 */
SND_Roll_SPEED , /*13 Roll 警报 */
SND_EVSC_SPEED , /*14 EVSC */
SND_DPD_SPEED , /*15 DPD 手动再生 */
SND_DPD_SPEED1 , /*15 DPD 手动再生 */
SND_DPD_SPEED2 , /*15 DPD 手动再生 */
SND_DPD_SPEED4 , /*15 DPD 手动再生 */
SND_NEES , /*16 NEES */
SND_ECO_STOP , /*17 eco stop */
SND_Cyclone_High , /*18 气悬车高调整 */
SND_Cyclone_High4HZ , /*18 气悬车高调整 */
SND_Cyclone_High0_5 , /*18 气悬车高调整 */
SND_SEATBELT_SPEED , /*19 安全带 */
SND_Fuel_Saving , /*20 省油耗建议 */
SND_TICK , /*21 转向 */
......@@ -83,10 +86,13 @@ static const SoundAttributeStruct SoundList[SND_INDEX_MAX] =
{/*12 SND_ROWS_SPEED */ SND_SRC_ROWS_SPEED , SND_TYPE_NORMAL, },
{/*13 SND_Roll_SPEED */ SND_SRC_Roll_SPEED , SND_TYPE_NORMAL, },
{/*14 SND_EVSC_SPEED */ SND_SRC_EVSC_SPEED , SND_TYPE_NORMAL, },
{/*15 SND_DPD_SPEED */ SND_SRC_DPD_SPEED , SND_TYPE_NORMAL, },
{/*15 SND_DPD_SPEED1 */ SND_SRC_DPD_SPEED1 , SND_TYPE_NORMAL, },
{/*15 SND_DPD_SPEED2 */ SND_SRC_DPD_SPEED2 , SND_TYPE_NORMAL, },
{/*15 SND_DPD_SPEED4 */ SND_SRC_DPD_SPEED4 , SND_TYPE_NORMAL, },
{/*16 SND_NEES */ SND_SRC_NEES , SND_TYPE_NORMAL, },
{/*17 SND_ECO_STOP */ SND_SRC_ECO_STOP , SND_TYPE_NORMAL, },
{/*18 SND_Cyclone_High */ SND_SRC_Cyclone_High , SND_TYPE_NORMAL, },
{/*18 SND_Cyclone_High4HZ */ SND_SRC_Cyclone_High4HZ , SND_TYPE_NORMAL, },
{/*18 SND_Cyclone_High0_5 */ SND_SRC_Cyclone_High0_5 , SND_TYPE_NORMAL, },
{/*19 SND_SEATBELT_SPEED */ SND_SRC_SEATBELT_SPEED , SND_TYPE_NORMAL, },
{/*20 SND_Fuel_Saving */ SND_SRC_Fuel_Saving , SND_TYPE_NORMAL, },
{/*21 SND_TICK */ SND_SRC_TICK , SND_TYPE_NORMAL, },
......
......@@ -8,6 +8,8 @@ uint8_t SoundEnableCode[SND_TOTAL_NUMBER];
SoundSchedulingStruct SoundScheduling;
/*SoundSeatbeltCtrlStruct SoundSeatbelt; */
extern SoundPlayCtrlStruct SoundPlayCtrl;
void Sound_Scheduler_Init(void)
{
uint8_t i;
......@@ -138,8 +140,17 @@ void Sound_Scheduling_Service(void)
if (SoundScheduling.Next < SND_TOTAL_NUMBER)
{
if (SoundScheduling.Current < SND_TOTAL_NUMBER) //如果当前有声音正在播放,则停止播放该声音
{
Sound_Stop(SoundList[SoundScheduling.Current].Src);
//当前声音未播完被打断,清空播放标记----20220107----
if (SoundPlayCtrl.Cycle != 0)
{
SoundEnableCode[SoundScheduling.Current] = 0;
}
//----20220107----
}
if (Sound_Play(SoundList[SoundScheduling.Next].Src) == 0) //如果请求的声音播放成功
{
SoundEnableCode[SoundScheduling.Next] = SoundScheduling.ReqCode; //声音已播放
......
......@@ -14,7 +14,7 @@ typedef struct
uint8_t StopReq;
} SoundSchedulingStruct;
/*
/*
#define SND_SEATBELT_120s_TIME 117000
......@@ -26,12 +26,12 @@ typedef struct
typedef struct
{
uint8_t DrMode;
uint8_t PaMode;
uint16_t DrTimer;
uint16_t PaTimer;
uint8_t DrMode;
uint8_t PaMode;
uint16_t DrTimer;
uint16_t PaTimer;
} SoundSeatbeltCtrlStruct;
*/
*/
......
......@@ -29,10 +29,13 @@ typedef enum
SND_SRC_ROWS_SPEED , /*12 ROWS 警报 */
SND_SRC_Roll_SPEED , /*13 Roll 警报 */
SND_SRC_EVSC_SPEED , /*14 EVSC */
SND_SRC_DPD_SPEED , /*15 DPD 手动再生 */
SND_SRC_DPD_SPEED1 , /*15 DPD 手动再生 */
SND_SRC_DPD_SPEED2 , /*15 DPD 手动再生 */
SND_SRC_DPD_SPEED4 , /*15 DPD 手动再生 */
SND_SRC_NEES , /*16 NEES */
SND_SRC_ECO_STOP , /*17 eco stop */
SND_SRC_Cyclone_High , /*18 气悬车高调整 */
SND_SRC_Cyclone_High4HZ , /*18 气悬车高调整 */
SND_SRC_Cyclone_High0_5 , /*18 气悬车高调整 */
SND_SRC_SEATBELT_SPEED , /*19 安全带 */
SND_SRC_Fuel_Saving , /*20 省油耗建议 */
SND_SRC_TICK , /*21 转向 */
......@@ -78,29 +81,32 @@ static const SndAttributeStruct SndAttributeTable[SND_SRC_INDEX_MAX] =
/*================================================================================================
音源名称 | 音源序号 | 优先级 | 循环次数 | 播放模式 | 周期(ms)
------------------------------------------------------------------------------------------------*/
{/*00 SND_SRC_Key_Notremoved */ BUZZER_Track_Index_Tic, 1, 1, SND_MODE_SINGLE, 100U, },
{/*01 SND_SRC_Braking */ BUZZER_Track_Index_Tic, 2, 1, SND_MODE_SINGLE, 100U, },
{/*02 SND_SRC_Air_Brake */ BUZZER_Track_Index_Tic, 3, 1, SND_MODE_SINGLE, 100U, },
{/*03 SND_SRC_BRAKE_LOCK */ BUZZER_Track_Index_Tic, 4, 1, SND_MODE_SINGLE, 100U, },
{/*04 SND_SRC_Parking_Brake */ BUZZER_Track_Index_Tic, 5, 1, SND_MODE_SINGLE, 100U, },
{/*05 SND_SRC_Car_Dump_SPEED */ BUZZER_Track_Index_Tic, 6, 1, SND_MODE_SINGLE, 100U, },
{/*06 SND_SRC_Temp_High */ BUZZER_Track_Index_Tic, 7, 1, SND_MODE_SINGLE, 100U, },
{/*07 SND_SRC_Coolant_Low */ BUZZER_Track_Index_Tic, 8, 1, SND_MODE_SINGLE, 100U, },
{/*08 SND_SRC_Oil_pressure_Low*/ BUZZER_Track_Index_Tic, 9, 1, SND_MODE_SINGLE, 100U, },
{/*09 SND_SRC_ACC_AIR */ BUZZER_Track_Index_Tic, 10, 1, SND_MODE_SINGLE, 100U, },
{/*10 SND_SRC_BackUP_SPEED */ BUZZER_Track_Index_Tic, 11, 1, SND_MODE_SINGLE, 100U, },
{/*11 SND_SRC_DS_SPEED */ BUZZER_Track_Index_Tic, 12, 1, SND_MODE_SINGLE, 100U, },
{/*12 SND_SRC_ROWS_SPEED */ BUZZER_Track_Index_Tic, 13, 1, SND_MODE_SINGLE, 100U, },
{/*13 SND_SRC_Roll_SPEED */ BUZZER_Track_Index_Tic, 14, 1, SND_MODE_SINGLE, 100U, },
{/*14 SND_SRC_EVSC_SPEED */ BUZZER_Track_Index_Tic, 15, 1, SND_MODE_SINGLE, 100U, },
{/*15 SND_SRC_DPD_SPEED */ BUZZER_Track_Index_Tic, 16, 1, SND_MODE_SINGLE, 100U, },
{/*16 SND_SRC_NEES */ BUZZER_Track_Index_Tic, 17, 1, SND_MODE_SINGLE, 100U, },
{/*17 SND_SRC_ECO_STOP */ BUZZER_Track_Index_Tic, 18, 1, SND_MODE_SINGLE, 100U, },
{/*18 SND_SRC_Cyclone_High */ BUZZER_Track_Index_Tic, 19, 1, SND_MODE_SINGLE, 100U, },
{/*19 SND_SRC_SEATBELT_SPEED */ BUZZER_Track_Index_Tic, 20, 1, SND_MODE_SINGLE, 100U, },
{/*20 SND_SRC_Fuel_Saving */ BUZZER_Track_Index_Tic, 21, 1, SND_MODE_SINGLE, 100U, },
{/*21 SND_SRC_TICK */ BUZZER_Track_Index_Tic, 22, 1, SND_MODE_SINGLE, 100U, },
{/*22 SND_SRC_TOCK */ BUZZER_Track_Index_Tac, 23, 1, SND_MODE_SINGLE, 100U, },
{/*00 SND_SRC_Key_Notremoved */ BUZZER_Track_Index_Tic, 1, 1, SND_MODE_SINGLE, 1000U, },/*00 1HZ 忘拔钥匙 */
{/*01 SND_SRC_Braking */ BUZZER_Track_Index_Tic, 2, 1, SND_MODE_SINGLE, 100U, },/*01 连续 制动 */
{/*02 SND_SRC_Air_Brake */ BUZZER_Track_Index_Tic, 3, 1, SND_MODE_SINGLE, 100U, },/*02 连续 制动气压 */
{/*03 SND_SRC_BRAKE_LOCK */ BUZZER_Track_Index_Tic, 4, 1, SND_MODE_SINGLE, 100U, },/*03 BRAKE LOCK */
{/*04 SND_SRC_Parking_Brake */ BUZZER_Track_Index_Tic, 5, 1, SND_MODE_SINGLE, 100U, },/*04 停车制动忘记复位*/
{/*05 SND_SRC_Car_Dump_SPEED */ BUZZER_Track_Index_Tic, 6, 1, SND_MODE_SINGLE, 100U, },/*05 车厢报警自卸蜂鸣器*/
{/*06 SND_SRC_Temp_High */ BUZZER_Track_Index_Tic, 7, 1, SND_MODE_SINGLE, 100U, },/*06 连续 水温过热 */
{/*07 SND_SRC_Coolant_Low */ BUZZER_Track_Index_Tic, 8, 1, SND_MODE_SINGLE, 100U, },/*07 连续 冷却水量 */
{/*08 SND_SRC_Oil_pressure_Low*/ BUZZER_Track_Index_Tic, 9, 1, SND_MODE_SINGLE, 100U, },/*08 -(预留:油压)*/
{/*09 SND_SRC_ACC_AIR */ BUZZER_Track_Index_Tic, 10, 1, SND_MODE_SINGLE, 100U, },/*09 连续 ACC AIR */
{/*10 SND_SRC_BackUP_SPEED */ BUZZER_Track_Index_Tic, 11, 1, SND_MODE_SINGLE, 1000U, },/*10 1HZ 倒车警报 */
{/*11 SND_SRC_DS_SPEED */ BUZZER_Track_Index_Tic, 12, 1, SND_MODE_SINGLE, 100U, },/*11 DS 警报 */
{/*12 SND_SRC_ROWS_SPEED */ BUZZER_Track_Index_Tic, 13, 1, SND_MODE_SINGLE, 100U, },/*12 ROWS 警报 */
{/*13 SND_SRC_Roll_SPEED */ BUZZER_Track_Index_Tic, 14, 1, SND_MODE_SINGLE, 100U, },/*13 Roll 警报 */
{/*14 SND_SRC_EVSC_SPEED */ BUZZER_Track_Index_Tic, 15, 1, SND_MODE_SINGLE, 100U, },/*14 4HZ EVSC */
{/*15 SND_SRC_DPD_SPEED */ BUZZER_Track_Index_Tic, 16, 1, SND_MODE_SINGLE, 100U, },/*15 1HZ 3 DPD 手动再生 */
{/*15 SND_SRC_DPD_SPEED */ BUZZER_Track_Index_Tic, 16, 1, SND_MODE_SINGLE, 100U, },/*15 2HZ 3 DPD 手动再生 */
{/*15 SND_SRC_DPD_SPEED */ BUZZER_Track_Index_Tic, 16, 1, SND_MODE_SINGLE, 100U, },/*15 4HZ 3 DPD 手动再生 */
{/*16 SND_SRC_NEES */ BUZZER_Track_Index_Tic, 17, 1, SND_MODE_SINGLE, 100U, },/*16 NEES */
{/*17 SND_SRC_ECO_STOP */ BUZZER_Track_Index_Tic, 18, 1, SND_MODE_SINGLE, 100U, },/*17 eco stop */
{/*18 SND_SRC_Cyclone_High */ BUZZER_Track_Index_Tic, 19, 1, SND_MODE_SINGLE, 100U, },/*18 4HZ 气悬车高调整 */
{/*18 SND_SRC_Cyclone_High */ BUZZER_Track_Index_Tic, 19, 1, SND_MODE_SINGLE, 100U, },/*18 0.5HZ 气悬车高调整 */
{/*19 SND_SRC_SEATBELT_SPEED */ BUZZER_Track_Index_Tic, 20, 1, SND_MODE_SINGLE, 100U, },/*19 2HZ 安全带 */
{/*20 SND_SRC_Fuel_Saving */ BUZZER_Track_Index_Tic, 21, 1, SND_MODE_SINGLE, 100U, },/*20 1HZ省油耗建议 */
{/*21 SND_SRC_TICK */ 0000u, 22, 1, SND_MODE_SINGLE, 100U, },
{/*22 SND_SRC_TOCK */ 0001u, 23, 1, SND_MODE_SINGLE, 100U, },
/*==============================================================================================*/
};
......
......@@ -56,7 +56,7 @@ void Snd_PCM_Track_Repeat_Play ( uint8_t TrackID, uint8_t Channel )
#if SND_SYS_PCM_CHANNEL_ENABLE
if ( ( TrackID >= PCM_TRACK_TOTAL_NUM ) || ( Channel > 4 ) )
return;
//I2S_MAX98357_InternalFlash_CH0_Player(PCMTrackAttrTable[TrackID].pPCMData, PCMTrackAttrTable[TrackID].Size , 0xFFFFU);
//I2S_MAX98357_InternalFlash_CH0_Player(PCMTrackAttrTable[TrackID].pPCMData, PCMTrackAttrTable[TrackID].Size , 0xFFFFU);
//Sound_System_Repeat_Play_PCM ( PCMTrackAttrTable[TrackID].pPCMData, PCMTrackAttrTable[TrackID].Size, Channel, PCMTrackAttrTable[TrackID].Gain );
#endif
}
......@@ -69,8 +69,8 @@ void Snd_PCM_Track_Repeat_Play ( uint8_t TrackID, uint8_t Channel )
void Snd_PCM_Track_Stop_Play ( uint8_t Channel )
{
#if SND_SYS_PCM_CHANNEL_ENABLE
// Sound_System_Stop_Play_PCM ( Channel );
// I2S_MAX98357_Stop( Channel);
// Sound_System_Stop_Play_PCM ( Channel );
// I2S_MAX98357_Stop( Channel);
#endif
}
......
......@@ -15,12 +15,12 @@
/* Includes ------------------------------------------------------------------*/
//#include "include.h"
// #include "Sound_System.h"
#include "TYW_stdint.h"
#ifndef SND_SYS_PCM_CHANNEL_ENABLE
// #include "Sound_System.h"
#include "TYW_stdint.h"
#ifndef SND_SYS_PCM_CHANNEL_ENABLE
#define SND_SYS_PCM_CHANNEL_ENABLE 1
#endif
......
This diff is collapsed.
......@@ -139,6 +139,7 @@ void Sys_Run_Mode_10ms_Tasks(void)
loc_Display_Service();
Data_Mileage_Write_EEPROM();
Line_In_Debounce_Service();
Popup_Alone_Sound_Server();
Telltales_Management();
// Test_LED_AllLight();
Key_Service();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment