Skip to content

Commit

Permalink
Reformatting the universe
Browse files Browse the repository at this point in the history
  • Loading branch information
mjh9585 committed Aug 10, 2024
1 parent 05ea661 commit 6daaa37
Show file tree
Hide file tree
Showing 131 changed files with 2,324 additions and 2,449 deletions.
27 changes: 18 additions & 9 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,22 @@
BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: None
AlignConsecutiveAssignments: true
AlignConsecutiveMacros: true
AlignEscapedNewlines: Left
AlignOperands: DontAlign
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Always
AllowShortCaseLabelsOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: MultiLine
AlwaysBreakTemplateDeclarations: Yes
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: false
Expand All @@ -29,13 +32,18 @@ BraceWrapping:
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: true
BinPackArguments: false
BinPackParameters: true
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeTernaryOperators: false
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
ColumnLimit: 0
ColumnLimit: 120
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ContinuationIndentWidth: 4
FixNamespaceComments: true
IncludeBlocks: Preserve
IndentCaseLabels: false
IndentPPDirectives: BeforeHash
IndentWidth: 4
Expand All @@ -45,23 +53,24 @@ NamespaceIndentation: None
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PointerAlignment: Left
ReflowComments: false
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 0
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
TabWidth: 4
UseTab: Never
AlignEscapedNewlines: Left
944 changes: 472 additions & 472 deletions include/core/dev/BitmapFonts.hpp

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions include/core/dev/Encoder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class Encoder {
/** counter for how many updates have occurred since the encoder was moved */
int8_t currentRelPos;

//INTERRUPT RELATED VARIABLES
// INTERRUPT RELATED VARIABLES
/** the change since the last update was called, updated in the interrupt handler */
int64_t interruptChange = 0;
/** the most recent time in milliseconds since the last interrupt on pin A */
Expand All @@ -99,16 +99,18 @@ class Encoder {
bool changePosition(int64_t change);

/**
* Handles the interrupt generated by pin a. If two interrupts occur too soon after one another the second is ignored.
* Handles the interrupt generated by pin a. If two interrupts occur too soon after one another the second is
* ignored.
*/
void aInterruptHandler();

/**
* Handles the interrupt generated by pin b. If two interrupts occur too soon after one another the second is ignored.
* Handles the interrupt generated by pin b. If two interrupts occur too soon after one another the second is
* ignored.
*/
void bInterruptHandler();
};

};// namespace core::DEV
}// namespace core::DEV
} // namespace core::DEV

#endif
2 changes: 1 addition & 1 deletion include/core/dev/IWDG.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ class IWDG {
virtual void refresh() = 0;
};

}// namespace core::DEV
} // namespace core::DEV

#endif
51 changes: 26 additions & 25 deletions include/core/dev/LCD.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@
#include <core/utils/time.hpp>
#include <stdint.h>

#define ADCSELECT 0xA0
#define DISPLAYOFF 0xAE
#define COMDIRSCAN 0xC8
#define LCDBIASET 0xA2
#define POWERCONTROLSET 0x2F
#define RESRATIOSET 0x26
#define ADCSELECT 0xA0
#define DISPLAYOFF 0xAE
#define COMDIRSCAN 0xC8
#define LCDBIASET 0xA2
#define POWERCONTROLSET 0x2F
#define RESRATIOSET 0x26
#define ELECTRONICVOLCOMMAND 0x81
#define ELECTRONICVOLVALUE 0x11
#define DISPLAYON 0xAF
#define DISPLAYOFF 0xAE
#define ELECTRONICVOLVALUE 0x11
#define DISPLAYON 0xAF
#define DISPLAYOFF 0xAE

#define MAX_SECTIONS 12
#define MAX_SECTION_HEIGHT 8
#define MAX_SECTIONS 12
#define MAX_SECTION_HEIGHT 8
#define MAX_SECTION_PER_ROW 3

