Skip to content

Attempt to get sensor libraries compiling. #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cores/portduino/Arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extern HardwareSPI SPI;

using namespace arduino;

typedef HardwareI2C TwoWire; // Some Arduino ports use this terminology
#define TwoWire LinuxHardwareI2C // Some Arduino ports use this terminology

/** Map a pin number to an interrupt #
* We always map 1:1
Expand Down
3 changes: 2 additions & 1 deletion cores/portduino/linux/LinuxHardwareI2C.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "LinuxHardwareI2C.h"
#include <iostream>
#include <linux/i2c.h>
#include "Arduino.h"


extern "C"
Expand All @@ -21,7 +22,7 @@ namespace arduino {
char buf[100] = {0};
int requestedBytes = 0;
int sessionstatus;
LinuxHardwareI2C Wire;
TwoWire Wire;
bool hasBegun = false;

void LinuxHardwareI2C::begin() {
Expand Down
5 changes: 3 additions & 2 deletions cores/portduino/linux/LinuxHardwareI2C.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include "HardwareI2C.h"
#include "Utility.h"
#include "Arduino.h"

namespace arduino {

Expand Down Expand Up @@ -63,6 +64,7 @@ class LinuxHardwareI2C : public HardwareI2C {
virtual int available();

virtual int read();
size_t readBytes( uint8_t *buffer, size_t length) { return readBytes((char *)buffer, length); }

virtual uint8_t readBytes(uint8_t address, size_t len, bool stopBit) {
notImplemented("requestFrom");
Expand All @@ -77,7 +79,6 @@ class LinuxHardwareI2C : public HardwareI2C {
}
};

extern LinuxHardwareI2C Wire;
} // namespace arduino

extern LinuxHardwareI2C Wire;
#endif // PORTDUINO_SIMHARDWAREI2C_H