forked from smartboxchannel/Plant-Watering-Sensor-Zigbee
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Debug.h
40 lines (30 loc) · 868 Bytes
/
Debug.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef _DEBUG_H
#define _DEBUG_H
#include "hal_types.h"
#include "hal_uart.h"
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#define BUFFLEN 128
#define BUFFER 100
#define PRINT_NUMBER_TYPE long
#define PAD_RIGHT 1
#define PAD_ZERO 2
#define PRINT_BUF_LEN 12
#define PRINT_IMMEDIATE_PRINT 0
#define BYTE_TO_BINARY_PATTERN "%c%c%c%c%c%c%c%c"
#define BYTE_TO_BINARY(byte) \
(byte & 0x80 ? '1' : '0'), \
(byte & 0x40 ? '1' : '0'), \
(byte & 0x20 ? '1' : '0'), \
(byte & 0x10 ? '1' : '0'), \
(byte & 0x08 ? '1' : '0'), \
(byte & 0x04 ? '1' : '0'), \
(byte & 0x02 ? '1' : '0'), \
(byte & 0x01 ? '1' : '0')
extern halUARTCfg_t halUARTConfig;
void vprint(const char *fmt, va_list argp);
extern bool DebugInit(void);
extern void LREP(char *format, ...);
extern void LREPMaster(uint8 *data);
#endif