Skip to content

Commit

Permalink
Merge pull request #216 from mwinters-stuff/main
Browse files Browse the repository at this point in the history
Fixes CMakeLists.txt to properly import the paths into any location. pico-sdk compatible.
  • Loading branch information
davetcc authored Jan 25, 2025
2 parents 07b6dec + fce9e8f commit b511041
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 20 deletions.
4 changes: 3 additions & 1 deletion cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
cmake_minimum_required(VERSION 3.13)

add_library(IoAbstraction
../src/EepromAbstraction.cpp
../src/EepromAbstractionWire.cpp
Expand All @@ -17,7 +19,7 @@ target_compile_definitions(IoAbstraction
)

target_include_directories(IoAbstraction PUBLIC
${PROJECT_SOURCE_DIR}/lib/IoAbstraction/src
../src
)

target_link_libraries(IoAbstraction PUBLIC
Expand Down
2 changes: 1 addition & 1 deletion src/AnalogDeviceAbstraction.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#define _ANALOG_DEVICE_ABSTRACTION_H_

#include "PlatformDetermination.h"
#include <BasicIoAbstraction.h>
#include "BasicIoAbstraction.h"

/**
* @file AnalogDeviceAbstraction.h
Expand Down
6 changes: 3 additions & 3 deletions src/DeviceEvents.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
* @brief This file contains events that are associated with the device, such as the Analog Device.
*/

#include "TaskManagerIO.h"
#include "PlatformDetermination.h"
#include "AnalogDeviceAbstraction.h"
#include <TaskManagerIO.h>
#include <PlatformDetermination.h>
#include <AnalogDeviceAbstraction.h>

/**
* An event that triggers when a certain analog condition is reached, based on a made and a threshold. It can either
Expand Down
2 changes: 1 addition & 1 deletion src/EepromAbstraction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 2018 https://www.thecoderscorner.com (Dave Cherry).
* This product is licensed under an Apache license, see the LICENSE file in the top-level directory.
*/
#include <EepromAbstraction.h>
#include "EepromAbstraction.h"

#ifdef __AVR__

Expand Down
4 changes: 2 additions & 2 deletions src/EepromAbstractionWire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*/

#include "PlatformDetermination.h"
#include "IoLogging.h"
#include <EepromAbstractionWire.h>
#include <IoLogging.h>
#include "EepromAbstractionWire.h"

#ifdef WIRE_BUFFER_SIZE
# define MAX_BUFFER_SIZE_TO_USE WIRE_BUFFER_SIZE
Expand Down
2 changes: 1 addition & 1 deletion src/EepromAbstractionWire.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#include "PlatformDeterminationWire.h"
#include "EepromAbstraction.h"
#include <TaskManager.h>
#include "TaskManager.h"

/**
* Defines all the variants of the chip that we can pass to the I2cAt24Eeprom constructor. From this we can determine
Expand Down
2 changes: 1 addition & 1 deletion src/KeyboardManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

#include "KeyboardManager.h"
#include "IoLogging.h"
#include <IoLogging.h>

MatrixKeyboardManager* MatrixKeyboardManager::INSTANCE = nullptr;

Expand Down
2 changes: 1 addition & 1 deletion src/MockEepromAbstraction.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define _MOCK_EEPROM_ABSTRACTION_H_

#include "EepromAbstraction.h"
#include "IoLogging.h"
#include <IoLogging.h>

/**
* @ file MockEepromAbstraction.h
Expand Down
2 changes: 1 addition & 1 deletion src/MockIoAbstraction.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Neither of the implementations in this file are designed for use in production.
*/

#include <IoAbstraction.h>
#include "IoAbstraction.h"

/**
* During any call to the mock version of IoAbstraction, any error detected
Expand Down
2 changes: 1 addition & 1 deletion src/ResistiveTouchScreen.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "ResistiveTouchScreen.h"
#include <SwitchInput.h>
#include "SwitchInput.h"

namespace iotouch {

Expand Down
5 changes: 3 additions & 2 deletions src/SwitchInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include <inttypes.h>
#include "SwitchInput.h"
#include "BasicIoAbstraction.h"

#define ONE_TURN_OF_ENCODER 32

Expand Down Expand Up @@ -427,8 +428,8 @@ int AbstractHwRotaryEncoder::amountFromChange(unsigned long change) {

void HardwareRotaryEncoder::encoderChanged() {
// Read the current states of pins A and B
uint8_t a = digitalRead(pinA);
uint8_t b = digitalRead(pinB);
uint8_t a = switches.getIoAbstraction()->digitalRead(pinA);
uint8_t b = switches.getIoAbstraction()->digitalRead(pinB);

/**
* Calculate the new state from signals A and B.
Expand Down
4 changes: 2 additions & 2 deletions src/SwitchInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#ifndef _SWITCHINPUT_H
#define _SWITCHINPUT_H

#include <IoAbstraction.h>
#include <TaskManager.h>
#include "IoAbstraction.h"
#include "TaskManager.h"
#include <SimpleCollections.h>

// START user adjustable section
Expand Down
4 changes: 2 additions & 2 deletions src/pico/PicoDigitalIO.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

#include "PicoDigitalIO.h"
#include "../IoAbstraction.h"
#include <SimpleCollections.h>
#include "IoAbstraction.h"
#include "SimpleCollections.h"

#ifdef BUILD_FOR_PICO_CMAKE

Expand Down
2 changes: 1 addition & 1 deletion src/wireHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "IoAbstraction.h"
#include "PlatformDetermination.h"
#include "PlatformDeterminationWire.h"
#include "IoLogging.h"
#include <IoLogging.h>

/**
* @file wireHelpers.h
Expand Down

0 comments on commit b511041

Please sign in to comment.