File tree 2 files changed +3
-2
lines changed
2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ bool CH375::test() {
48
48
return ((uint8_t ) receive ()) == ((uint8_t ) ~b);
49
49
}
50
50
51
- bool CH375::setBaudRate (uint32_t baudRate, void (*setLocalBaudRate)( void )) {
51
+ bool CH375::setBaudRate (uint32_t baudRate, std::function< void ( void )> setLocalBaudRate ) {
52
52
sendCommand (CH375_CMD_SET_BAUDRATE);
53
53
sendData (0x03 );
54
54
sendData ((uint8_t ) (256 - 6000000 /baudRate)); // TODO: may be architecture-dependend, check on AVR
Original file line number Diff line number Diff line change 1
1
#pragma once
2
+ #include < functional>
2
3
#include " Arduino.h"
3
4
4
5
#define CH375_CMD_GET_IC_VER 0x01
@@ -105,7 +106,7 @@ class CH375 {
105
106
CH375 (Stream& _stream, int _interruptPin);
106
107
bool init ();
107
108
bool test ();
108
- bool setBaudRate (uint32_t baudRate, void (*setLocalBaudRate)( void ));
109
+ bool setBaudRate (uint32_t baudRate, std::function< void ( void )> setLocalBaudRate );
109
110
uint8_t getChipVersion ();
110
111
void rd_usb_data (uint8_t * buf, uint8_t maxLen);
111
112
void wr_usb_data (uint8_t * buf, uint8_t len);
You can’t perform that action at this time.
0 commit comments