2023-12-15 21:42:43 +08:00
|
|
|
#include "by_pt_button.h"
|
2023-12-13 21:54:20 +08:00
|
|
|
#include "zf_common_headfile.h"
|
|
|
|
|
uint8_t potate_button;
|
|
|
|
|
void by_gpio_init(void)
|
|
|
|
|
{
|
|
|
|
|
gpio_init(E10, GPI, GPIO_HIGH, GPI_PULL_UP);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void by_exit_init(void)
|
|
|
|
|
{
|
|
|
|
|
exti_init(E9, EXTI_TRIGGER_FALLING);
|
|
|
|
|
exti_init(E11, EXTI_TRIGGER_FALLING);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint8_t by_get_pb_statu(void)
|
|
|
|
|
{
|
|
|
|
|
uint8_t temp_s = potate_button;
|
|
|
|
|
potate_button = 0;
|
|
|
|
|
return temp_s;
|
2023-12-15 21:42:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void by_ips_show(void)
|
|
|
|
|
{
|
|
|
|
|
ips114_show_string(0, 0, "button statu:");
|
|
|
|
|
ips114_show_uint(104, 0, by_get_pb_statu(), 1);
|
|
|
|
|
|
2023-12-13 21:54:20 +08:00
|
|
|
}
|