#ifndef _OS_Type_H__
#define _OS_Type_H__
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <math.h>

#ifndef AT32F413RCT7
#ifndef TRUE
#define TRUE 1
#endif

#ifndef FALSE
#define FALSE 0
#endif
#endif

typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u24;
typedef uint32_t u32;
typedef uint64_t u64;

typedef int8_t s8;
typedef int16_t s16;
typedef int32_t s24;
typedef int32_t s32;
typedef int64_t s64;

typedef signed char	int8;
typedef signed short 	int16;
typedef signed int		int32;
typedef unsigned char	uint8;
typedef unsigned short	uint16;
typedef unsigned int	uint32;

#define NEGATIVE          ((int8_t)-1)
#define POSITIVE          ((int8_t)1)

#define PHASE_0_DEGREE (0.0f)

#define PHASE_60_DEGREE (60.0f)
#define PHASE_120_DEGREE (120.0f)
#define PHASE_180_DEGREE (180.0f)
#define PHASE_240_DEGREE (240.0f)
#define PHASE_300_DEGREE (300.0f)
#define PHASE_360_DEGREE (360.0f)

#define rand_angle(a) {while (a >= PHASE_360_DEGREE) a-=PHASE_360_DEGREE;while (a < 0) a +=PHASE_360_DEGREE;};
#define ABS(x) 					( (x)>0?(x):-(x) )

extern void *pvPortMalloc( size_t xWantedSize );
#define os_alloc pvPortMalloc
extern void vPortFree(void *);
#define os_free vPortFree

#endif /* _OS_Type_H__ */

