Skip to content

Commit

Permalink
feat: DigitalToAnalogPinImplStm improvements (#471)
Browse files Browse the repository at this point in the history
* Define tag types as constexpr

* Zero-initialize handle structure
  • Loading branch information
fabiangottstein authored Dec 19, 2024
1 parent 00e860c commit cc2855d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions hal_st/stm32fxxx/DigitalToAnalogPinStm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ namespace hal
public:
#if defined(DAC_CHIPCONNECT_BOTH)
// clang-format off
static const struct Internal{} internal;
static const struct External{} external;
static const struct Both{} both;

static constexpr struct Internal{} internal{};
static constexpr struct External{} external{};
static constexpr struct Both{} both{};
// clang-format on

enum struct Channel : uint32_t
Expand Down Expand Up @@ -66,7 +65,7 @@ namespace hal
friend class DigitalToAnalogPinImplStm;

uint8_t index;
DAC_HandleTypeDef handle;
DAC_HandleTypeDef handle{};
};
}

Expand Down

0 comments on commit cc2855d

Please sign in to comment.