
//#include "py32f002ax5.h"


#ifdef MAIN_C
#define MAIN_EX
#else 
#define MAIN_EX extern 
#endif



#define DEBUG //printf




struct _SAVE_
{
u16 flag;
u16 cnt;
//u16 index;
//u8 rfDat[40][3];
};

struct _SYS_
{
u8 b_50ms:1;
u8 b_tick:1;
u8 b_key_push:1;
u8 b_test_mode:1;

u8 wake_src;
u8 led_on_at_setMode_10ms;
u16 key_push_ms10;
u8 key_10ms_lianPush;

};

struct _TIME_
{
u8 ms10;
u32 work_ms10;

};
enum _pin_status_
{
pin_low=0,
pin_high,
pin_float=2,
pin_togg=2,
};



MAIN_EX struct _TIME_ TIME;
MAIN_EX struct _SAVE_ SAVE;
MAIN_EX struct _SYS_ SYS;

#define Re_SET_WorkTime(x)  TIME.work_ms10=x*100
	
MAIN_EX void OFF_ALL_DatPin(void);

MAIN_EX void APP_UsartIRQCallback(USART_TypeDef *USARTx);
MAIN_EX  void APP_UsartTransmit_IT(USART_TypeDef *USARTx, uint8_t *pData, uint16_t Size);

MAIN_EX  void APP_ConfigTIM1(void);
MAIN_EX  void APP_UpdateCallback(void);



MAIN_EX void APP_LPTIMCallback(void);


MAIN_EX void LPTIM_INI(void) ;
MAIN_EX void MCU_DEEP_SLEEP(void);
MAIN_EX void GET_OUT_MODE(void);
MAIN_EX u8	GET_PIN_LEVEL_AND_FLOAT(GPIO_TypeDef *GPIOx, uint32_t Pin );
MAIN_EX void SET_PIN_PULL_for_LowPower(GPIO_TypeDef *GPIOx, uint32_t Pin );
MAIN_EX void APP_Config_Usart1_map_PF01(USART_TypeDef *USARTx);
MAIN_EX void SWD_EN_OR_DIS(char en);
MAIN_EX void CHK_DIANDONG(void);
/************************ (C) COPYRIGHT Puya *****END OF FILE****/
