修复马达噪声,修复触摸BUG
This commit is contained in:
parent
9c1f7d86dc
commit
e6bd2998c6
@ -1,9 +1,9 @@
|
|||||||
#
|
#
|
||||||
#Tue Aug 20 14:39:42 CST 2024
|
#Sat Aug 24 10:49:00 CST 2024
|
||||||
mcal.com-microchip-mplab-nbide-toolchain-xc32-XC32LanguageToolchain.md5=1eaf555a844840d91945cb14109201c3
|
mcal.com-microchip-mplab-nbide-toolchain-xc32-XC32LanguageToolchain.md5=1eaf555a844840d91945cb14109201c3
|
||||||
conf.ids=mcal
|
conf.ids=mcal
|
||||||
mcal.languagetoolchain.version=4.10
|
mcal.languagetoolchain.version=4.10
|
||||||
host.id=10k5-yicy-7x
|
host.id=124p-5vo2-40
|
||||||
configurations-xml=82d12c4bf5f229226e945ddd8fae0eb3
|
configurations-xml=82d12c4bf5f229226e945ddd8fae0eb3
|
||||||
mcal.Pack.dfplocation=E\:\\Program Files\\Microchip\\MPLABX\\v6.20\\packs\\Microchip\\SAME51_DFP\\3.7.242
|
mcal.Pack.dfplocation=E\:\\Program Files\\Microchip\\MPLABX\\v6.20\\packs\\Microchip\\SAME51_DFP\\3.7.242
|
||||||
com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=f612087c95360c842296d189edfe3321
|
com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=f612087c95360c842296d189edfe3321
|
||||||
|
@ -685,7 +685,7 @@ uint8_t RTE_Get_TouchBoard_XY_Touch_And_Below_1N(void) // 0 false 1 true
|
|||||||
X_count++;
|
X_count++;
|
||||||
}
|
}
|
||||||
// 触发的通道数量 //连续触发的通道数量
|
// 触发的通道数量 //连续触发的通道数量
|
||||||
if ((Two_Finger_Y_count > 4 && Two_Finger_X_data[0]>th_x[0]) || Y_count != Two_Finger_Y_count || Two_Finger_X_count > 4 || X_count == Two_Finger_X_count)
|
if ((Two_Finger_Y_count > 4 && Two_Finger_X_data[0]>th_x[0]) || Y_count != Two_Finger_Y_count || Two_Finger_X_count > 4 || X_count != Two_Finger_X_count)
|
||||||
{
|
{
|
||||||
//满足防误触
|
//满足防误触
|
||||||
Allow_Touch_counter++;
|
Allow_Touch_counter++;
|
||||||
@ -1395,6 +1395,7 @@ void RTE_Set_All_Test_Value(void)
|
|||||||
{
|
{
|
||||||
baseline_error_repeat_counter = 55000; // 110S
|
baseline_error_repeat_counter = 55000; // 110S
|
||||||
ADC0_Initialize();
|
ADC0_Initialize();
|
||||||
|
ADC0_Enable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -167,6 +167,8 @@ void speaker_MainTask(void)
|
|||||||
//SA51024_Set_State(SA51024_STOP,speaker_ctrl_buf_str.strenght);
|
//SA51024_Set_State(SA51024_STOP,speaker_ctrl_buf_str.strenght);
|
||||||
PORT_PinWrite(PORT_PIN_PA13,0);/*SHUTDOWN = 1,turn on chip*/
|
PORT_PinWrite(PORT_PIN_PA13,0);/*SHUTDOWN = 1,turn on chip*/
|
||||||
PORT_PinWrite(PORT_PIN_PA25,0);
|
PORT_PinWrite(PORT_PIN_PA25,0);
|
||||||
|
PORT_PinPeripheralFunctionConfig(PORT_PIN_PA02,PERIPHERAL_FUNCTION_B);
|
||||||
|
DAC_REGS->DAC_CTRLA |= DAC_CTRLA_ENABLE_Msk;
|
||||||
speaker_set_strenght(SA51024_STRENGTH_LEVEL0);
|
speaker_set_strenght(SA51024_STRENGTH_LEVEL0);
|
||||||
speaker_main_state_str = SPEAKER_INIT_CYCLE;
|
speaker_main_state_str = SPEAKER_INIT_CYCLE;
|
||||||
speaker_cycle_u16 = 0;
|
speaker_cycle_u16 = 0;
|
||||||
@ -179,7 +181,7 @@ void speaker_MainTask(void)
|
|||||||
|
|
||||||
if(speaker_cycle_u16++ >= ((SPEAKER_INTERVAL_CYCLE_TIMES)/(SPEAKER_TASK_PERIOD)))
|
if(speaker_cycle_u16++ >= ((SPEAKER_INTERVAL_CYCLE_TIMES)/(SPEAKER_TASK_PERIOD)))
|
||||||
{
|
{
|
||||||
DAC_REGS->DAC_CTRLA &= ~DAC_CTRLA_ENABLE_Msk;
|
//DAC_REGS->DAC_CTRLA &= ~DAC_CTRLA_ENABLE_Msk;
|
||||||
PORT_PinGPIOConfig(PORT_PIN_PA02);
|
PORT_PinGPIOConfig(PORT_PIN_PA02);
|
||||||
speaker_main_state_str = SPEAKER_IDLE;
|
speaker_main_state_str = SPEAKER_IDLE;
|
||||||
}
|
}
|
||||||
@ -212,9 +214,9 @@ void speaker_MainTask(void)
|
|||||||
|
|
||||||
case SPEAKER_START:
|
case SPEAKER_START:
|
||||||
{
|
{
|
||||||
PORT_PinPeripheralFunctionConfig(PORT_PIN_PA02,PERIPHERAL_FUNCTION_B);
|
|
||||||
PORT_PinWrite(PORT_PIN_PA25,0);
|
PORT_PinWrite(PORT_PIN_PA25,0);
|
||||||
DAC_REGS->DAC_CTRLA |= DAC_CTRLA_ENABLE_Msk;
|
|
||||||
SA51024_Set_State(SA51024_WORKING,speaker_ctrl_buf_str.strenght);
|
SA51024_Set_State(SA51024_WORKING,speaker_ctrl_buf_str.strenght);
|
||||||
speaker_cycle_u16 = 0;
|
speaker_cycle_u16 = 0;
|
||||||
speaker_main_state_str = SPEAKER_UPDATE_CYCLE;
|
speaker_main_state_str = SPEAKER_UPDATE_CYCLE;
|
||||||
@ -248,7 +250,7 @@ void speaker_MainTask(void)
|
|||||||
|
|
||||||
/* Disable DAC */
|
/* Disable DAC */
|
||||||
// DAC_REGS->DAC_CTRLA &= ~DAC_CTRLA_ENABLE_Msk;
|
// DAC_REGS->DAC_CTRLA &= ~DAC_CTRLA_ENABLE_Msk;
|
||||||
PORT_PinGPIOConfig(PORT_PIN_PA02);
|
//PORT_PinGPIOConfig(PORT_PIN_PA02);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
#include "math.h"
|
#include "math.h"
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
|
|
||||||
|
|
||||||
#include <stddef.h> // Defines NULL
|
#include <stddef.h> // Defines NULL
|
||||||
#include <stdbool.h> // Defines true
|
#include <stdbool.h> // Defines true
|
||||||
#include <stdlib.h> // Defines EXIT_FAILURE
|
#include <stdlib.h> // Defines EXIT_FAILURE
|
||||||
@ -22,13 +21,10 @@
|
|||||||
#include "smartee.h"
|
#include "smartee.h"
|
||||||
#include "SysDiagDetect.h"
|
#include "SysDiagDetect.h"
|
||||||
|
|
||||||
|
|
||||||
static uint16 sensor_signal[DEF_NUM_CHANNELS] = {0};
|
|
||||||
static uint16 sensor_reference[DEF_NUM_CHANNELS] = {0};
|
|
||||||
static TouchButtons_type key_status[BTN_MAX_CH_NUM - 5U] = {0};
|
static TouchButtons_type key_status[BTN_MAX_CH_NUM - 5U] = {0};
|
||||||
static TouchSurface_type TouchSurface;
|
static TouchSurface_type TouchSurface;
|
||||||
static Buttons_SignalType Buttons_Signal[BTN_MAX_CH_NUM] = {BUTTON_RELEASE};
|
static Buttons_SignalType Buttons_Signal[BTN_MAX_CH_NUM] = {BUTTON_RELEASE};
|
||||||
static TouchSlideEvent_type TouchSlideEvent;
|
|
||||||
TouchSurface_Convert_type Surface_Convert;
|
TouchSurface_Convert_type Surface_Convert;
|
||||||
static PanelPress_LevelType TouchPanel_PressLevel = PANEL_PRESS_LEVEL0;
|
static PanelPress_LevelType TouchPanel_PressLevel = PANEL_PRESS_LEVEL0;
|
||||||
static float32 TouchPanel_PressNValue = 0.0f; // 0N
|
static float32 TouchPanel_PressNValue = 0.0f; // 0N
|
||||||
@ -45,17 +41,13 @@ volatile uint8 last_Vibra_force_level=0;
|
|||||||
volatile uint8 Over3N_vibra_req = 0x00;
|
volatile uint8 Over3N_vibra_req = 0x00;
|
||||||
volatile uint8 Below1P5N_vibra_req = 0x00;
|
volatile uint8 Below1P5N_vibra_req = 0x00;
|
||||||
|
|
||||||
|
|
||||||
uint8 UDS_Vibration_Gain = 0;
|
uint8 UDS_Vibration_Gain = 0;
|
||||||
uint8 UDS_DAC_Timer_Period = 80;
|
uint8 UDS_DAC_Timer_Period = 80;
|
||||||
uint8 Touch_Flag = TOUCH_KET_OFF;
|
uint8 Touch_Flag = TOUCH_KET_OFF;
|
||||||
|
|
||||||
|
|
||||||
uint8 CurrentPosition = 0xff; // 0xff no position 1:fun1 2:fun2 3:fun3 4:up 5:down 6:left 7:right 8:ok
|
uint8 CurrentPosition = 0xff; // 0xff no position 1:fun1 2:fun2 3:fun3 4:up 5:down 6:left 7:right 8:ok
|
||||||
uint8 Surface_Button = 0xff;
|
uint8 Surface_Button = 0xff;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define RESUME1_DEFAULT 339
|
#define RESUME1_DEFAULT 339
|
||||||
#define ADAS1_DEFAULT 412
|
#define ADAS1_DEFAULT 412
|
||||||
#define CANCEL1_DEFAULT 576
|
#define CANCEL1_DEFAULT 576
|
||||||
@ -354,14 +346,6 @@ static uint16 Button10_GetBTN_CONFIRM_Release_Threshold(void)
|
|||||||
return rtn;
|
return rtn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Sets buffers to a specified byte value.
|
* \brief Sets buffers to a specified byte value.
|
||||||
* \param pDestP buffer with set value
|
* \param pDestP buffer with set value
|
||||||
@ -399,14 +383,18 @@ static float32 AlideAverage_Filter(uint8 mode, float32 RawData)
|
|||||||
uint16 i;
|
uint16 i;
|
||||||
float32 Sum = 0;
|
float32 Sum = 0;
|
||||||
float32 AverageValue = 0;
|
float32 AverageValue = 0;
|
||||||
if(mode == 0x00){
|
if (mode == 0x00)
|
||||||
|
{
|
||||||
CalcAverageNum = 0;
|
CalcAverageNum = 0;
|
||||||
DIndex = 0;
|
DIndex = 0;
|
||||||
Mode_Status = 0;
|
Mode_Status = 0;
|
||||||
for(i=0; i<MAX_ALIDE_AVG_NUM; i++){
|
for (i = 0; i < MAX_ALIDE_AVG_NUM; i++)
|
||||||
|
{
|
||||||
RawData_Table[i] = 0.0f;
|
RawData_Table[i] = 0.0f;
|
||||||
}
|
}
|
||||||
}else{
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if (Mode_Status == 0x00)
|
if (Mode_Status == 0x00)
|
||||||
{
|
{
|
||||||
if (CalcAverageNum < MAX_ALIDE_AVG_NUM)
|
if (CalcAverageNum < MAX_ALIDE_AVG_NUM)
|
||||||
@ -427,7 +415,8 @@ static float32 AlideAverage_Filter(uint8 mode, float32 RawData)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
RawData_Table[DIndex++] = RawData;
|
RawData_Table[DIndex++] = RawData;
|
||||||
if(DIndex >= MAX_ALIDE_AVG_NUM){
|
if (DIndex >= MAX_ALIDE_AVG_NUM)
|
||||||
|
{
|
||||||
DIndex = 0x00;
|
DIndex = 0x00;
|
||||||
}
|
}
|
||||||
for (i = 0; i < MAX_ALIDE_AVG_NUM; i++)
|
for (i = 0; i < MAX_ALIDE_AVG_NUM; i++)
|
||||||
@ -440,20 +429,19 @@ static float32 AlideAverage_Filter(uint8 mode, float32 RawData)
|
|||||||
return AverageValue;
|
return AverageValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TouchPanel_init(void)
|
void TouchPanel_init(void)
|
||||||
{
|
{
|
||||||
uint8 index;
|
uint8 index;
|
||||||
// touch_init();
|
// touch_init();
|
||||||
uint8_t eedata[5];
|
uint8_t eedata[5];
|
||||||
LIB_Mem_MemSet(&TouchSurface, 0x00U, sizeof(TouchSurface_type));
|
LIB_Mem_MemSet(&TouchSurface, 0x00U, sizeof(TouchSurface_type));
|
||||||
LIB_Mem_MemSet(&TouchSlideEvent, 0x00U, sizeof(TouchSlideEvent_type));
|
|
||||||
LIB_Mem_MemSet(&Surface_Convert, 0x00U, sizeof(TouchSurface_Convert_type));
|
LIB_Mem_MemSet(&Surface_Convert, 0x00U, sizeof(TouchSurface_Convert_type));
|
||||||
SmartEE_Read(0x780, eedata, 3);
|
SmartEE_Read(0x780, eedata, 3);
|
||||||
if (eedata[0] < 4)
|
if (eedata[0] < 4)
|
||||||
{
|
{
|
||||||
UDS_Vibration_Gain = eedata[0];
|
UDS_Vibration_Gain = eedata[0];
|
||||||
}else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
UDS_Vibration_Gain = SA51024_STRENGTH_LEVEL0;
|
UDS_Vibration_Gain = SA51024_STRENGTH_LEVEL0;
|
||||||
}
|
}
|
||||||
@ -473,13 +461,13 @@ void TouchPanel_init(void)
|
|||||||
TouchPanel_PressRawData = 0;
|
TouchPanel_PressRawData = 0;
|
||||||
for (index = 0; index < DEF_NUM_CHANNELS; index++)
|
for (index = 0; index < DEF_NUM_CHANNELS; index++)
|
||||||
{
|
{
|
||||||
sensor_signal[index] = 0x00;
|
if (index < (BTN_MAX_CH_NUM - 5u))
|
||||||
sensor_reference[index] = 0x00;
|
{
|
||||||
if(index < (BTN_MAX_CH_NUM-5u)){
|
|
||||||
key_status[index].status = 0x00;
|
key_status[index].status = 0x00;
|
||||||
key_status[index].RunCycle = 0x00;
|
key_status[index].RunCycle = 0x00;
|
||||||
}
|
}
|
||||||
if(index < BTN_MAX_CH_NUM ){
|
if (index < BTN_MAX_CH_NUM)
|
||||||
|
{
|
||||||
Buttons_Signal[index] = BUTTON_RELEASE;
|
Buttons_Signal[index] = BUTTON_RELEASE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -487,23 +475,20 @@ void TouchPanel_init(void)
|
|||||||
|
|
||||||
void GetSurface_Position(uint8 *x, uint8 *y)
|
void GetSurface_Position(uint8 *x, uint8 *y)
|
||||||
{
|
{
|
||||||
if(x != NULL_PTR){
|
if (x != NULL_PTR)
|
||||||
|
{
|
||||||
*x = Surface_Convert.convert_x;
|
*x = Surface_Convert.convert_x;
|
||||||
}
|
}
|
||||||
if(y != NULL_PTR){
|
if (y != NULL_PTR)
|
||||||
|
{
|
||||||
*y = Surface_Convert.convert_y;
|
*y = Surface_Convert.convert_y;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TP_SlideDirection_Enum TouchPanel_SlideEventRead(void)
|
TP_SlideDirection_Enum TouchPanel_SlideEventRead(void)
|
||||||
{
|
{
|
||||||
TP_SlideDirection_Enum Dir = TP_SlideDirection_NONE;
|
TP_SlideDirection_Enum Dir = TP_SlideDirection_NONE;
|
||||||
if(TouchSlideEvent.Event == TRUE){
|
|
||||||
Dir = TouchSlideEvent.Direction;
|
|
||||||
//TouchSlideEvent.Event = FALSE;
|
|
||||||
}
|
|
||||||
return Dir;
|
return Dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -527,7 +512,7 @@ PanelPress_LevelType TouchPanel_PressLevelRead(void)
|
|||||||
boolean TouchSurface_is_TouchActive(void)
|
boolean TouchSurface_is_TouchActive(void)
|
||||||
{
|
{
|
||||||
boolean ret = FALSE;
|
boolean ret = FALSE;
|
||||||
if (TouchPanel_SurfaceStatus & TOUCH_ACTIVE)
|
if (TouchPanel_SurfaceStatus & TOUCH_ACTIVE && CurrentPosition>0 && CurrentPosition<9)
|
||||||
{
|
{
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
}
|
}
|
||||||
@ -539,7 +524,7 @@ Buttons_SignalType TouchSurface_XY_StsRead(void)
|
|||||||
{
|
{
|
||||||
Buttons_SignalType XY_Sts = BUTTON_RELEASE;
|
Buttons_SignalType XY_Sts = BUTTON_RELEASE;
|
||||||
|
|
||||||
if (TouchPanel_SurfaceStatus & TOUCH_ACTIVE)
|
if (TouchPanel_SurfaceStatus & TOUCH_ACTIVE && CurrentPosition>0 && CurrentPosition<9)
|
||||||
{
|
{
|
||||||
|
|
||||||
switch (TouchPanel_PressLevel)
|
switch (TouchPanel_PressLevel)
|
||||||
@ -556,16 +541,11 @@ Buttons_SignalType TouchSurface_XY_StsRead(void)
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return XY_Sts;
|
return XY_Sts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static PanelPress_LevelType TouchPanel_PressCheck(void)
|
static PanelPress_LevelType TouchPanel_PressCheck(void)
|
||||||
{
|
{
|
||||||
// static uint16 ForceHcount = 0;
|
// static uint16 ForceHcount = 0;
|
||||||
@ -597,7 +577,10 @@ static PanelPress_LevelType TouchPanel_PressCheck(void)
|
|||||||
tempForceRelease = g_Release_Threshold;
|
tempForceRelease = g_Release_Threshold;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Last_PressLevel > PANEL_PRESS_LEVEL2){ Last_PressLevel = PANEL_PRESS_LEVEL0;}
|
if (Last_PressLevel > PANEL_PRESS_LEVEL2)
|
||||||
|
{
|
||||||
|
Last_PressLevel = PANEL_PRESS_LEVEL0;
|
||||||
|
}
|
||||||
////if(TRUE == GET_TouchPanel_is_Press())
|
////if(TRUE == GET_TouchPanel_is_Press())
|
||||||
temp_RawData = (0xfff & Get_forcedetect_force_value());
|
temp_RawData = (0xfff & Get_forcedetect_force_value());
|
||||||
if (SPEAKER_UPDATE_CYCLE == Get_Speaker_Main_State() || SPEAKER_START == Get_Speaker_Main_State())
|
if (SPEAKER_UPDATE_CYCLE == Get_Speaker_Main_State() || SPEAKER_START == Get_Speaker_Main_State())
|
||||||
@ -609,7 +592,9 @@ static PanelPress_LevelType TouchPanel_PressCheck(void)
|
|||||||
if (temp_RawData & 0x800) // negative
|
if (temp_RawData & 0x800) // negative
|
||||||
{
|
{
|
||||||
RawData = 0x00;
|
RawData = 0x00;
|
||||||
}else{
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
RawData = temp_RawData;
|
RawData = temp_RawData;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -625,7 +610,8 @@ static PanelPress_LevelType TouchPanel_PressCheck(void)
|
|||||||
|
|
||||||
if (Force_Sens_Err == 0)
|
if (Force_Sens_Err == 0)
|
||||||
{
|
{
|
||||||
if(FilterValue <= ((float32)tempForceRelease/ (float32)0xF2)){//< 1.5N
|
if (FilterValue <= ((float32)tempForceRelease / (float32)0xF2))
|
||||||
|
{ //< 1.5N
|
||||||
// ForceHcount = 0;
|
// ForceHcount = 0;
|
||||||
// ForceMcount = 0;
|
// ForceMcount = 0;
|
||||||
// ForceLcount++;
|
// ForceLcount++;
|
||||||
@ -636,13 +622,13 @@ static PanelPress_LevelType TouchPanel_PressCheck(void)
|
|||||||
|
|
||||||
ret_Press = PANEL_PRESS_LEVEL0;
|
ret_Press = PANEL_PRESS_LEVEL0;
|
||||||
|
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
Vibra_force_level = PANEL_PRESS_LEVEL0;
|
Vibra_force_level = PANEL_PRESS_LEVEL0;
|
||||||
}
|
}
|
||||||
else if (FilterValue >= ((float32)tempForceRelease / (float32)0xF2) &&
|
else if (FilterValue >= ((float32)tempForceRelease / (float32)0xF2) &&
|
||||||
FilterValue < ((float32)tempForcePress/ (float32)0xF2)){//1.5N~~3N
|
FilterValue < ((float32)tempForcePress / (float32)0xF2))
|
||||||
|
{ // 1.5N~~3N
|
||||||
// ForceHcount = 0;
|
// ForceHcount = 0;
|
||||||
// ForceMcount++;
|
// ForceMcount++;
|
||||||
// ForceLcount = 0;
|
// ForceLcount = 0;
|
||||||
@ -679,8 +665,8 @@ static PanelPress_LevelType TouchPanel_PressCheck(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else
|
||||||
else {//>=3
|
{ //>=3
|
||||||
// ForceHcount++;
|
// ForceHcount++;
|
||||||
// ForceMcount = 0;
|
// ForceMcount = 0;
|
||||||
// ForceLcount = 0;
|
// ForceLcount = 0;
|
||||||
@ -705,7 +691,8 @@ static PanelPress_LevelType TouchPanel_PressCheck(void)
|
|||||||
}
|
}
|
||||||
else // backup When force sensor error happened
|
else // backup When force sensor error happened
|
||||||
{
|
{
|
||||||
if(Backup_Force_Value <= 100){//< 1.5N
|
if (Backup_Force_Value <= 100)
|
||||||
|
{ //< 1.5N
|
||||||
// ForceHcount = 0;
|
// ForceHcount = 0;
|
||||||
// ForceMcount = 0;
|
// ForceMcount = 0;
|
||||||
// ForceLcount++;
|
// ForceLcount++;
|
||||||
@ -716,13 +703,13 @@ static PanelPress_LevelType TouchPanel_PressCheck(void)
|
|||||||
|
|
||||||
ret_Press = PANEL_PRESS_LEVEL0;
|
ret_Press = PANEL_PRESS_LEVEL0;
|
||||||
|
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
Vibra_force_level = PANEL_PRESS_LEVEL0;
|
Vibra_force_level = PANEL_PRESS_LEVEL0;
|
||||||
}
|
}
|
||||||
else if (Backup_Force_Value >= 100 &&
|
else if (Backup_Force_Value >= 100 &&
|
||||||
Backup_Force_Value < 200){//1.5N~~3N
|
Backup_Force_Value < 200)
|
||||||
|
{ // 1.5N~~3N
|
||||||
// ForceHcount = 0;
|
// ForceHcount = 0;
|
||||||
// ForceMcount++;
|
// ForceMcount++;
|
||||||
// ForceLcount = 0;
|
// ForceLcount = 0;
|
||||||
@ -759,8 +746,8 @@ static PanelPress_LevelType TouchPanel_PressCheck(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else
|
||||||
else {//>=3
|
{ //>=3
|
||||||
// ForceHcount++;
|
// ForceHcount++;
|
||||||
// ForceMcount = 0;
|
// ForceMcount = 0;
|
||||||
// ForceLcount = 0;
|
// ForceLcount = 0;
|
||||||
@ -787,11 +774,6 @@ static PanelPress_LevelType TouchPanel_PressCheck(void)
|
|||||||
LastRawData = RawData;
|
LastRawData = RawData;
|
||||||
Last_PressLevel = ret_Press;
|
Last_PressLevel = ret_Press;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return ret_Press;
|
return ret_Press;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -834,7 +816,8 @@ static Buttons_SignalType TouchSurface_BntCheck(Buttons_ChType ChId, TouchPanel_
|
|||||||
data_ready = 0x01;
|
data_ready = 0x01;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default: break;
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data_ready != 0x00)
|
if (data_ready != 0x00)
|
||||||
@ -856,10 +839,9 @@ static Buttons_SignalType TouchSurface_BntCheck(Buttons_ChType ChId, TouchPanel_
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else if (TP_Event == TOUCH_PANEL_BERR_EVENT)
|
||||||
|
{
|
||||||
}else if(TP_Event == TOUCH_PANEL_BERR_EVENT){
|
|
||||||
BSignal = BUTTON_RELEASE; //////////////BUTTON_INVALID;
|
BSignal = BUTTON_RELEASE; //////////////BUTTON_INVALID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -879,13 +861,17 @@ static Buttons_SignalType TouchButton_BntCheck(Buttons_ChType ChId)
|
|||||||
key_status[ChId].status = (get_sensor_state(ChId) == QTM_KEY_STATE_DETECT || get_sensor_state(ChId + 13) == QTM_KEY_STATE_DETECT) ? QTM_KEY_STATE_DETECT : get_sensor_state(ChId);
|
key_status[ChId].status = (get_sensor_state(ChId) == QTM_KEY_STATE_DETECT || get_sensor_state(ChId + 13) == QTM_KEY_STATE_DETECT) ? QTM_KEY_STATE_DETECT : get_sensor_state(ChId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (QTM_KEY_STATE_DETECT == (key_status[ChId].status)) {//KEY_TOUCHED_MASK
|
if (QTM_KEY_STATE_DETECT == (key_status[ChId].status))
|
||||||
|
{ // KEY_TOUCHED_MASK
|
||||||
// Touch detect
|
// Touch detect
|
||||||
key_status[ChId].RunCycle++;
|
key_status[ChId].RunCycle++;
|
||||||
if(TP_RUNNING_ERROR_CYCLE <= key_status[ChId].RunCycle){
|
if (TP_RUNNING_ERROR_CYCLE <= key_status[ChId].RunCycle)
|
||||||
|
{
|
||||||
key_status[ChId].RunCycle = TP_RUNNING_ERROR_CYCLE;
|
key_status[ChId].RunCycle = TP_RUNNING_ERROR_CYCLE;
|
||||||
BSignal = BUTTON_RELEASE; // BUTTON_INVALID;
|
BSignal = BUTTON_RELEASE; // BUTTON_INVALID;
|
||||||
}else{
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
if (Force_Sens_Err == 0)
|
if (Force_Sens_Err == 0)
|
||||||
{
|
{
|
||||||
@ -908,9 +894,10 @@ static Buttons_SignalType TouchButton_BntCheck(Buttons_ChType ChId)
|
|||||||
{
|
{
|
||||||
BSignal = BUTTON_TOUCH;
|
BSignal = BUTTON_TOUCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// Touch No detect
|
// Touch No detect
|
||||||
key_status[ChId].RunCycle = 0x00;
|
key_status[ChId].RunCycle = 0x00;
|
||||||
}
|
}
|
||||||
@ -933,75 +920,25 @@ static float32 GetSlide_Angle(float32 dx, float32 dy)
|
|||||||
static TP_SlideDirection_Enum GetSlide_Direction(uint8 startX, uint8 startY, uint8 endX, uint8 endY)
|
static TP_SlideDirection_Enum GetSlide_Direction(uint8 startX, uint8 startY, uint8 endX, uint8 endY)
|
||||||
{
|
{
|
||||||
TP_SlideDirection_Enum result = TP_SlideDirection_NONE;
|
TP_SlideDirection_Enum result = TP_SlideDirection_NONE;
|
||||||
sint32 CoordMapping_sx,CoordMapping_sy;
|
|
||||||
sint32 CoordMapping_ex,CoordMapping_ey;
|
|
||||||
uint16 absx,absy;
|
|
||||||
sint32 dy,dx;
|
|
||||||
float32 angle;
|
|
||||||
|
|
||||||
CoordMapping_sx = (-1u * (sint32)startX);
|
|
||||||
CoordMapping_sy = (-1u * (sint32)startY);
|
|
||||||
CoordMapping_ex = (-1u * (sint32)endX);
|
|
||||||
CoordMapping_ey = (-1u * (sint32)(endY));
|
|
||||||
dx = CoordMapping_ex - CoordMapping_sx;
|
|
||||||
dy = CoordMapping_ey - CoordMapping_sy;
|
|
||||||
|
|
||||||
absx = abs(dx);
|
|
||||||
absy = abs(dy);
|
|
||||||
if(TouchSurface.Event == TOUCH_PANEL_MOVE_EVENT && (absx > SLIDE_LR_MIN_DISTANCE || absy > SLIDE_UD_MIN_DISTANCE) )
|
|
||||||
{
|
|
||||||
/*Ignore small Slide*/
|
|
||||||
angle = GetSlide_Angle(dx, dy);
|
|
||||||
if (angle >= -45.0 && angle < 45.0)
|
|
||||||
{
|
|
||||||
if(absx > SLIDE_LR_SHORT_DISTANCE_NUM){
|
|
||||||
result = TP_SlideDirection_LongRIGHT;
|
|
||||||
}else{
|
|
||||||
result = TP_SlideDirection_ShortRIGHT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (angle >= 45.0 && angle < 135.0)
|
|
||||||
{
|
|
||||||
if(absy > SLIDE_UD_SHORT_DISTANCE_NUM){
|
|
||||||
result = TP_SlideDirection_LongUP;
|
|
||||||
}else{
|
|
||||||
result = TP_SlideDirection_ShortUP;
|
|
||||||
}
|
|
||||||
} else if (angle >= -135.0 && angle < -45.0)
|
|
||||||
{
|
|
||||||
if(absy > SLIDE_UD_SHORT_DISTANCE_NUM){
|
|
||||||
result = TP_SlideDirection_LongDOWN;
|
|
||||||
}else{
|
|
||||||
result = TP_SlideDirection_ShortDOWN;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if ((angle >= 135.0 && angle <= 180.0) || (angle >= -180.0 && angle < -135.0))
|
|
||||||
{
|
|
||||||
if(absx > SLIDE_LR_SHORT_DISTANCE_NUM){
|
|
||||||
result = TP_SlideDirection_LongLEFT;
|
|
||||||
}else{
|
|
||||||
result = TP_SlideDirection_ShortLEFT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct Point
|
||||||
|
{
|
||||||
struct Point {
|
|
||||||
float x;
|
float x;
|
||||||
float y;
|
float y;
|
||||||
};
|
};
|
||||||
|
|
||||||
// ~{EP6OR;8v5cJG7qTZH}=GPNDZ2?~}
|
// ~{EP6OR;8v5cJG7qTZH}=GPNDZ2?~}
|
||||||
uint8_t point_in_triangle(struct Point p, struct Point p1, struct Point p2, struct Point p3) {
|
uint8_t point_in_triangle(struct Point p, struct Point p1, struct Point p2, struct Point p3)
|
||||||
|
{
|
||||||
float s = p1.y * p3.x - p1.x * p3.y + (p3.y - p1.y) * p.x + (p1.x - p3.x) * p.y;
|
float s = p1.y * p3.x - p1.x * p3.y + (p3.y - p1.y) * p.x + (p1.x - p3.x) * p.y;
|
||||||
float t = p1.x * p2.y - p1.y * p2.x + (p1.y - p2.y) * p.x + (p2.x - p1.x) * p.y;
|
float t = p1.x * p2.y - p1.y * p2.x + (p1.y - p2.y) * p.x + (p2.x - p1.x) * p.y;
|
||||||
if ((s < 0) != (t < 0)) return 0;
|
if ((s < 0) != (t < 0))
|
||||||
|
return 0;
|
||||||
float A = -p2.y * p3.x + p1.y * (p3.x - p2.x) + p1.x * (p2.y - p3.y) + p2.x * p3.y;
|
float A = -p2.y * p3.x + p1.y * (p3.x - p2.x) + p1.x * (p2.y - p3.y) + p2.x * p3.y;
|
||||||
if (A < 0.0) {
|
if (A < 0.0)
|
||||||
|
{
|
||||||
s = -s;
|
s = -s;
|
||||||
t = -t;
|
t = -t;
|
||||||
A = -A;
|
A = -A;
|
||||||
@ -1010,7 +947,8 @@ uint8_t point_in_triangle(struct Point p, struct Point p1, struct Point p2, stru
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ~{EP6OR;8v5cJG7qTZKD1_PNDZ2?~}
|
// ~{EP6OR;8v5cJG7qTZKD1_PNDZ2?~}
|
||||||
uint8_t point_in_quadrilateral(struct Point p, struct Point q1, struct Point q2, struct Point q3, struct Point q4) {
|
uint8_t point_in_quadrilateral(struct Point p, struct Point q1, struct Point q2, struct Point q3, struct Point q4)
|
||||||
|
{
|
||||||
return point_in_triangle(p, q1, q2, q3) || point_in_triangle(p, q1, q3, q4);
|
return point_in_triangle(p, q1, q2, q3) || point_in_triangle(p, q1, q3, q4);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1029,9 +967,14 @@ static void TouchPanel_XY_Convert(uint8 origin_x, uint8 origin_y)
|
|||||||
float32 f_x;
|
float32 f_x;
|
||||||
temp_x = origin_y;
|
temp_x = origin_y;
|
||||||
f_x = (((float32)temp_x) / (255.0f / 160.0f)); // 255u-95u
|
f_x = (((float32)temp_x) / (255.0f / 160.0f)); // 255u-95u
|
||||||
if(f_x - (uint32)(f_x) < 0.5f){
|
if (f_x - (uint32)(f_x) < 0.5f)
|
||||||
|
{
|
||||||
convert_x = (uint8)f_x + 95u;
|
convert_x = (uint8)f_x + 95u;
|
||||||
}else{ convert_x = (uint8)f_x + 1u + 95u;}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
convert_x = (uint8)f_x + 1u + 95u;
|
||||||
|
}
|
||||||
|
|
||||||
temp_y = origin_x;
|
temp_y = origin_x;
|
||||||
/*******************************************/
|
/*******************************************/
|
||||||
@ -1050,21 +993,15 @@ static void TouchPanel_XY_Convert(uint8 origin_x, uint8 origin_y)
|
|||||||
Surface_Convert.convert_y = convert_y; // KalmanFilter(convert_y, 0);
|
Surface_Convert.convert_y = convert_y; // KalmanFilter(convert_y, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void touch_test(void)
|
void touch_test(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
extern uint8_t Allow_Touch_flag;
|
extern uint8_t Allow_Touch_flag;
|
||||||
// static uint16_t touch_delay = 500;
|
// static uint16_t touch_delay = 500;
|
||||||
void TouchPanel_MainFunction(void)
|
void TouchPanel_MainFunction(void)
|
||||||
{
|
{
|
||||||
uint8 index;
|
uint8 index;
|
||||||
uint8 x1,y1, x2,y2, Temp_x,Temp_y;
|
uint8 Temp_x, Temp_y;
|
||||||
uint8 touchEnd_flag = 0x00;
|
|
||||||
|
|
||||||
|
|
||||||
uint8 pad_trig_x, pad_trig_y; // by kailong
|
uint8 pad_trig_x, pad_trig_y; // by kailong
|
||||||
@ -1084,8 +1021,6 @@ void TouchPanel_MainFunction(void)
|
|||||||
static uint8 threshold_select_right = 0;
|
static uint8 threshold_select_right = 0;
|
||||||
static uint8 threshold_select_confirm = 0;
|
static uint8 threshold_select_confirm = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
touch_process();
|
touch_process();
|
||||||
|
|
||||||
// kailong add
|
// kailong add
|
||||||
@ -1104,7 +1039,6 @@ void TouchPanel_MainFunction(void)
|
|||||||
|
|
||||||
CurrentPosition = 1;
|
CurrentPosition = 1;
|
||||||
threshold_select_resume = 1;
|
threshold_select_resume = 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1115,7 +1049,6 @@ void TouchPanel_MainFunction(void)
|
|||||||
{
|
{
|
||||||
CurrentPosition = 3;
|
CurrentPosition = 3;
|
||||||
threshold_select_cancel = 1;
|
threshold_select_cancel = 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1155,7 +1088,6 @@ void TouchPanel_MainFunction(void)
|
|||||||
{206, 169},
|
{206, 169},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct Point Point_Confirm[4] = {
|
struct Point Point_Confirm[4] = {
|
||||||
{140, 92},
|
{140, 92},
|
||||||
{206, 92},
|
{206, 92},
|
||||||
@ -1169,7 +1101,6 @@ void TouchPanel_MainFunction(void)
|
|||||||
Current_XY.x = (float)pad_trig_x;
|
Current_XY.x = (float)pad_trig_x;
|
||||||
Current_XY.y = (float)pad_trig_y;
|
Current_XY.y = (float)pad_trig_y;
|
||||||
|
|
||||||
|
|
||||||
if (point_in_quadrilateral(Current_XY, Point_Up[0], Point_Up[1], Point_Up[2], Point_Up[3]))
|
if (point_in_quadrilateral(Current_XY, Point_Up[0], Point_Up[1], Point_Up[2], Point_Up[3]))
|
||||||
{
|
{
|
||||||
if (CurrentPosition != 1 && CurrentPosition != 2 && CurrentPosition != 3)
|
if (CurrentPosition != 1 && CurrentPosition != 2 && CurrentPosition != 3)
|
||||||
@ -1214,7 +1145,6 @@ void TouchPanel_MainFunction(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
else if (point_in_quadrilateral(Current_XY, Point_Confirm[0], Point_Confirm[1], Point_Confirm[2], Point_Confirm[3]))
|
else if (point_in_quadrilateral(Current_XY, Point_Confirm[0], Point_Confirm[1], Point_Confirm[2], Point_Confirm[3]))
|
||||||
{
|
{
|
||||||
if (CurrentPosition != 1 && CurrentPosition != 2 && CurrentPosition != 3)
|
if (CurrentPosition != 1 && CurrentPosition != 2 && CurrentPosition != 3)
|
||||||
@ -1225,9 +1155,6 @@ void TouchPanel_MainFunction(void)
|
|||||||
Surface_Button = 5;
|
Surface_Button = 5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1277,66 +1204,11 @@ void TouchPanel_MainFunction(void)
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
if(threshold_select_resume == 1 && threshold_select_adas==0 && threshold_select_cancel==0 && threshold_select_up==0 && threshold_select_down==0 && threshold_select_left==0 && threshold_select_right==0 && threshold_select_confirm==0 )
|
|
||||||
{
|
|
||||||
g_Trig_Threshold=Button0_GetRESUME1_Trig_Threshold();
|
|
||||||
g_Release_Threshold=Button0_GetRESUME1_Release_Threshold();
|
|
||||||
}
|
|
||||||
else if(threshold_select_resume == 0 && threshold_select_adas==1 && threshold_select_cancel==0 && threshold_select_up==0 && threshold_select_down==0 && threshold_select_left==0 && threshold_select_right==0 && threshold_select_confirm==0 )
|
|
||||||
{
|
|
||||||
g_Trig_Threshold= Button3_GetADAS1_Trig_Threshold();
|
|
||||||
g_Release_Threshold= Button3_GetADAS1_Release_Threshold();
|
|
||||||
}
|
|
||||||
else if(threshold_select_resume == 0 && threshold_select_adas==0 && threshold_select_cancel==1 && threshold_select_up==0 && threshold_select_down==0 && threshold_select_left==0 && threshold_select_right==0 && threshold_select_confirm==0 )
|
|
||||||
{
|
|
||||||
g_Trig_Threshold=Button5_GetCANCEL1_Trig_Threshold();
|
|
||||||
g_Release_Threshold= Button5_GetCANCEL1_Release_Threshold();
|
|
||||||
}
|
|
||||||
else if(threshold_select_resume == 0 && threshold_select_adas==0 && threshold_select_cancel==0 && threshold_select_up==1 && threshold_select_down==0 && threshold_select_left==0 && threshold_select_right==0 && threshold_select_confirm==0 )
|
|
||||||
{
|
|
||||||
g_Trig_Threshold=Button6_GetBTN_UP_Trig_Threshold();
|
|
||||||
g_Release_Threshold= Button6_GetBTN_UP_Release_Threshold();
|
|
||||||
}
|
|
||||||
else if(threshold_select_resume == 0 && threshold_select_adas==0 && threshold_select_cancel==0 && threshold_select_up==0 && threshold_select_down==1 && threshold_select_left==0 && threshold_select_right==0 && threshold_select_confirm==0 )
|
|
||||||
{
|
|
||||||
g_Trig_Threshold=Button7_GetBTN_DOWN_Trig_Threshold();
|
|
||||||
g_Release_Threshold= Button7_GetBTN_DOWN_Release_Threshold();
|
|
||||||
}
|
|
||||||
else if(threshold_select_resume == 0 && threshold_select_adas==0 && threshold_select_cancel==0 && threshold_select_up==0 && threshold_select_down==0 && threshold_select_left==1 && threshold_select_right==0 && threshold_select_confirm==0 )
|
|
||||||
{
|
|
||||||
g_Trig_Threshold=Button8_GetBTN_LEFT_Trig_Threshold();
|
|
||||||
g_Release_Threshold= Button8_GetBTN_LEFT_Release_Threshold();
|
|
||||||
}
|
|
||||||
else if(threshold_select_resume == 0 && threshold_select_adas==0 && threshold_select_cancel==0 && threshold_select_up==0 && threshold_select_down==0 && threshold_select_left==0 && threshold_select_right==1 && threshold_select_confirm==0 )
|
|
||||||
{
|
|
||||||
g_Trig_Threshold=Button9_GetBTN_RIGHT_Trig_Threshold();
|
|
||||||
g_Release_Threshold= Button9_GetBTN_RIGHT_Release_Threshold();
|
|
||||||
}
|
|
||||||
else if(threshold_select_resume == 0 && threshold_select_adas==0 && threshold_select_cancel==0 && threshold_select_up==0 && threshold_select_down==0 && threshold_select_left==0 && threshold_select_right==0 && threshold_select_confirm==1 )
|
|
||||||
{
|
|
||||||
g_Trig_Threshold=Button10_GetBTN_CONFIRM_Trig_Threshold();
|
|
||||||
g_Release_Threshold= Button10_GetBTN_CONFIRM_Release_Threshold();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
g_Trig_Threshold=Button10_GetBTN_CONFIRM_Trig_Threshold();
|
|
||||||
g_Release_Threshold= Button10_GetBTN_CONFIRM_Release_Threshold();
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
//InitMessage(SIG_SWTLSENSOR1_BASELINE, &g_Trig_Threshold);
|
|
||||||
|
|
||||||
TouchPanel_PressLevel = TouchPanel_PressCheck();
|
TouchPanel_PressLevel = TouchPanel_PressCheck();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (measurement_done_touch == 1)
|
if (measurement_done_touch == 1)
|
||||||
{
|
{
|
||||||
// process touch data
|
|
||||||
for(index = 0; index< DEF_NUM_CHANNELS; index++){
|
|
||||||
sensor_signal[index] = get_sensor_node_signal(index);
|
|
||||||
sensor_reference[index] = get_sensor_node_reference(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
TouchPanel_SurfaceStatus = get_surface_status();
|
TouchPanel_SurfaceStatus = get_surface_status();
|
||||||
if (TouchPanel_SurfaceStatus & TOUCH_ACTIVE)
|
if (TouchPanel_SurfaceStatus & TOUCH_ACTIVE)
|
||||||
@ -1344,121 +1216,45 @@ void TouchPanel_MainFunction(void)
|
|||||||
Temp_x = get_surface_position(HOR_POS);
|
Temp_x = get_surface_position(HOR_POS);
|
||||||
Temp_y = get_surface_position(VER_POS);
|
Temp_y = get_surface_position(VER_POS);
|
||||||
TouchPanel_XY_Convert(Temp_x, Temp_y);
|
TouchPanel_XY_Convert(Temp_x, Temp_y);
|
||||||
TouchSurface.x_position = Surface_Convert.convert_x;
|
|
||||||
TouchSurface.y_position = Surface_Convert.convert_y;
|
|
||||||
|
|
||||||
if(TouchSurface.end_x_pos == 0x00 && TouchSurface.end_y_pos == 0x00){
|
|
||||||
TouchSurface.end_x_pos = TouchSurface.x_position;
|
|
||||||
TouchSurface.end_y_pos = TouchSurface.y_position;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(TouchSurface.Event == TOUCH_PANEL_NONE_EVENT){
|
|
||||||
x1 = TouchSurface.end_x_pos; y1 = TouchSurface.end_y_pos;
|
|
||||||
x2 = TouchSurface.x_position; y2 = TouchSurface.y_position;
|
|
||||||
}else{
|
|
||||||
x1 = TouchSurface.origin_x_pos; y1 = TouchSurface.origin_y_pos;
|
|
||||||
x2 = TouchSurface.x_position; y2 = TouchSurface.y_position;
|
|
||||||
}
|
|
||||||
|
|
||||||
TouchSurface.CheckCycle++;
|
|
||||||
TouchSurface.TouchCycle++;
|
|
||||||
if((abs(x2-x1) < TP_ERR_RANGE) && (abs(y2-y1) < TP_ERR_RANGE))
|
|
||||||
{
|
|
||||||
// sampling error <= +- TP_ERR_RANGE
|
|
||||||
if (TouchSurface.CheckCycle >= TP_DEBOUNCE_CYCLE)
|
|
||||||
{
|
|
||||||
if(TOUCH_PANEL_NONE_EVENT == TouchSurface.Event){
|
|
||||||
TouchSurface.origin_x_pos = (x1+x2)/2;
|
|
||||||
TouchSurface.origin_y_pos = (y1+y2)/2;
|
|
||||||
TouchSurface.Event = TOUCH_PANEL_PRESS_EVENT;
|
|
||||||
}
|
|
||||||
TouchSurface.CheckCycle = TP_DEBOUNCE_CYCLE;
|
|
||||||
}
|
|
||||||
TouchSurface.end_x_pos = x2;
|
|
||||||
TouchSurface.end_y_pos = y2;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(TOUCH_PANEL_PRESS_EVENT == TouchSurface.Event || TOUCH_PANEL_MOVE_EVENT == TouchSurface.Event)
|
|
||||||
{
|
|
||||||
TouchSurface.Event = TOUCH_PANEL_MOVE_EVENT;
|
|
||||||
}else{
|
|
||||||
TouchSurface.Event = TOUCH_PANEL_NONE_EVENT;
|
|
||||||
TouchSurface.origin_x_pos = 0x00;
|
|
||||||
TouchSurface.origin_y_pos = 0x00;
|
|
||||||
}
|
|
||||||
TouchSurface.end_x_pos = x2;
|
|
||||||
TouchSurface.end_y_pos = y2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
x1 = TouchSurface.origin_x_pos; y1 = TouchSurface.origin_y_pos;
|
|
||||||
x2 = TouchSurface.end_x_pos; y2 = TouchSurface.end_y_pos;
|
|
||||||
if(TOUCH_PANEL_MOVE_EVENT == TouchSurface.Event)
|
|
||||||
{
|
|
||||||
if((abs(x2-x1) < TP_ERR_RANGE) && (abs(y2-y1) < TP_ERR_RANGE))
|
|
||||||
{
|
|
||||||
TouchSurface.Event = TOUCH_PANEL_RES_EVENT;
|
|
||||||
}else{
|
|
||||||
TouchSurface.Event = TOUCH_PANEL_MOVE_EVENT;
|
|
||||||
TouchSlideEvent.Direction = GetSlide_Direction(x1, y1, x2, y2);
|
|
||||||
if(TouchSlideEvent.Direction != TP_SlideDirection_NONE){
|
|
||||||
TouchSlideEvent.keep_cycle = SLIDE_CAN_EVENT_KEEP_CYCLE;
|
|
||||||
TouchSlideEvent.Event = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(TOUCH_PANEL_PRESS_EVENT == TouchSurface.Event)
|
|
||||||
{
|
|
||||||
//do nothing
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
TouchSurface.Event = TOUCH_PANEL_NONE_EVENT;
|
|
||||||
}
|
|
||||||
|
|
||||||
TouchSurface.end_x_pos = 0x00;
|
|
||||||
TouchSurface.end_y_pos = 0x00;
|
|
||||||
TouchSurface.CheckCycle = 0x00;
|
|
||||||
TouchSurface.origin_x_pos = 0x00;
|
|
||||||
TouchSurface.origin_y_pos = 0x00;
|
|
||||||
TouchSurface.x_position = 0;
|
|
||||||
TouchSurface.y_position = 0;
|
|
||||||
TouchSurface.TouchCycle = 0;
|
|
||||||
Surface_Convert.convert_x = 0x00;
|
Surface_Convert.convert_x = 0x00;
|
||||||
Surface_Convert.convert_y = 0x00;
|
Surface_Convert.convert_y = 0x00;
|
||||||
touchEnd_flag = 0x01;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(TouchSurface.TouchCycle >= TP_RUNNING_ERROR_CYCLE){
|
|
||||||
TouchSurface.TouchCycle = TP_RUNNING_ERROR_CYCLE;
|
|
||||||
TouchSurface.Event = TOUCH_PANEL_BERR_EVENT;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (index = 0; index < BTN_MAX_CH_NUM; index++)
|
for (index = 0; index < BTN_MAX_CH_NUM; index++)
|
||||||
{
|
{
|
||||||
if(index< (BTN_MAX_CH_NUM - 5U)){
|
if (index < (BTN_MAX_CH_NUM - 5U))
|
||||||
|
{
|
||||||
Buttons_Signal[index] = TouchButton_BntCheck(index);
|
Buttons_Signal[index] = TouchButton_BntCheck(index);
|
||||||
}else{
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
Buttons_Signal[index] = TouchSurface_BntCheck(index, 1);
|
Buttons_Signal[index] = TouchSurface_BntCheck(index, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (CurrentPosition)
|
switch (CurrentPosition)
|
||||||
{
|
{
|
||||||
case 1:{
|
case 1:
|
||||||
|
{
|
||||||
Buttons_Signal[BTN_RESUME1] = TouchButton_BntCheck(BTN_RESUME1);
|
Buttons_Signal[BTN_RESUME1] = TouchButton_BntCheck(BTN_RESUME1);
|
||||||
if (Buttons_Signal[BTN_RESUME1] >= BUTTON_TOUCH)
|
if (Buttons_Signal[BTN_RESUME1] >= BUTTON_TOUCH)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
for (index = 0; index < BTN_MAX_CH_NUM; index++)
|
for (index = 0; index < BTN_MAX_CH_NUM; index++)
|
||||||
{
|
{
|
||||||
if(index< (BTN_MAX_CH_NUM - 5U)){
|
if (index < (BTN_MAX_CH_NUM - 5U))
|
||||||
|
{
|
||||||
Buttons_Signal[index] = TouchButton_BntCheck(index);
|
Buttons_Signal[index] = TouchButton_BntCheck(index);
|
||||||
}else{
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
Buttons_Signal[index] = TouchSurface_BntCheck(index, 1);
|
Buttons_Signal[index] = TouchSurface_BntCheck(index, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1470,18 +1266,23 @@ void TouchPanel_MainFunction(void)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2:{
|
case 2:
|
||||||
|
{
|
||||||
Buttons_Signal[BTN_ADAS1] = TouchButton_BntCheck(BTN_ADAS1);
|
Buttons_Signal[BTN_ADAS1] = TouchButton_BntCheck(BTN_ADAS1);
|
||||||
if (Buttons_Signal[BTN_ADAS1] >= BUTTON_TOUCH)
|
if (Buttons_Signal[BTN_ADAS1] >= BUTTON_TOUCH)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
for (index = 0; index < BTN_MAX_CH_NUM; index++)
|
for (index = 0; index < BTN_MAX_CH_NUM; index++)
|
||||||
{
|
{
|
||||||
if(index< (BTN_MAX_CH_NUM - 5U)){
|
if (index < (BTN_MAX_CH_NUM - 5U))
|
||||||
|
{
|
||||||
Buttons_Signal[index] = TouchButton_BntCheck(index);
|
Buttons_Signal[index] = TouchButton_BntCheck(index);
|
||||||
}else{
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
Buttons_Signal[index] = TouchSurface_BntCheck(index, 1);
|
Buttons_Signal[index] = TouchSurface_BntCheck(index, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1493,18 +1294,23 @@ void TouchPanel_MainFunction(void)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 3:{
|
case 3:
|
||||||
|
{
|
||||||
Buttons_Signal[BTN_CANCEL1] = TouchButton_BntCheck(BTN_CANCEL1);
|
Buttons_Signal[BTN_CANCEL1] = TouchButton_BntCheck(BTN_CANCEL1);
|
||||||
if (Buttons_Signal[BTN_CANCEL1] >= BUTTON_TOUCH)
|
if (Buttons_Signal[BTN_CANCEL1] >= BUTTON_TOUCH)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
for (index = 0; index < BTN_MAX_CH_NUM; index++)
|
for (index = 0; index < BTN_MAX_CH_NUM; index++)
|
||||||
{
|
{
|
||||||
if(index< (BTN_MAX_CH_NUM - 5U)){
|
if (index < (BTN_MAX_CH_NUM - 5U))
|
||||||
|
{
|
||||||
Buttons_Signal[index] = TouchButton_BntCheck(index);
|
Buttons_Signal[index] = TouchButton_BntCheck(index);
|
||||||
}else{
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
Buttons_Signal[index] = TouchSurface_BntCheck(index, 1);
|
Buttons_Signal[index] = TouchSurface_BntCheck(index, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1516,18 +1322,23 @@ void TouchPanel_MainFunction(void)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 4:{
|
case 4:
|
||||||
|
{
|
||||||
Buttons_Signal[BTN_UP] = TouchSurface_BntCheck(BTN_UP, 1);
|
Buttons_Signal[BTN_UP] = TouchSurface_BntCheck(BTN_UP, 1);
|
||||||
if (Buttons_Signal[BTN_UP] >= BUTTON_TOUCH)
|
if (Buttons_Signal[BTN_UP] >= BUTTON_TOUCH)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
for (index = 0; index < BTN_MAX_CH_NUM; index++)
|
for (index = 0; index < BTN_MAX_CH_NUM; index++)
|
||||||
{
|
{
|
||||||
if(index< (BTN_MAX_CH_NUM - 5U)){
|
if (index < (BTN_MAX_CH_NUM - 5U))
|
||||||
|
{
|
||||||
Buttons_Signal[index] = TouchButton_BntCheck(index);
|
Buttons_Signal[index] = TouchButton_BntCheck(index);
|
||||||
}else{
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
Buttons_Signal[index] = TouchSurface_BntCheck(index, 1);
|
Buttons_Signal[index] = TouchSurface_BntCheck(index, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1539,18 +1350,23 @@ void TouchPanel_MainFunction(void)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 5:{
|
case 5:
|
||||||
|
{
|
||||||
Buttons_Signal[BTN_DOWN] = TouchSurface_BntCheck(BTN_DOWN, 1);
|
Buttons_Signal[BTN_DOWN] = TouchSurface_BntCheck(BTN_DOWN, 1);
|
||||||
if (Buttons_Signal[BTN_DOWN] >= BUTTON_TOUCH)
|
if (Buttons_Signal[BTN_DOWN] >= BUTTON_TOUCH)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
for (index = 0; index < BTN_MAX_CH_NUM; index++)
|
for (index = 0; index < BTN_MAX_CH_NUM; index++)
|
||||||
{
|
{
|
||||||
if(index< (BTN_MAX_CH_NUM - 5U)){
|
if (index < (BTN_MAX_CH_NUM - 5U))
|
||||||
|
{
|
||||||
Buttons_Signal[index] = TouchButton_BntCheck(index);
|
Buttons_Signal[index] = TouchButton_BntCheck(index);
|
||||||
}else{
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
Buttons_Signal[index] = TouchSurface_BntCheck(index, 1);
|
Buttons_Signal[index] = TouchSurface_BntCheck(index, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1562,18 +1378,23 @@ void TouchPanel_MainFunction(void)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 6:{
|
case 6:
|
||||||
|
{
|
||||||
Buttons_Signal[BTN_LEFT] = TouchSurface_BntCheck(BTN_LEFT, 1);
|
Buttons_Signal[BTN_LEFT] = TouchSurface_BntCheck(BTN_LEFT, 1);
|
||||||
if (Buttons_Signal[BTN_LEFT] >= BUTTON_TOUCH)
|
if (Buttons_Signal[BTN_LEFT] >= BUTTON_TOUCH)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
for (index = 0; index < BTN_MAX_CH_NUM; index++)
|
for (index = 0; index < BTN_MAX_CH_NUM; index++)
|
||||||
{
|
{
|
||||||
if(index< (BTN_MAX_CH_NUM - 5U)){
|
if (index < (BTN_MAX_CH_NUM - 5U))
|
||||||
|
{
|
||||||
Buttons_Signal[index] = TouchButton_BntCheck(index);
|
Buttons_Signal[index] = TouchButton_BntCheck(index);
|
||||||
}else{
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
Buttons_Signal[index] = TouchSurface_BntCheck(index, 1);
|
Buttons_Signal[index] = TouchSurface_BntCheck(index, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1585,18 +1406,23 @@ void TouchPanel_MainFunction(void)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 7:{
|
case 7:
|
||||||
|
{
|
||||||
Buttons_Signal[BTN_RIGHT] = TouchSurface_BntCheck(BTN_RIGHT, 1);
|
Buttons_Signal[BTN_RIGHT] = TouchSurface_BntCheck(BTN_RIGHT, 1);
|
||||||
if (Buttons_Signal[BTN_RIGHT] >= BUTTON_TOUCH)
|
if (Buttons_Signal[BTN_RIGHT] >= BUTTON_TOUCH)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
for (index = 0; index < BTN_MAX_CH_NUM; index++)
|
for (index = 0; index < BTN_MAX_CH_NUM; index++)
|
||||||
{
|
{
|
||||||
if(index< (BTN_MAX_CH_NUM - 5U)){
|
if (index < (BTN_MAX_CH_NUM - 5U))
|
||||||
|
{
|
||||||
Buttons_Signal[index] = TouchButton_BntCheck(index);
|
Buttons_Signal[index] = TouchButton_BntCheck(index);
|
||||||
}else{
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
Buttons_Signal[index] = TouchSurface_BntCheck(index, 1);
|
Buttons_Signal[index] = TouchSurface_BntCheck(index, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1608,18 +1434,23 @@ void TouchPanel_MainFunction(void)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 8:{
|
case 8:
|
||||||
|
{
|
||||||
Buttons_Signal[BTN_CONFIRM] = TouchSurface_BntCheck(BTN_CONFIRM, 1);
|
Buttons_Signal[BTN_CONFIRM] = TouchSurface_BntCheck(BTN_CONFIRM, 1);
|
||||||
if (Buttons_Signal[BTN_CONFIRM] >= BUTTON_TOUCH)
|
if (Buttons_Signal[BTN_CONFIRM] >= BUTTON_TOUCH)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
for (index = 0; index < BTN_MAX_CH_NUM; index++)
|
for (index = 0; index < BTN_MAX_CH_NUM; index++)
|
||||||
{
|
{
|
||||||
if(index< (BTN_MAX_CH_NUM - 5U)){
|
if (index < (BTN_MAX_CH_NUM - 5U))
|
||||||
|
{
|
||||||
Buttons_Signal[index] = TouchButton_BntCheck(index);
|
Buttons_Signal[index] = TouchButton_BntCheck(index);
|
||||||
}else{
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
Buttons_Signal[index] = TouchSurface_BntCheck(index, 1);
|
Buttons_Signal[index] = TouchSurface_BntCheck(index, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1631,12 +1462,16 @@ void TouchPanel_MainFunction(void)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:{
|
default:
|
||||||
|
{
|
||||||
for (index = 0; index < BTN_MAX_CH_NUM; index++)
|
for (index = 0; index < BTN_MAX_CH_NUM; index++)
|
||||||
{
|
{
|
||||||
if(index< (BTN_MAX_CH_NUM - 5U)){
|
if (index < (BTN_MAX_CH_NUM - 5U))
|
||||||
|
{
|
||||||
Buttons_Signal[index] = TouchButton_BntCheck(index);
|
Buttons_Signal[index] = TouchButton_BntCheck(index);
|
||||||
}else{
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
Buttons_Signal[index] = TouchSurface_BntCheck(index, 1);
|
Buttons_Signal[index] = TouchSurface_BntCheck(index, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1656,36 +1491,11 @@ void TouchPanel_MainFunction(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(touchEnd_flag != 0x00){
|
|
||||||
TouchSurface.Event = TOUCH_PANEL_NONE_EVENT;
|
|
||||||
}
|
|
||||||
|
|
||||||
touch_test();
|
touch_test();
|
||||||
|
|
||||||
|
|
||||||
measurement_done_touch = 0;
|
measurement_done_touch = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(TouchSlideEvent.Event == TRUE)
|
|
||||||
{
|
|
||||||
if(TouchSlideEvent.keep_cycle != 0x00){
|
|
||||||
TouchSlideEvent.keep_cycle--;
|
|
||||||
}
|
|
||||||
if(TouchSlideEvent.keep_cycle == 0x00){
|
|
||||||
TouchSlideEvent.Direction = TP_SlideDirection_NONE;
|
|
||||||
TouchSlideEvent.Event = FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(TouchSurface.Event == TOUCH_PANEL_BERR_EVENT)
|
|
||||||
{
|
|
||||||
TouchSurface.Event = TOUCH_PANEL_NONE_EVENT;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (threshold_select_adas == 1)
|
if (threshold_select_adas == 1)
|
||||||
{
|
{
|
||||||
K_Vibra_Trig_adas = 1;
|
K_Vibra_Trig_adas = 1;
|
||||||
@ -1713,9 +1523,7 @@ void TouchPanel_MainFunction(void)
|
|||||||
K_Vibra_Trig_resume = 0;
|
K_Vibra_Trig_resume = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Vibra_force_level == 2 && last_Vibra_force_level != 2 && Allow_Touch_flag == 1)
|
||||||
if(Vibra_force_level == 2 && last_Vibra_force_level != 2
|
|
||||||
&&Allow_Touch_flag == 1)
|
|
||||||
{
|
{
|
||||||
Over3N_vibra_req = 1;
|
Over3N_vibra_req = 1;
|
||||||
Below1P5N_vibra_req = 0;
|
Below1P5N_vibra_req = 0;
|
||||||
@ -1735,7 +1543,6 @@ void TouchPanel_MainFunction(void)
|
|||||||
// add by kailong
|
// add by kailong
|
||||||
// Vibra_force_level=Vibra_PressCheck();
|
// Vibra_force_level=Vibra_PressCheck();
|
||||||
|
|
||||||
|
|
||||||
if ((K_Vibra_Trig_pad == 1 || K_Vibra_Trig_adas == 1 || K_Vibra_Trig_cancel == 1 || K_Vibra_Trig_resume == 1) && Over3N_vibra_req == 1 && Allow_Touch_flag == 1)
|
if ((K_Vibra_Trig_pad == 1 || K_Vibra_Trig_adas == 1 || K_Vibra_Trig_cancel == 1 || K_Vibra_Trig_resume == 1) && Over3N_vibra_req == 1 && Allow_Touch_flag == 1)
|
||||||
{
|
{
|
||||||
Touch_Flag = TOUCH_KET_ON;
|
Touch_Flag = TOUCH_KET_ON;
|
||||||
@ -1757,9 +1564,4 @@ void TouchPanel_MainFunction(void)
|
|||||||
{
|
{
|
||||||
Allow_Touch_flag = 1;
|
Allow_Touch_flag = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -196,97 +196,97 @@ SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
|
|||||||
|
|
||||||
#define KEY_0_PARAMS \
|
#define KEY_0_PARAMS \
|
||||||
{ \
|
{ \
|
||||||
48u, (uint8_t)HYST_12_5, (uint8_t)NO_AKS_GROUP \
|
40u, (uint8_t)HYST_12_5, (uint8_t)NO_AKS_GROUP \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define KEY_1_PARAMS \
|
#define KEY_1_PARAMS \
|
||||||
{ \
|
{ \
|
||||||
48u, (uint8_t)HYST_12_5, (uint8_t)NO_AKS_GROUP \
|
40u, (uint8_t)HYST_12_5, (uint8_t)NO_AKS_GROUP \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define KEY_2_PARAMS \
|
#define KEY_2_PARAMS \
|
||||||
{ \
|
{ \
|
||||||
54u, (uint8_t)HYST_12_5, (uint8_t)NO_AKS_GROUP \
|
40u, (uint8_t)HYST_12_5, (uint8_t)NO_AKS_GROUP \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define KEY_3_PARAMS \
|
#define KEY_3_PARAMS \
|
||||||
{ \
|
{ \
|
||||||
61u, (uint8_t)HYST_12_5, (uint8_t)AKS_GROUP_1 \
|
40u, (uint8_t)HYST_12_5, (uint8_t)AKS_GROUP_1 \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define KEY_4_PARAMS \
|
#define KEY_4_PARAMS \
|
||||||
{ \
|
{ \
|
||||||
60u, (uint8_t)HYST_12_5, (uint8_t)AKS_GROUP_1 \
|
40u, (uint8_t)HYST_12_5, (uint8_t)AKS_GROUP_1 \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define KEY_5_PARAMS \
|
#define KEY_5_PARAMS \
|
||||||
{ \
|
{ \
|
||||||
57u, (uint8_t)HYST_12_5, (uint8_t)AKS_GROUP_1 \
|
40u, (uint8_t)HYST_12_5, (uint8_t)AKS_GROUP_1 \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define KEY_6_PARAMS \
|
#define KEY_6_PARAMS \
|
||||||
{ \
|
{ \
|
||||||
63u, (uint8_t)HYST_12_5, (uint8_t)AKS_GROUP_1 \
|
40u, (uint8_t)HYST_12_5, (uint8_t)AKS_GROUP_1 \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define KEY_7_PARAMS \
|
#define KEY_7_PARAMS \
|
||||||
{ \
|
{ \
|
||||||
72u, (uint8_t)HYST_12_5, (uint8_t)AKS_GROUP_1 \
|
40u, (uint8_t)HYST_12_5, (uint8_t)AKS_GROUP_1 \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define KEY_8_PARAMS \
|
#define KEY_8_PARAMS \
|
||||||
{ \
|
{ \
|
||||||
49u, (uint8_t)HYST_12_5, (uint8_t)AKS_GROUP_1 \
|
40u, (uint8_t)HYST_12_5, (uint8_t)AKS_GROUP_1 \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define KEY_9_PARAMS \
|
#define KEY_9_PARAMS \
|
||||||
{ \
|
{ \
|
||||||
54u, (uint8_t)HYST_12_5, (uint8_t)AKS_GROUP_1 \
|
40u, (uint8_t)HYST_12_5, (uint8_t)AKS_GROUP_1 \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define KEY_10_PARAMS \
|
#define KEY_10_PARAMS \
|
||||||
{ \
|
{ \
|
||||||
47u, (uint8_t)HYST_12_5, (uint8_t)AKS_GROUP_1 \
|
40u, (uint8_t)HYST_12_5, (uint8_t)AKS_GROUP_1 \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define KEY_11_PARAMS \
|
#define KEY_11_PARAMS \
|
||||||
{ \
|
{ \
|
||||||
55u, (uint8_t)HYST_12_5, (uint8_t)AKS_GROUP_1 \
|
40u, (uint8_t)HYST_12_5, (uint8_t)AKS_GROUP_1 \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define KEY_12_PARAMS \
|
#define KEY_12_PARAMS \
|
||||||
{ \
|
{ \
|
||||||
59u, (uint8_t)HYST_12_5, (uint8_t)AKS_GROUP_1 \
|
40u, (uint8_t)HYST_12_5, (uint8_t)AKS_GROUP_1 \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define KEY_13_PARAMS \
|
#define KEY_13_PARAMS \
|
||||||
{ \
|
{ \
|
||||||
48u, (uint8_t)HYST_12_5, (uint8_t)NO_AKS_GROUP \
|
40u, (uint8_t)HYST_12_5, (uint8_t)NO_AKS_GROUP \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define KEY_14_PARAMS \
|
#define KEY_14_PARAMS \
|
||||||
{ \
|
{ \
|
||||||
48u, (uint8_t)HYST_12_5, (uint8_t)NO_AKS_GROUP \
|
40u, (uint8_t)HYST_12_5, (uint8_t)NO_AKS_GROUP \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define KEY_15_PARAMS \
|
#define KEY_15_PARAMS \
|
||||||
{ \
|
{ \
|
||||||
60u, (uint8_t)HYST_12_5, (uint8_t)NO_AKS_GROUP \
|
40u, (uint8_t)HYST_12_5, (uint8_t)NO_AKS_GROUP \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -96,10 +96,13 @@ void ADC1_ConversionCallback(ADC_STATUS status, uintptr_t context)
|
|||||||
case ADC1_CH_AD_LDO_SNS:
|
case ADC1_CH_AD_LDO_SNS:
|
||||||
ADC1_ChannelSelect(ADC_POSINPUT_AIN6, ADC_NEGINPUT_GND);
|
ADC1_ChannelSelect(ADC_POSINPUT_AIN6, ADC_NEGINPUT_GND);
|
||||||
adc_ch_sel= ADC1_CH_LD_OUT_SNS;
|
adc_ch_sel= ADC1_CH_LD_OUT_SNS;
|
||||||
|
ADC1_ConversionStart();
|
||||||
break;
|
break;
|
||||||
case ADC1_CH_LD_OUT_SNS:
|
case ADC1_CH_LD_OUT_SNS:
|
||||||
ADC1_ChannelSelect(ADC_POSINPUT_AIN7, ADC_NEGINPUT_GND);
|
ADC1_ChannelSelect(ADC_POSINPUT_AIN7, ADC_NEGINPUT_GND);
|
||||||
adc_ch_sel= ADC1_CH_AD_LDO_SNS;
|
adc_ch_sel= ADC1_CH_AD_LDO_SNS;
|
||||||
|
//ADC1_Disable();
|
||||||
|
ADC1_ConversionStart();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -108,7 +111,7 @@ void ADC1_ConversionCallback(ADC_STATUS status, uintptr_t context)
|
|||||||
//if (adc_ch_sel > ADC1_CH_MAX) {
|
//if (adc_ch_sel > ADC1_CH_MAX) {
|
||||||
// adc_ch_sel = ADC1_CH_AD_LDO_SNS + 1;
|
// adc_ch_sel = ADC1_CH_AD_LDO_SNS + 1;
|
||||||
//}
|
//}
|
||||||
ADC1_ConversionStart();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user