style(llcc68): apply shared clang-format
Add a .clang-format file to the LLCC68 submodule so it can be formatted consistently when edited or checked out independently from the parent repository. Reformat the tracked C and C++ driver sources with the shared style configuration.
This commit is contained in:
@@ -0,0 +1,25 @@
|
|||||||
|
# C++ specific configuration (akin to Google's C++ style)
|
||||||
|
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html#adding-additional-style-options
|
||||||
|
---
|
||||||
|
Language: Cpp
|
||||||
|
BasedOnStyle: LLVM
|
||||||
|
UseTab: ForContinuationAndIndentation
|
||||||
|
IndentWidth: 4
|
||||||
|
TabWidth: 4
|
||||||
|
AccessModifierOffset: -4
|
||||||
|
ColumnLimit: 0
|
||||||
|
NamespaceIndentation: Inner
|
||||||
|
FixNamespaceComments: false
|
||||||
|
AllowShortIfStatementsOnASingleLine: WithoutElse
|
||||||
|
AllowShortLoopsOnASingleLine: true
|
||||||
|
AllowShortBlocksOnASingleLine: Empty
|
||||||
|
IndentCaseLabels: false
|
||||||
|
SortIncludes: Never
|
||||||
|
AlignConsecutiveMacros: AcrossEmptyLines
|
||||||
|
AlignConsecutiveAssignments: Consecutive
|
||||||
|
BreakStringLiterals: true
|
||||||
|
LineEnding: LF
|
||||||
|
MaxEmptyLinesToKeep: 2
|
||||||
|
BreakBeforeBraces: Attach
|
||||||
|
InsertBraces: true
|
||||||
|
BreakAfterAttributes: Always
|
||||||
@@ -1143,7 +1143,8 @@ namespace llcc68 = app::driver::llcc68;
|
|||||||
}
|
}
|
||||||
|
|
||||||
namespace std {
|
namespace std {
|
||||||
template <> struct is_error_code_enum<app::driver::llcc68::Errc> : true_type {};
|
template <>
|
||||||
|
struct is_error_code_enum<app::driver::llcc68::Errc> : true_type {};
|
||||||
} // namespace std
|
} // namespace std
|
||||||
|
|
||||||
#endif /* ECC594CF_EDF0_42B5_8518_0EB3B3583727 */
|
#endif /* ECC594CF_EDF0_42B5_8518_0EB3B3583727 */
|
||||||
|
|||||||
+9
-7
@@ -186,6 +186,7 @@ expected<unit, error_code> LLCC68::set_rf_switch_state(RfSwitchState state) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
switch (config().rf_switch_mode) {
|
switch (config().rf_switch_mode) {
|
||||||
|
case LLCC68_RF_SWITCH_DIO2_SINGLE:
|
||||||
case LLCC68_RF_SWITCH_NONE:
|
case LLCC68_RF_SWITCH_NONE:
|
||||||
return unit{};
|
return unit{};
|
||||||
case LLCC68_RF_SWITCH_GPIO_COMPLEMENTARY: {
|
case LLCC68_RF_SWITCH_GPIO_COMPLEMENTARY: {
|
||||||
@@ -205,10 +206,6 @@ expected<unit, error_code> LLCC68::set_rf_switch_state(RfSwitchState state) {
|
|||||||
APP_RADIO_RETURN_ERR(r);
|
APP_RADIO_RETURN_ERR(r);
|
||||||
return set_gpio(*rx, state == RfSwitchState::RX ? 1 : 0);
|
return set_gpio(*rx, state == RfSwitchState::RX ? 1 : 0);
|
||||||
}
|
}
|
||||||
case LLCC68_RF_SWITCH_DIO2_SINGLE:
|
|
||||||
if (auto rx = rx_enable_gpio()) {
|
|
||||||
return set_gpio(*rx, 1);
|
|
||||||
}
|
|
||||||
return unit{};
|
return unit{};
|
||||||
default:
|
default:
|
||||||
return ue(-EINVAL);
|
return ue(-EINVAL);
|
||||||
@@ -701,9 +698,14 @@ expected<ChipType, error_code> LLCC68::hal_get_chip_type() {
|
|||||||
|
|
||||||
expected<unit, error_code> LLCC68::set_dio_irq_params(irq_params_t params) {
|
expected<unit, error_code> LLCC68::set_dio_irq_params(irq_params_t params) {
|
||||||
const uint8_t data[8] = {
|
const uint8_t data[8] = {
|
||||||
params.irqMask.msb(), params.irqMask.lsb(), params.dio1Mask.msb(),
|
params.irqMask.msb(),
|
||||||
params.dio1Mask.lsb(), params.dio2Mask.msb(), params.dio2Mask.lsb(),
|
params.irqMask.lsb(),
|
||||||
params.dio3Mask.msb(), params.dio3Mask.lsb(),
|
params.dio1Mask.msb(),
|
||||||
|
params.dio1Mask.lsb(),
|
||||||
|
params.dio2Mask.msb(),
|
||||||
|
params.dio2Mask.lsb(),
|
||||||
|
params.dio3Mask.msb(),
|
||||||
|
params.dio3Mask.lsb(),
|
||||||
};
|
};
|
||||||
return write_stream(RADIOLIB_SX126X_CMD_SET_DIO_IRQ_PARAMS, data);
|
return write_stream(RADIOLIB_SX126X_CMD_SET_DIO_IRQ_PARAMS, data);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user