Mock out mgos_i2c.h to work with Linux.

This commit is contained in:
Pim van Pelt
2018-04-02 13:30:45 +02:00
commit cef7c5107d
8 changed files with 491 additions and 0 deletions

20
src/main.c Normal file
View File

@ -0,0 +1,20 @@
#include "mgos.h"
#include "mgos_i2c.h"
#define I2CBUSNR 7
int main() {
struct mgos_i2c *i2c;
if (!mgos_i2c_open(I2CBUSNR)) {
LOG(LL_ERROR, ("Cannot open I2C bus %u", I2CBUSNR));
return -1;
}
i2c = mgos_i2c_get_global();
if (!i2c) {
LOG(LL_ERROR, ("Cannot open I2C bus"));
return -2;
}
return 0;
}