namespace core::DEV {
/**
* This class represents the structure to command a GLCD with
* a ST7565 controller.
*/
* This class represents the structure to command a GLCD with
* a ST7565 controller.
*/
class LCD {
public:
/**
Expand All @@ -49,15 +49,16 @@ class LCD {
LCD(core::IO::GPIO& regSelect, core::IO::GPIO& reset, core::IO::SPI& spi);

/**
* Constructor for the LCD class
*
* @param[in] regSelect Register select pin
* @param[in] reset Reset pin
* @param[in] spi SPI class for communication
* @param[in] numberOfSections number of sections that the display will show
* @param[in] sectionsPerRow number of sections per row to display
*/
LCD(core::IO::GPIO& regSelect, core::IO::GPIO& reset, core::IO::SPI& spi, uint8_t numberOfSections, uint8_t sectionsPerRow);
* Constructor for the LCD class
*
* @param[in] regSelect Register select pin
* @param[in] reset Reset pin
* @param[in] spi SPI class for communication
* @param[in] numberOfSections number of sections that the display will show
* @param[in] sectionsPerRow number of sections per row to display
*/
LCD(core::IO::GPIO& regSelect, core::IO::GPIO& reset, core::IO::SPI& spi, uint8_t numberOfSections,
uint8_t sectionsPerRow);

/**
* Writes data to the LCD
Expand Down Expand Up @@ -184,7 +185,7 @@ class LCD {
core::IO::GPIO& reset;

/** Chip select pin for the LCD */
//core::IO::GPIO& chipSelect; // TODO: Need to figure out purpose of this
// core::IO::GPIO& chipSelect; // TODO: Need to figure out purpose of this

/** SPI port for the LCD controller */
core::IO::SPI& spi;
Expand All @@ -203,6 +204,6 @@ class LCD {
};
};

}// namespace core::DEV
} // namespace core::DEV

#endif
4 changes: 2 additions & 2 deletions include/core/dev/LED.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class LED {
*/
enum class ActiveState {
HIGH = 0u,
LOW = 1u
LOW = 1u
};

/**
Expand Down Expand Up @@ -42,6 +42,6 @@ class LED {
ActiveState activeState;
};

}// namespace core::DEV
} // namespace core::DEV

#endif
4 changes: 2 additions & 2 deletions include/core/dev/MCUTimer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ TIM_TypeDef* getTIM(MCUTimer mcuTimer) {
return timPeriph;
}

}// namespace core::DEV
} // namespace core::DEV

#endif//_EVT_MCUTIMER_HPP_
#endif //_EVT_MCUTIMER_HPP_
2 changes: 1 addition & 1 deletion include/core/dev/RTC.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ class RTC {
virtual void setTime(core::time::TimeStamp& time) = 0;
};

}// namespace core::DEV
} // namespace core::DEV

#endif
4 changes: 2 additions & 2 deletions include/core/dev/RTCTimer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ class RTCTimer : public Timer {
bool bTimerStopped;
};

}// namespace core::DEV
} // namespace core::DEV

#endif//EVT_TIMER_H
#endif // EVT_TIMER_H
2 changes: 1 addition & 1 deletion include/core/dev/Thermistor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ class Thermistor {
uint32_t (*conversion)(uint32_t);
};

}// namespace core::DEV
} // namespace core::DEV

#endif
4 changes: 2 additions & 2 deletions include/core/dev/Timer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ class Timer {
virtual void setPeriod(uint32_t clockPeriod) = 0;
};

}// namespace core::DEV
} // namespace core::DEV

#endif//EVT_TIMER_HPP
#endif // EVT_TIMER_HPP
4 changes: 2 additions & 2 deletions include/core/dev/button.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Button {

/** The GPIO state that means the button is being pressed */
IO::GPIO::State pressedState;
};

};// namespace core::DEV
}// namespace core::DEV
} // namespace core::DEV
#endif
2 changes: 1 addition & 1 deletion include/core/dev/platform/f3xx/IWDGf3xx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ class IWDGf3xx : public IWDG {
bool isActive = false;
};

}// namespace core::DEV
} // namespace core::DEV

