27 lines
378 B
C
27 lines
378 B
C
#ifndef _KEY_H
|
|
#define _KEY_H
|
|
|
|
#include "main.h"
|
|
|
|
|
|
//从PD8和PD9读取数据
|
|
#define KEY2 HAL_GPIO_ReadPin(GPIOB,GPIO_PIN_1)
|
|
#define KEY3 HAL_GPIO_ReadPin(GPIOB,GPIO_PIN_0)
|
|
|
|
#define KEY2_DOWN 2
|
|
#define KEY3_DOWN 3
|
|
|
|
#define KEY2_HOLD 4
|
|
#define KEY3_HOLD 5
|
|
|
|
extern int key_flag;
|
|
extern const char* type_str;
|
|
|
|
void bubblesort(long arr[], int size);
|
|
void key_scan(void);
|
|
|
|
#endif
|
|
|
|
|
|
|