-
-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved Analog, Encoder and Button source lists into separate files
- Loading branch information
Showing
8 changed files
with
105 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* AnalogSources.cpp | ||
* | ||
* Created on: Apr 18, 2024 | ||
* Author: Yannick | ||
*/ | ||
|
||
#include "constants.h" | ||
#include "LocalAnalog.h" | ||
#include "CanAnalog.h" | ||
#include "ADS111X.h" | ||
|
||
// Register possible analog sources (id 0-15) | ||
#ifndef ANALOGSOURCES_DEFAULT_OVERRIDE | ||
const std::vector<class_entry<AnalogSource>> AnalogSource::all_analogsources = | ||
{ | ||
#ifdef ANALOGAXES | ||
add_class<LocalAnalog,AnalogSource>(0), | ||
#endif | ||
#ifdef CANANALOG | ||
add_class<CanAnalog<8>,AnalogSource>(1), | ||
#endif | ||
#ifdef ADS111XANALOG | ||
add_class<ADS111X_AnalogSource,AnalogSource>(2), | ||
#endif | ||
}; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* ButtonSources.cpp | ||
* | ||
* Created on: Apr 18, 2024 | ||
* Author: Yannick | ||
*/ | ||
#include "constants.h" | ||
#include "SPIButtons.h" | ||
#include "CanButtons.h" | ||
#include "LocalButtons.h" | ||
#include <ShifterAnalog.h> | ||
#include "PCF8574.h" | ||
|
||
#ifndef BUTTONSOURCES_DEFAULT_OVERRIDE | ||
// Register possible button sources (id 0-15) | ||
const std::vector<class_entry<ButtonSource>> ButtonSource::all_buttonsources = | ||
{ | ||
#ifdef LOCALBUTTONS | ||
add_class<LocalButtons,ButtonSource>(0), | ||
#endif | ||
#ifdef SPIBUTTONS | ||
add_class<SPI_Buttons_1,ButtonSource>(1), | ||
#endif | ||
#ifdef SPIBUTTONS2 | ||
add_class<SPI_Buttons_2,ButtonSource>(2), | ||
#endif | ||
#ifdef SHIFTERBUTTONS | ||
add_class<ShifterAnalog,ButtonSource>(3), | ||
#endif | ||
#ifdef PCF8574BUTTONS | ||
add_class<PCF8574Buttons,ButtonSource>(4), | ||
#endif | ||
#ifdef CANBUTTONS | ||
add_class<CanButtons,ButtonSource>(5), | ||
#endif | ||
}; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* EncoderSources.cpp | ||
* | ||
* Created on: Apr 18, 2024 | ||
* Author: Yannick | ||
*/ | ||
|
||
#include "constants.h" | ||
#include "EncoderLocal.h" | ||
#include "MtEncoderSPI.h" | ||
#include "EncoderBissC.h" | ||
#include "EncoderSSI.h" | ||
// 0-63 valid ids | ||
#ifndef ENCODERSOURCES_DEFAULT_OVERRIDE | ||
std::vector<class_entry<Encoder>> const Encoder::all_encoders = | ||
{ | ||
add_class<Encoder, Encoder>(0), | ||
|
||
#ifdef LOCALENCODER | ||
add_class<EncoderLocal, Encoder>(2), | ||
#endif | ||
|
||
#ifdef MTENCODERSPI | ||
add_class<MtEncoderSPI, Encoder>(4), | ||
#endif | ||
#ifdef BISSENCODER | ||
add_class<EncoderBissC, Encoder>(5), | ||
#endif | ||
#ifdef SSIENCODER | ||
add_class<EncoderSSI, Encoder>(6), | ||
#endif | ||
}; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters