Mock out mgos_i2c.h to work with Linux.
This commit is contained in:
20
src/main.c
Normal file
20
src/main.c
Normal 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;
|
||||
}
|
Reference in New Issue
Block a user