Buttton Onpress 修改
This commit is contained in:
parent
6fc7930c40
commit
7a41db4a58
|
@ -9,7 +9,9 @@ void TestPulsePort()
|
||||||
}
|
}
|
||||||
|
|
||||||
void PulseHandler(PulsePort* port, bool hasPulse, void* param)
|
void PulseHandler(PulsePort* port, bool hasPulse, void* param)
|
||||||
{ // down true 无遮挡 down false 有遮挡
|
{
|
||||||
|
#if defined(DEBUG)
|
||||||
|
// down true 无遮挡 down false 有遮挡
|
||||||
static UInt64 HideStr;
|
static UInt64 HideStr;
|
||||||
static UInt64 UnHideStr;
|
static UInt64 UnHideStr;
|
||||||
// debug_printf("Press P%c%d down=%d", _PIN_NAME(port->_Port->_Pin),down);
|
// debug_printf("Press P%c%d down=%d", _PIN_NAME(port->_Port->_Pin),down);
|
||||||
|
@ -27,6 +29,7 @@ void PulseHandler(PulsePort* port, bool hasPulse, void* param)
|
||||||
//int time = HideStr-UnHideStr;
|
//int time = HideStr-UnHideStr;
|
||||||
debug_printf("有脉冲时间 %d \r\n", (int)(HideStr-UnHideStr));
|
debug_printf("有脉冲时间 %d \r\n", (int)(HideStr-UnHideStr));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// 初始化引脚
|
// 初始化引脚
|
||||||
|
|
|
@ -239,13 +239,13 @@ void CheckUserPress2(InputPort* port, bool down, void* param)
|
||||||
CheckUserPress(port, down, param);
|
CheckUserPress(port, down, param);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitButtonPress(Button_GrayLevel* btns, byte count)
|
/*void InitButtonPress(Button_GrayLevel* btns, byte count)
|
||||||
{
|
{
|
||||||
for(int i=0; i<count; i++)
|
for(int i=0; i<count; i++)
|
||||||
{
|
{
|
||||||
btns[i].OnPress = CheckUserPress2;
|
btns[i].OnPress = CheckUserPress2;
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
void SetPower(ITransport* port)
|
void SetPower(ITransport* port)
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,7 +20,7 @@ ITransport* CreateShunCom(COM index, int baudRate, Pin rst, Pin power, Pin slp,
|
||||||
TinyClient* CreateTinyClient(ITransport* port);
|
TinyClient* CreateTinyClient(ITransport* port);
|
||||||
|
|
||||||
bool CheckUserPress(InputPort* port, bool down, void* param = nullptr);
|
bool CheckUserPress(InputPort* port, bool down, void* param = nullptr);
|
||||||
void InitButtonPress(Button_GrayLevel* btns, byte count);
|
//void InitButtonPress(Button_GrayLevel* btns, byte count);
|
||||||
|
|
||||||
void SetPower(ITransport* port);
|
void SetPower(ITransport* port);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue