mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-01 10:19:59 +00:00
Initial implementation of I2C
This commit is contained in:
parent
423b8ad603
commit
14d03a2bda
@ -2,7 +2,9 @@
|
||||
|
||||
#include "concurrency/LockGuard.h"
|
||||
#include "configuration.h"
|
||||
|
||||
#if defined(ARCH_RASPBERRY_PI)
|
||||
#include "linux/LinuxHardwareI2C.h"
|
||||
#endif
|
||||
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
|
||||
#include "main.h" // atecc
|
||||
#endif
|
||||
@ -162,7 +164,14 @@ void ScanI2CTwoWire::scanPort(I2CPort port)
|
||||
|
||||
for (addr.address = 1; addr.address < 127; addr.address++) {
|
||||
i2cBus->beginTransmission(addr.address);
|
||||
#ifdef ARCH_PORTDUINO
|
||||
if (i2cBus->read() != -1)
|
||||
err = 0;
|
||||
else
|
||||
err = 2;
|
||||
#else
|
||||
err = i2cBus->endTransmission();
|
||||
#endif
|
||||
type = NONE;
|
||||
if (err == 0) {
|
||||
LOG_DEBUG("I2C device found at address 0x%x\n", addr.address);
|
||||
|
@ -1564,7 +1564,7 @@ void DebugInfo::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16
|
||||
// Jm
|
||||
void DebugInfo::drawFrameWiFi(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
||||
{
|
||||
#if HAS_WIFI
|
||||
#if HAS_WIFI && !defined(ARCH_RASPBERRY_PI)
|
||||
const char *wifiName = config.network.wifi_ssid;
|
||||
|
||||
display->setFont(FONT_SMALL);
|
||||
|
@ -68,6 +68,7 @@ NRF52Bluetooth *nrf52Bluetooth;
|
||||
#endif
|
||||
|
||||
#ifdef ARCH_RASPBERRY_PI
|
||||
#include "linux/LinuxHardwareI2C.h"
|
||||
#include "platform/portduino/PortduinoGlue.h"
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
@ -16,4 +16,4 @@
|
||||
#endif
|
||||
#ifndef HAS_TELEMETRY
|
||||
#define HAS_TELEMETRY 1
|
||||
#endif
|
||||
#endif
|
@ -1,5 +1,6 @@
|
||||
#if defined(ARCH_RASPBERRY_PI)
|
||||
#define NO_SCREEN
|
||||
#define HAS_WIRE 1
|
||||
#define HAS_SCREEN 1
|
||||
|
||||
#else // Pine64 mode.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user