From fa9c9212d7e25e9eacbbfcc4e6a516b4d48ebbb5 Mon Sep 17 00:00:00 2001 From: Tero Kontkanen Date: Fri, 28 Oct 2016 15:18:18 +0300 Subject: Added smSetBaudrate() to allow changing bus speed --- busdevice.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'busdevice.c') diff --git a/busdevice.c b/busdevice.c index 9bf82c8..c82e27b 100644 --- a/busdevice.c +++ b/busdevice.c @@ -10,6 +10,8 @@ //how much bytes available in transmit buffer #define TANSMIT_BUFFER_LENGTH 128 +unsigned long SMBusBaudrate=SM_BAUDRATE; //the next opened port (with smOpenBus) will be opened with the PBS defined here (default 460800 BPS) + typedef struct _SMBusDevice { //common @@ -65,7 +67,7 @@ smbusdevicehandle smBDOpen( const char *devicename ) if(strncmp(devicename,"COM",3) == 0 || strncmp(devicename,"/dev/tty",8) == 0) //use rs232 lib { - BusDevice[handle].comPort=OpenComport( devicename, SM_BAUDRATE ); + BusDevice[handle].comPort=OpenComport( devicename, SMBusBaudrate ); if( BusDevice[handle].comPort == -1 ) { return -1; //failed to open -- cgit v1.2.3