p kj
/
MKS22-CubeFine
LPC824
Fork of CubeFine by
Diff: Microduino_Protocol_HardSer.cpp
- Revision:
- 2:7964622fb5a5
- Parent:
- 0:362c1482232c
diff -r 54a2d380f8c7 -r 7964622fb5a5 Microduino_Protocol_HardSer.cpp --- a/Microduino_Protocol_HardSer.cpp Fri Jul 01 09:41:15 2016 +0000 +++ b/Microduino_Protocol_HardSer.cpp Mon Jul 04 07:17:39 2016 +0000 @@ -2,7 +2,7 @@ #include "MicroduinoPinNames.h" //Timer _timer; extern Timer g_cubeTimer; -//DigitalOut myled(D13); + uint8_t getChecksum(uint8_t length, uint8_t cmd, uint8_t mydata[]) { //三个参数分别为: 数据长度 , 指令代码 , 实际数据数组 @@ -13,27 +13,10 @@ return checksum; } -/* Protocol::Protocol(PRO_PORT *ser , byte _channel) { - // common_init(); // Set everything to common state, then... - this->channel = _channel; - this->num = 0; - this->sta = false; - this->error = false; - P_Serial = ser; // ...override P_Serial with value passed. - } */ -static void uart_callback(void) -{ - //myled = !myled; -} + void Protocol::begin(uint16_t _baud) { - //myled = 0; - //_timer.start(); - //P_Serial->begin(_baud); P_Serial->baud(_baud); - //P_Serial->attach(uart_callback, Serial::RxIrq); - //delay(20); - //wait_ms(20); } bool Protocol::available(bool _sta) @@ -108,7 +91,8 @@ if (_mod) { return P_TIMEOUT; } - } else { - return P_NONE; } + + return P_NONE; + } \ No newline at end of file