Skip to content

Commit cc2855d

Browse files
feat: DigitalToAnalogPinImplStm improvements (#471)
* Define tag types as constexpr * Zero-initialize handle structure
1 parent 00e860c commit cc2855d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

hal_st/stm32fxxx/DigitalToAnalogPinStm.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@ namespace hal
2121
public:
2222
#if defined(DAC_CHIPCONNECT_BOTH)
2323
// clang-format off
24-
static const struct Internal{} internal;
25-
static const struct External{} external;
26-
static const struct Both{} both;
27-
24+
static constexpr struct Internal{} internal{};
25+
static constexpr struct External{} external{};
26+
static constexpr struct Both{} both{};
2827
// clang-format on
2928

3029
enum struct Channel : uint32_t
@@ -66,7 +65,7 @@ namespace hal
6665
friend class DigitalToAnalogPinImplStm;
6766

6867
uint8_t index;
69-
DAC_HandleTypeDef handle;
68+
DAC_HandleTypeDef handle{};
7069
};
7170
}
7271

0 commit comments

Comments
 (0)