From 857fa0be76249b2004d690503fb968a363a7513b Mon Sep 17 00:00:00 2001 From: Ethan Slattery Date: Sat, 11 May 2019 11:25:04 -0700 Subject: [PATCH 1/2] changes for MSVC --- c/common/i2cdriver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/c/common/i2cdriver.c b/c/common/i2cdriver.c index f110303..181587a 100644 --- a/c/common/i2cdriver.c +++ b/c/common/i2cdriver.c @@ -5,8 +5,8 @@ #include #if !defined(WIN32) #include -#endif #include +#endif #include #define __STDC_FORMAT_MACROS #include @@ -55,7 +55,7 @@ HANDLE openSerialPort(const char *portname) if (portname[0] == 'C') fmt = "\\\\.\\%s"; else - fmt == "%s"; + fmt = "%s"; snprintf(fullname, sizeof(fullname), fmt, portname); DWORD accessdirection = GENERIC_READ | GENERIC_WRITE; HANDLE hSerial = CreateFile((LPCSTR)fullname, From 068904cf21f6ecf4886615ad257e9568585b240e Mon Sep 17 00:00:00 2001 From: Ethan Slattery Date: Sat, 11 May 2019 11:25:50 -0700 Subject: [PATCH 2/2] added function to set i2c start bit to public API --- c/common/i2cdriver.h | 1 + 1 file changed, 1 insertion(+) diff --git a/c/common/i2cdriver.h b/c/common/i2cdriver.h index 9b0c04e..79f8675 100644 --- a/c/common/i2cdriver.h +++ b/c/common/i2cdriver.h @@ -32,6 +32,7 @@ void i2c_connect(I2CDriver *sd, const char* portname); void i2c_getstatus(I2CDriver *sd); int i2c_write(I2CDriver *sd, const uint8_t bytes[], size_t nn); void i2c_read(I2CDriver *sd, uint8_t bytes[], size_t nn); +int i2c_start(I2CDriver *sd, uint8_t dev, uint8_t op); void i2c_stop(I2CDriver *sd); void i2c_monitor(I2CDriver *sd, int enable);