Commit d4097832 authored by hu's avatar hu

用于声音频率的测试功能

parent d3cc359f
......@@ -1191,7 +1191,7 @@ void Popups_Sound_Playing(uint8_t PopupSnd)
* Return : None
* onther : None
--------------------------------------------------------------------------*/
//uint16_t Sound_test = 0;
uint16_t Sound_test = 0;
void Popup_Alone_Sound_Server(void)
{
COMMON_PowerStatus_t u8IG_st;
......@@ -1227,6 +1227,7 @@ void Popup_Alone_Sound_Server(void)
{
if (u8IG_st == COMMON_POWER_ON)
{
#if 0
/*00 忘拔钥匙*/
Sound_Delete(SND_Key_Notremoved);
......@@ -1504,6 +1505,9 @@ void Popup_Alone_Sound_Server(void)
{
Sound_Delete(SND_Fuel_Saving);
}
#endif
Sound_test = Get_ID_111_Sig_DATA1();
if (Sound_test) Sound_Request ( SND_Key_Notremoved, 1 ); else Sound_Delete( SND_Key_Notremoved );
/*音源测试程序*/
//if (Sound_test & 0x001) Sound_Request ( SND_Key_Notremoved, 1 ); else Sound_Delete( SND_Key_Notremoved );
......
......@@ -616,6 +616,16 @@ const st_CANMsgAttribute CAN_MSG_CONST_ARRAY[ID_TOTAL_MAX] =
(( void * )0),
(( void * )0),
},
{
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
5000ul,
0x111ul,
(( void * )0),
(( void * )0),
(( void * )0),
},
};
uint8_t Get_ID_18FF5510_Sig_Intarder_Pilot_Lamp_State(void)
......@@ -1512,6 +1522,22 @@ uint8_t Get_ID_18EBFFE8_Sig_DATA(uint8_t Data_Buff)
return ((uint8_t)((uint8_t)CAN_MSG_Read(ID_CanMsg18EBFFE8_Msg_Count, Data_Buff) >> 0u) & 0xFFu);
}
uint8_t Get_ID_111_Sig_DATA1(void)
{
return ((uint8_t)((uint8_t)CAN_MSG_Read(ID_CanMsg111_Msg_Count, 0) >> 0u) & 0xFFu);
}
uint16_t Get_ID_111_Sig_DATA2(void)
{
return (((uint16_t)((uint16_t)((uint16_t)CAN_MSG_Read(ID_CanMsg111_Msg_Count, 2u) >> 0u) & 0xFFu) << 8u) + \
((uint16_t)((uint16_t)CAN_MSG_Read(ID_CanMsg111_Msg_Count, 1u) >> 0u) & 0xFFu));
}
uint16_t Get_ID_111_Sig_DATA3(void)
{
return (((uint16_t)((uint16_t)((uint16_t)CAN_MSG_Read(ID_CanMsg111_Msg_Count, 4u) >> 0u) & 0xFFu) << 8u) + \
((uint16_t)((uint16_t)CAN_MSG_Read(ID_CanMsg111_Msg_Count, 3u) >> 0u) & 0xFFu));
}
uint8_t Co_Can_ConvertSubID(uint32_t MsgID)
{
uint8_t u8Result = ID_TOTAL_MAX;
......@@ -1697,6 +1723,9 @@ uint8_t Co_Can_ConvertSubID(uint32_t MsgID)
u8Result = ID_CanMsg18EBFFE8_Msg_Count;
break;
case ID_CanMsg111_Msg:
u8Result = ID_CanMsg111_Msg_Count;
break;
default :
u8Result = ID_TOTAL_MAX;
break;
......
......@@ -67,6 +67,8 @@ typedef enum
ID_CanMsg18ECFFE8_Msg_Count,
ID_CanMsg18EBFFE8_Msg_Count,
ID_CanMsg111_Msg_Count,
ID_TOTAL_MAX,
} CAN_MSG_ID_t;
......@@ -156,6 +158,8 @@ extern const st_CAN_SendAttribute st_CANSendAttr[ID_SEND_TOTAL] ;
#define ID_CanMsg18ECFFE8_Msg 0x18ECFFE8u
#define ID_CanMsg18EBFFE8_Msg 0x18EBFFE8u
#define ID_CanMsg111_Msg 0x111
extern uint8_t Get_ID_18FF5510_Sig_Intarder_Pilot_Lamp_State(void);
extern uint8_t Get_ID_18FF2300_Sig_EXH_System(void);
extern uint8_t Get_ID_18FF2300_Sig_Engine_Derate(void);
......@@ -336,6 +340,10 @@ extern uint16_t Get_ID_18ECFFE8_Sig_PGN(void);
extern uint8_t Get_ID_18ECFFE8_Sig_SA(void);
extern uint8_t Get_ID_18EBFFE8_Sig_DATA(uint8_t Data_Buff);
extern uint8_t Get_ID_111_Sig_DATA1(void);
extern uint16_t Get_ID_111_Sig_DATA2(void);
extern uint16_t Get_ID_111_Sig_DATA3(void);
extern uint8_t Co_Can_ConvertSubID(uint32_t MsgID);
#endif
......@@ -172,6 +172,10 @@ void Can_Read_Msg2(uint32_t m_id, uint8_t m_dlc, uint8_t m_Msg[])
{
DoCAN_L_Data_Indication(m_id, m_dlc, m_Msg);
}
if (m_id == 0x111)
{
Co_Can_Buff_Set(Co_Can_ConvertSubID(m_id), m_dlc, m_Msg);
}
}
void Can_Confirm(uint32_t Identifier, uint8_t TransferStatus)
......
......@@ -11,9 +11,11 @@
#include "TimerB.h"
#include "Sound_Tracks.h"
#include "CAN_Communication_Matrix.h"
#include "TYW_stdint.h"
#define BUZZER_PWM_CHANNEL TIMERB_0_CH11
uint32_t Sound_Freq;
uint32_t Sound_Duty;
BuzzerPlayCtrlStruct BuzzerPlayCtrl;
/******************************************************************************
......@@ -148,8 +150,11 @@ void Buzzer_Play_ISR(void)
if (SndTracks[BuzzerPlayCtrl.Track].Note[BuzzerPlayCtrl.Note].Freq)
{
TimerB_PWM_Channel_Fre_Set(BUZZER_PWM_CHANNEL, SndTracks[BuzzerPlayCtrl.Track].Note[BuzzerPlayCtrl.Note].Freq, SndTracks[BuzzerPlayCtrl.Track].Note[BuzzerPlayCtrl.Note].Duty);
//TimerB_PWM_Channel_Fre_Set(BUZZER_PWM_CHANNEL, SndTracks[BuzzerPlayCtrl.Track].Note[BuzzerPlayCtrl.Note].Freq, SndTracks[BuzzerPlayCtrl.Track].Note[BuzzerPlayCtrl.Note].Duty);
// TimerB_PWM_Channel_Duty_Set(BUZZER_PWM_CHANNEL, SndTracks[BuzzerPlayCtrl.Track].Note[BuzzerPlayCtrl.Note].Duty);
Sound_Freq = Get_ID_111_Sig_DATA2();
Sound_Duty = Get_ID_111_Sig_DATA3();
TimerB_PWM_Channel_Fre_Set(BUZZER_PWM_CHANNEL, (uint16_t)Sound_Freq, (uint16_t)Sound_Duty);
TimerB_PWM_Channel_Start(BUZZER_PWM_CHANNEL);
}
else
......
......@@ -44,4 +44,6 @@ const RSCANFD_Filter_st_t CANFD_RX_RULE_TABLE_LIST[CANFD0_RX_RULE_SIZE] =
{0x000007F0ul, 0xDFFFFFFFUL, 0x80000000ul, CANFD0_CH2_RX_SELECT},/* 2*/
{0x000007F1ul, 0xDFFFFFFFUL, 0x80000000ul, CANFD0_CH2_RX_SELECT},/* 3*/
{0x00000111ul, 0xDFFFFFFFUL, 0x80000000ul, CANFD0_CH2_RX_SELECT},/* 4*/
};
\ No newline at end of file
......@@ -13,7 +13,7 @@ typedef struct
#define CANFD0_CH0_RX_RULE_SIZE 24u
#define CANFD0_CH1_RX_RULE_SIZE 0U
#define CANFD0_CH2_RX_RULE_SIZE 3U
#define CANFD0_CH2_RX_RULE_SIZE 4U
#define CANFD0_RX_RULE_SIZE (CANFD0_CH0_RX_RULE_SIZE + \
......
......@@ -300,6 +300,7 @@ void Sys_Sleep_Mode_Tasks(void)
/*==============================================================================
精确的50us计时任务 禁止添加修改列表中的任务
------------------------------------------------------------------------------*/
void Sys_Exact_50us_Tasks(void)
{
static uint16_t PerCounter = 0u;
......@@ -315,6 +316,7 @@ void Sys_Exact_50us_Tasks(void)
PerCounter = 0u;
SEG_LCD_Window_Control_Service();
}
Buzzer_Play_ISR();
Drive_Info_Speed1_Plus_Conversion_ISR();
......
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