#endif
2 changes: 1 addition & 1 deletion include/core/dev/platform/f3xx/RTCf3xx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ class RTCf3xx : public RTC {
RTC_HandleTypeDef halRTC;
};

}// namespace core::DEV
} // namespace core::DEV

#endif
4 changes: 2 additions & 2 deletions include/core/dev/platform/f3xx/Timerf3xx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ class Timerf3xx : public Timer {
void initTimer(TIM_TypeDef* timerPeripheral, uint32_t clockPeriod);
};

}// namespace core::DEV
} // namespace core::DEV

#endif//_EVT_TIMER3xx_H
#endif //_EVT_TIMER3xx_H
4 changes: 2 additions & 2 deletions include/core/dev/platform/f4xx/IWDGf4xx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ class IWDGf4xx : public IWDG {
bool isActive = false;
};

}// namespace core::DEV
} // namespace core::DEV

#endif//EVT_IWDGF4XX_HPP
#endif // EVT_IWDGF4XX_HPP
2 changes: 1 addition & 1 deletion include/core/dev/platform/f4xx/RTCf4xx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ class RTCf4xx : public RTC {
RTC_HandleTypeDef halRTC;
};

}// namespace core::DEV
} // namespace core::DEV

#endif
5 changes: 3 additions & 2 deletions include/core/dev/storage/EEPROM.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class EEPROM {
*/
virtual void writeWords(uint8_t address, uint32_t* dataArr, uint8_t numWords) = 0;
};
}// namespace core::DEV

#endif//EVT_EEPROM_HPP
} // namespace core::DEV

#endif // EVT_EEPROM_HPP
5 changes: 3 additions & 2 deletions include/core/dev/storage/M24C32.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class M24C32 : public EEPROM {
/** I2C instance to be used for I2C communication */
IO::I2C& i2c;
};
}// namespace core::DEV

#endif//EVT_M24C32
} // namespace core::DEV

#endif // EVT_M24C32
2 changes: 1 addition & 1 deletion include/core/io/ADC.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ class ADC {
Pin pin;
};

}// namespace core::IO
} // namespace core::IO

#endif
11 changes: 6 additions & 5 deletions include/core/io/CAN.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ class CAN {
* interface.
*/
enum class CANStatus {
OK = 0,
OK = 0,
TIMEOUT = 1,
ERROR = 2
ERROR = 2
};

/**
Expand Down Expand Up @@ -94,7 +94,7 @@ class CAN {
* Instantiates a new CAN filter using the 16-bit ID-Mask mode. If a filter bank
* that is already in use is provided, the existing filter will be overwritten.
* A second pair of filter Id and mask can be given to the same filter bank.
*
*
* @param[in] filterExplicitId 11-bit identifier that must be an exact match to pass
* @param[in] filterMask 16-bit mask where [1] means care and [0] means don't care
* @param[in] filterBank value between 0-13 where the filter info is stored
Expand All @@ -105,7 +105,7 @@ class CAN {
/**
* Enable or disable a filter that lets through any CAN messages that, following the CANopen
* standard, begin with the Emergency code of 001
*
*
* @param[in] state Enum passed to set filter functional state
* @return The status associated with setting the energency filter state
*/
Expand Down Expand Up @@ -144,6 +144,7 @@ class CAN {
/** If CAN should operate in loop back mode */
bool loopbackEnabled;
};
}// namespace core::IO

} // namespace core::IO

#endif
8 changes: 4 additions & 4 deletions include/core/io/CANDevice.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ class CANDevice {
virtual uint8_t getNumElements() = 0;

/**
* Get the device's node ID
*
* @return The node ID of the can device.
* Get the device's node ID
*
* @return The node ID of the can device.
*/
virtual uint8_t getNodeID() = 0;
};

#endif//EVT_CANDEVICE_HPP
#endif // EVT_CANDEVICE_HPP
Loading

0 comments on commit 6daaa37

Please sign in to comment.