mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-22 02:32:23 +00:00
Refactor i2cScan.h To Handle 2 Bus (#2337)
* Break i2cScan out into a set of classes for scanning i2c * refactor i2cscan addresses to be structs that allow addressing by port + address * build whoopsies * trunk fmt * trunk fmt * lost some build fixes from the merge * more cleaning for build safety, RTC behavior
This commit is contained in:
@@ -2,16 +2,19 @@
|
||||
|
||||
#include "configuration.h"
|
||||
|
||||
#include "detect/ScanI2C.h"
|
||||
#include "mesh/generated/meshtastic/config.pb.h"
|
||||
#include <OLEDDisplay.h>
|
||||
|
||||
#if !HAS_SCREEN
|
||||
#include "power.h"
|
||||
#include <OLEDDisplay.h>
|
||||
namespace graphics
|
||||
{
|
||||
// Noop class for boards without screen.
|
||||
class Screen
|
||||
{
|
||||
public:
|
||||
explicit Screen(char) {}
|
||||
explicit Screen(ScanI2C::DeviceAddress, meshtastic_Config_DisplayConfig_OledType, OLEDDISPLAY_GEOMETRY);
|
||||
void onPress() {}
|
||||
void setup() {}
|
||||
void setOn(bool) {}
|
||||
@@ -116,12 +119,14 @@ class Screen : public concurrency::OSThread
|
||||
CallbackObserver<Screen, const UIFrameEvent *>(this, &Screen::handleUIFrameEvent);
|
||||
|
||||
public:
|
||||
explicit Screen(uint8_t address, int sda = -1, int scl = -1);
|
||||
explicit Screen(ScanI2C::DeviceAddress, meshtastic_Config_DisplayConfig_OledType, OLEDDISPLAY_GEOMETRY);
|
||||
|
||||
Screen(const Screen &) = delete;
|
||||
Screen &operator=(const Screen &) = delete;
|
||||
|
||||
uint8_t address_found;
|
||||
ScanI2C::DeviceAddress address_found;
|
||||
meshtastic_Config_DisplayConfig_OledType model;
|
||||
OLEDDISPLAY_GEOMETRY geometry;
|
||||
|
||||
/// Initializes the UI, turns on the display, starts showing boot screen.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user