This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define BAUDRATE 115200 | |
#define PRE_MSB 0x5A | |
#define PRE_LSB 0xA5 | |
#define CMD_READ 0x01 | |
#define CMD_WRITE 0x02 | |
#define CMD_REPLY 0x04 | |
#define CMD_WR_REPLY 0x05 | |
#define c_MIN_BATT_V 3500 | |
#define c_MAX_BATT_V 4200 | |
#define c_BATT_CAP 15300 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unsigned short tcrc[]={ | |
0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, | |
0x60C6, 0x70E7, 0x8108, 0x9129, 0xA14A, 0xB16B, | |
0xC18C, 0xD1AD, 0xE1CE, 0xF1EF, 0x1231, 0x0210, | |
0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6, | |
0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, | |
0xF3FF, 0xE3DE, 0x2462, 0x3443, 0x0420, 0x1401, | |
0x64E6, 0x74C7, 0x44A4, 0x5485, 0xA56A, 0xB54B, | |
0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D, | |
0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, |