|
@@ -445,18 +445,23 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) {
|
|
|
// 松开(上升沿)
|
|
// 松开(上升沿)
|
|
|
printf("JUGE_KEY 松开\r\n");
|
|
printf("JUGE_KEY 松开\r\n");
|
|
|
|
|
|
|
|
- int pressedSeconds = (currentTime.Hours * 3600 + currentTime.Minutes * 60 + currentTime.Seconds)
|
|
|
|
|
- - (JUGE_key_struct.Hours * 3600 + JUGE_key_struct.Minutes * 60 + JUGE_key_struct.Seconds);
|
|
|
|
|
- if (pressedSeconds < 0) {
|
|
|
|
|
- pressedSeconds += 24 * 3600;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- printf("JUGE_KEY 按下持续时间: %d 秒\r\n", pressedSeconds);
|
|
|
|
|
|
|
+ // int pressedSeconds = (currentTime.Hours * 3600 + currentTime.Minutes * 60 + currentTime.Seconds)
|
|
|
|
|
+ // - (JUGE_key_struct.Hours * 3600 + JUGE_key_struct.Minutes * 60 + JUGE_key_struct.Seconds);
|
|
|
|
|
+ // if (pressedSeconds < 0) {
|
|
|
|
|
+ // pressedSeconds += 24 * 3600;
|
|
|
|
|
+ // }
|
|
|
|
|
+ //
|
|
|
|
|
+ // printf("JUGE_KEY 按下持续时间: %d 秒\r\n", pressedSeconds);
|
|
|
|
|
+ // if (pressedSeconds > 1) {
|
|
|
|
|
+ // // HAL_GPIO_WritePin(PowerLED_GPIO_Port, PowerLED_Pin, GPIO_PIN_RESET);
|
|
|
|
|
+ // HAL_GPIO_WritePin(POWER_ON_GPIO_Port, POWER_ON_Pin, GPIO_PIN_RESET);
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
} else {
|
|
} else {
|
|
|
// 按下(下降沿)
|
|
// 按下(下降沿)
|
|
|
printf("JUGE_KEY 按下\r\n");
|
|
printf("JUGE_KEY 按下\r\n");
|
|
|
- JUGE_key_struct = currentTime;
|
|
|
|
|
|
|
+ // JUGE_key_struct = currentTime;
|
|
|
|
|
+ HAL_GPIO_WritePin(POWER_ON_GPIO_Port, POWER_ON_Pin, GPIO_PIN_RESET);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|